1.1 --- a/epoc32/include/badesca.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/badesca.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,322 @@
1.4 -badesca.h
1.5 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +// Written by DavidW, October 1996
1.19 +// Descriptor arrays
1.20 +//
1.21 +//
1.22 +
1.23 +#if !defined(__BADESCA_H__)
1.24 +#define __BADESCA_H__
1.25 +
1.26 +#if !defined(__BAMDESCA_H__)
1.27 +#include <bamdesca.h>
1.28 +#endif
1.29 +
1.30 +#if !defined(__E32BASE_H__)
1.31 +#include <e32base.h>
1.32 +#endif
1.33 +
1.34 +
1.35 +class CDesC8Array : public CArrayFixBase, public MDesC8Array
1.36 +/** An implementation base class for 8 bit descriptor arrays.
1.37 +
1.38 +It provides some of the behaviour for 8 bit descriptor arrays. The class is
1.39 +abstract and cannot be instantiated.
1.40 +@publishedAll
1.41 +@released
1.42 +*/
1.43 + {
1.44 +protected:
1.45 + IMPORT_C CDesC8Array(TBufRep aRep,TInt aGranularity);
1.46 +public:
1.47 + IMPORT_C ~CDesC8Array();
1.48 + IMPORT_C void AppendL(const TDesC8& aPtr);
1.49 + IMPORT_C void InsertL(TInt aPos,const TDesC8& aPtr);
1.50 + IMPORT_C TInt InsertIsqL(const TDesC8& aPtr,TKeyCmpText aTextComparisonType=ECmpFolded);
1.51 + IMPORT_C TInt InsertIsqAllowDuplicatesL(const TDesC8& aPtr,TKeyCmpText aTextComparisonType=ECmpFolded);
1.52 + IMPORT_C void Sort(TKeyCmpText aTextComparisonType=ECmpFolded);
1.53 + IMPORT_C TInt Find(const TDesC8& aPtr,TInt& aPos,TKeyCmpText aTextComparisonType=ECmpFolded) const;
1.54 + IMPORT_C TInt FindIsq(const TDesC8& aPtr,TInt& aPos,TKeyCmpText aTextComparisonType=ECmpFolded) const;
1.55 + IMPORT_C void Delete(TInt aPos);
1.56 + IMPORT_C void Delete(TInt aIndex,TInt aCount);
1.57 + IMPORT_C void Reset();
1.58 + inline TPtrC8 operator[](TInt aIndex) const;
1.59 +// from MDesC8Array
1.60 + IMPORT_C TInt MdcaCount() const;
1.61 + IMPORT_C TPtrC8 MdcaPoint(TInt aIndex) const;
1.62 + };
1.63 +
1.64 +inline TPtrC8 CDesC8Array::operator[](TInt aIndex) const
1.65 + { return(MdcaPoint(aIndex)); }
1.66 +
1.67 +
1.68 +class CDesC8ArrayFlat : public CDesC8Array
1.69 +/** An array of 8 bit descriptors implemented using a flat buffer.
1.70 +"bafl.lib"
1.71 +@since 5.0
1.72 +@publishedAll
1.73 +@released
1.74 +*/
1.75 + {
1.76 +public:
1.77 + IMPORT_C CDesC8ArrayFlat(TInt aGranularity);
1.78 + IMPORT_C ~CDesC8ArrayFlat();
1.79 + };
1.80 +
1.81 +
1.82 +class CDesC8ArraySeg : public CDesC8Array
1.83 +/** An array of 8 bit descriptors implemented using a segmented buffer.
1.84 +"bafl.lib"
1.85 +@since 5.0
1.86 +@publishedAll
1.87 +@released
1.88 +*/
1.89 + {
1.90 +public:
1.91 + IMPORT_C CDesC8ArraySeg(TInt aGranularity);
1.92 + IMPORT_C ~CDesC8ArraySeg();
1.93 + };
1.94 +
1.95 +
1.96 +class CDesC16Array : public CArrayFixBase, public MDesC16Array
1.97 +/** An implementation base class for 16 bit descriptor arrays. It provides some
1.98 +of the behaviour for 16 bit descriptor arrays.
1.99 +
1.100 +The class is abstract and cannot be instantiated.
1.101 +" bafl.lib "
1.102 +@since 5.0
1.103 +@publishedAll
1.104 +@released
1.105 +*/
1.106 + {
1.107 +protected:
1.108 + IMPORT_C CDesC16Array(TBufRep aRep,TInt aGranularity);
1.109 +public:
1.110 + IMPORT_C ~CDesC16Array();
1.111 + IMPORT_C void AppendL(const TDesC16& aPtr);
1.112 + IMPORT_C void InsertL(TInt aPos,const TDesC16& aPtr);
1.113 + IMPORT_C TInt InsertIsqL(const TDesC16& aPtr,TKeyCmpText aTextComparisonType=ECmpFolded);
1.114 + IMPORT_C TInt InsertIsqAllowDuplicatesL(const TDesC16& aPtr,TKeyCmpText aTextComparisonType=ECmpFolded);
1.115 + IMPORT_C void Sort(TKeyCmpText aTextComparisonType=ECmpFolded);
1.116 + IMPORT_C TInt Find(const TDesC16& aPtr,TInt& aPos,TKeyCmpText aTextComparisonType=ECmpFolded) const;
1.117 + IMPORT_C TInt FindIsq(const TDesC16& aPtr,TInt& aPos,TKeyCmpText aTextComparisonType=ECmpFolded) const;
1.118 + IMPORT_C void Delete(TInt aPos);
1.119 + IMPORT_C void Delete(TInt aIndex,TInt aCount);
1.120 + IMPORT_C void Reset();
1.121 + inline TPtrC16 operator[](TInt aIndex) const;
1.122 +// from MDesC16Array
1.123 + IMPORT_C TInt MdcaCount() const;
1.124 + IMPORT_C TPtrC16 MdcaPoint(TInt aIndex) const;
1.125 + };
1.126 +
1.127 +
1.128 +
1.129 +inline TPtrC16 CDesC16Array::operator[](TInt aIndex) const
1.130 +/** Returns a non-modifiable descriptor to represent the descriptor
1.131 +element located at the specified index within the array.
1.132 +
1.133 +@param aIndex The position of the descriptor element within the array.
1.134 +The position is relative to zero; i.e. zero implies the first descriptor
1.135 +element in the array. This value must be non-negative and less than the
1.136 +number of descriptors currently within the array otherwise the operator
1.137 +panics with
1.138 +@code
1.139 +EArrayIndexOutOfRange
1.140 +@endcode
1.141 +@return A 16 bit non-modifiable pointer descriptor. */
1.142 + { return(MdcaPoint(aIndex)); }
1.143 +
1.144 +
1.145 +class CDesC16ArrayFlat : public CDesC16Array
1.146 +/** Array of 16 bit descriptors implemented using a flat buffer.
1.147 +"bafl.lib
1.148 +@since 5.0
1.149 +@publishedAll
1.150 +@released
1.151 +*/
1.152 + {
1.153 +public:
1.154 + IMPORT_C CDesC16ArrayFlat(TInt aGranularity);
1.155 + IMPORT_C ~CDesC16ArrayFlat();
1.156 + };
1.157 +
1.158 +
1.159 +class CDesC16ArraySeg : public CDesC16Array
1.160 +/** An array of 16 bit descriptors implemented using a segmented buffer.
1.161 +"bafl.lib"
1.162 +@since 5.0
1.163 +@publishedAll
1.164 +@released
1.165 +*/
1.166 + {
1.167 +public:
1.168 + IMPORT_C CDesC16ArraySeg(TInt aGranularity);
1.169 + IMPORT_C ~CDesC16ArraySeg();
1.170 + };
1.171 +
1.172 +
1.173 +class CPtrC8Array : public CArrayFixFlat<TPtrC8>, public MDesC8Array
1.174 +/** Array of 8 bit non-modifiable pointer descriptors, TPtrC8, implemented using
1.175 +a flat buffer.
1.176 +"bafl.lib"
1.177 +@since 5.0
1.178 +@publishedAll
1.179 +@released
1.180 +*/
1.181 + {
1.182 +public:
1.183 + IMPORT_C CPtrC8Array(TInt aGranularity);
1.184 + IMPORT_C ~CPtrC8Array();
1.185 +//
1.186 + IMPORT_C void CopyL(const MDesC8Array& aArray);
1.187 + inline void operator=(const MDesC8Array& aArray);
1.188 +// Mixin members
1.189 + IMPORT_C TInt MdcaCount() const;
1.190 + IMPORT_C TPtrC8 MdcaPoint(TInt aIndex) const;
1.191 + };
1.192 +
1.193 +
1.194 +class CPtrC16Array : public CArrayFixFlat<TPtrC16>, public MDesC16Array
1.195 +/** An array of 16 bit non-modifiable pointer descriptors, TPtrC16, implemented
1.196 +using a flat buffer.
1.197 +"bafl.lib"
1.198 +@since 5.0
1.199 +@publishedAll
1.200 +@released
1.201 +*/
1.202 + {
1.203 +public:
1.204 + IMPORT_C CPtrC16Array(TInt aGranularity);
1.205 + IMPORT_C ~CPtrC16Array();
1.206 +//
1.207 + IMPORT_C void CopyL(const MDesC16Array& aArray);
1.208 + inline void operator=(const MDesC16Array& aArray);
1.209 +// Mixin members
1.210 + IMPORT_C TInt MdcaCount() const;
1.211 + IMPORT_C TPtrC16 MdcaPoint(TInt aIndex) const;
1.212 + };
1.213 +
1.214 +
1.215 +inline void CPtrC8Array::operator=(const MDesC8Array& aArray)
1.216 +/** Copies a descriptor array into this array, deleting any pre-existing
1.217 +elements.
1.218 +
1.219 +The function constructs TPtrC8 elements for each descriptor element
1.220 +in the specified descriptor array. This operator behaves in the
1.221 +same ways as CPtrC8Array::CopyL().
1.222 +
1.223 +@param aArrayA reference to any descriptor array which satisfies
1.224 +the protocol defined by this mixin class. */
1.225 + {CopyL(aArray);}
1.226 +
1.227 +
1.228 +inline void CPtrC16Array::operator=(const MDesC16Array& aArray)
1.229 +/** Copies a descriptor array into this array, deleting any pre-existing
1.230 +elements.
1.231 +
1.232 +The function constructs TPtrC16 elements for each descriptor element
1.233 +in the specified descriptor array.This operator behaves in the
1.234 +same ways as CPtrC16Array::CopyL().
1.235 +
1.236 +@param aArray A reference to any descriptor array which satisfies
1.237 +the protocol defined by this mixin class. */
1.238 + {CopyL(aArray);}
1.239 +
1.240 +// generic text array definitions
1.241 +
1.242 +#if defined (_UNICODE)
1.243 +/** Build independent implementation base class for descriptor arrays.
1.244 +
1.245 +@see CDesC8Array
1.246 +@see CDesC16Array
1.247 +@publishedAll
1.248 +@released
1.249 +*/
1.250 +typedef CDesC16Array CDesCArray;
1.251 +
1.252 +/** Build independent array of descriptors implemented using a flat buffer.
1.253 +
1.254 +@see CDesC8ArrayFlat
1.255 +@see CDesC16ArrayFlat
1.256 +@publishedAll
1.257 +@released
1.258 +*/
1.259 +typedef CDesC16ArrayFlat CDesCArrayFlat;
1.260 +
1.261 +/** Build independent array of descriptors implemented using a segmented buffer.
1.262 +
1.263 +@see CDesC16ArraySeg
1.264 +@see CDesC8ArraySeg
1.265 +@publishedAll
1.266 +@released
1.267 +*/
1.268 +typedef CDesC16ArraySeg CDesCArraySeg;
1.269 +
1.270 +/** Build independent array of non-modifiable pointer descriptors.
1.271 +
1.272 +A 16 bit build variant is generated for a Unicode build and an 8 bit build
1.273 +variant generated for a non-Unicode build.
1.274 +
1.275 +This build independent type should always be used unless an explicit 8 bit
1.276 +or 16 bit build variant is required.
1.277 +
1.278 +@see CPtrC16Array
1.279 +@see CPtrC8Array
1.280 +@publishedAll
1.281 +@released
1.282 +*/
1.283 +typedef CPtrC16Array CPtrCArray;
1.284 +#else
1.285 +/** Build independent implementation base class for descriptor arrays.
1.286 +
1.287 +@see CDesC8Array
1.288 +@see CDesC16Array
1.289 +@publishedAll
1.290 +@released
1.291 +*/
1.292 +typedef CDesC8Array CDesCArray;
1.293 +/** Build independent array of descriptors implemented using a flat buffer.
1.294 +
1.295 +@see CDesC8ArrayFlat
1.296 +@see CDesC16ArrayFlat
1.297 +@publishedAll
1.298 +@released
1.299 +*/
1.300 +typedef CDesC8ArrayFlat CDesCArrayFlat;
1.301 +/** Build independent array of descriptors implemented using a segmented buffer.
1.302 +
1.303 +@see CDesC16ArraySeg
1.304 +@see CDesC8ArraySeg
1.305 +@publishedAll
1.306 +@released
1.307 +*/
1.308 +typedef CDesC8ArraySeg CDesCArraySeg;
1.309 +/** Build independent array of non-modifiable pointer descriptors.
1.310 +
1.311 +A 16 bit build variant is generated for a Unicode build and an 8 bit build
1.312 +variant generated for a non-Unicode build.
1.313 +
1.314 +This build independent type should always be used unless an explicit 8 bit
1.315 +or 16 bit build variant is required.
1.316 +
1.317 +@see CPtrC16Array
1.318 +@see CPtrC8Array
1.319 +@publishedAll
1.320 +@released
1.321 +*/
1.322 +typedef CPtrC8Array CPtrCArray;
1.323 +#endif
1.324 +
1.325 +
1.326 +#endif // __BADESCA_H__