os/security/securityanddataprivacytools/securitytools/certapp/store--/e32base.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/securityanddataprivacytools/securitytools/certapp/store--/e32base.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,653 @@
     1.4 +#ifndef __e32base_h__
     1.5 +#define __e32base_h__/*
     1.6 +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* under the terms of the License "Eclipse Public License v1.0"
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description: 
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +/**
    1.24 + @file
    1.25 + @internalComponent
    1.26 +*/
    1.27 +
    1.28 +#include <string>
    1.29 +#include <vector>
    1.30 +#include <stdint.h>
    1.31 +#define __ASSERT_ALWAYS(cond, func) if(!(cond)) func
    1.32 +#define __ASSERT_DEBUG(cond, func) if(!(cond)) func
    1.33 +#define REINTERPRET_CAST(type,val) reinterpret_cast<type>(val)
    1.34 +#define CleanupClosePushL(xx) 
    1.35 +#define _LIT(name,str)  TLIT16 name(str)
    1.36 +#define _LIT16(name,str)  TLIT16 name(str)
    1.37 +#define _LIT8(name,str)  TLIT8 name(str)
    1.38 +#define _L8(str) TLIT8(str)
    1.39 +#define _L16(str) TLIT16(str)
    1.40 +//#define _L(str) TLIT16(str)
    1.41 +#define LOCAL_C static
    1.42 +#define GLDEF_C
    1.43 +#define IMPORT_C
    1.44 +#define EXPORT_C
    1.45 +#define __UHEAP_MARK
    1.46 +#define __UHEAP_MARKEND
    1.47 +#define __LEAVE(err) FatalError()	
    1.48 +
    1.49 +extern void FatalError();
    1.50 +
    1.51 +typedef uint64_t TUint64;
    1.52 +typedef int64_t TInt64;
    1.53 +
    1.54 +typedef	int	TInt32;
    1.55 +typedef	unsigned int TUint32;
    1.56 +
    1.57 +typedef	short TInt16;
    1.58 +typedef	unsigned short TUint16;
    1.59 +
    1.60 +typedef	signed char	TInt8;
    1.61 +typedef	unsigned char TUint8;
    1.62 +
    1.63 +typedef	TUint32 TChar;
    1.64 +
    1.65 +typedef	int TBool;
    1.66 +
    1.67 +typedef void TAny;
    1.68 +
    1.69 +#define _MAKE_TINT64_ZX(x)	((TInt64)((TUint32)(x)))
    1.70 +#define _MAKE_TUINT64_ZX(x)	((TUint64)((TUint32)(x)))
    1.71 +#define MAKE_TINT64(h,l)	( (_MAKE_TINT64_ZX(h)<<32) | _MAKE_TINT64_ZX(l) )
    1.72 +#define MAKE_TUINT64(h,l)	( (_MAKE_TUINT64_ZX(h)<<32) | _MAKE_TUINT64_ZX(l) )
    1.73 +
    1.74 +
    1.75 +#define	I64HIGH(x)			( (TUint32)((x)>>32) )
    1.76 +#define	I64LOW(x)			( (TUint32)(x) )
    1.77 +#define	I64INT(x)			( (TInt)(x) )
    1.78 +
    1.79 +
    1.80 +typedef unsigned short int TText16;
    1.81 +typedef TText16 TText;
    1.82 +typedef int TInt;
    1.83 +typedef unsigned int TUint;
    1.84 +
    1.85 +#define __Size (sizeof(TUint)/sizeof(TUint16))
    1.86 +#define __Align(s) ((((s)+__Size-1)/__Size)*__Size)
    1.87 +
    1.88 +/** The largest integer value which can be stored as a TCardinality type. */
    1.89 +const TInt KMaxCardinality=0x1fffffff;
    1.90 +const TInt KMaxName=0x80;
    1.91 +
    1.92 +#define FALSE false
    1.93 +#define TRUE true
    1.94 +enum TFalse {
    1.95 +            EFalse=FALSE
    1.96 +            };
    1.97 +enum TTrue {
    1.98 +           ETrue=TRUE
    1.99 +           };
   1.100 +
   1.101 +#ifndef _FOFF
   1.102 +#if __GNUC__ < 4
   1.103 +#define _FOFF(c,f)			(((TInt)&(((c *)0x1000)->f))-0x1000)
   1.104 +#else
   1.105 +#define _FOFF(c,f)			(((TInt)&(((c *)0x1000)->f))-0x1000)
   1.106 +// __builtin_offset will issue warning of there are any member functions...
   1.107 +//#define _FOFF(c,f)			__builtin_offsetof(c,f)
   1.108 +#endif
   1.109 +#endif
   1.110 +
   1.111 +
   1.112 +const TInt KMaxTInt8=0x7f;
   1.113 +const TInt KMinTInt8=(-128);
   1.114 +const TUint KMaxTUint8=0xffu;
   1.115 +const TInt KMaxTInt16=0x7fff;
   1.116 +const TInt KMinTInt16=(-32768);
   1.117 +const TUint KMaxTUint16=0xffffu;
   1.118 +const TInt KMaxTInt32=0x7fffffff;
   1.119 +const TInt KMinTInt32=(TInt)0x80000000;
   1.120 +const TUint KMaxTUint32=0xffffffffu;
   1.121 +const TInt KMaxTInt=0x7fffffff;
   1.122 +const TInt KMinTInt=(TInt)0x80000000;
   1.123 +const TUint KMaxTUint=0xffffffffu;
   1.124 +//const TInt64 KMaxTInt64 = I64LIT(0x7fffffffffffffff);
   1.125 +//const TInt64 KMinTInt64 = UI64LIT(0x8000000000000000);
   1.126 +//const TUint64 KMaxTUint64 = UI64LIT(0xffffffffffffffff);
   1.127 +
   1.128 +
   1.129 +
   1.130 +
   1.131 +class TSize
   1.132 +	{
   1.133 +public:
   1.134 +	TSize() 
   1.135 +		{
   1.136 +		iWidth=0;
   1.137 +		iHeight=0;
   1.138 +		}
   1.139 +	TSize(TInt aWidth, TInt aHeight)
   1.140 +		: iWidth(aWidth), iHeight(aHeight)
   1.141 +		{
   1.142 +		}
   1.143 +private:
   1.144 +	TInt iWidth;
   1.145 +	TInt iHeight;
   1.146 +	};
   1.147 +
   1.148 +class TDesC8
   1.149 +	{
   1.150 +public:
   1.151 +	
   1.152 +	TInt Length() const
   1.153 +		{
   1.154 +			return iCurrentLength;
   1.155 +		}
   1.156 +	
   1.157 +	TInt Size() const
   1.158 +		{
   1.159 +			return iCurrentLength;
   1.160 +		}
   1.161 +
   1.162 +	virtual const TUint8 *Ptr() const = 0;
   1.163 +	virtual const TUint8 &operator[](TInt anIndex) const = 0;
   1.164 +
   1.165 +	TBool operator==(const TDesC8 &aDes) const;
   1.166 +	
   1.167 +protected:
   1.168 +	TDesC8();
   1.169 +	TDesC8(const TDesC8 &aRef);
   1.170 +	TDesC8(TInt aLength);
   1.171 +	TInt iCurrentLength;
   1.172 +
   1.173 +
   1.174 +private:
   1.175 +	// Assignment is not publicly available
   1.176 +	TDesC8 &operator=(const TDesC8 &aRhs);
   1.177 +	};
   1.178 +
   1.179 +class TDesC16;
   1.180 +class TDes8 : public TDesC8
   1.181 +	{
   1.182 +public:
   1.183 +
   1.184 +	void Copy(const TDesC16 &aDes);
   1.185 +	virtual void Append(TChar aChar) = 0;
   1.186 +	TInt MaxLength() const
   1.187 +		{
   1.188 +			return iMaxLength;
   1.189 +		}
   1.190 +
   1.191 +	TInt MaxSize() const
   1.192 +		{
   1.193 +			return iMaxLength;
   1.194 +		}
   1.195 +	
   1.196 +	void SetLength(TInt aLength);
   1.197 +
   1.198 +protected:
   1.199 +	TDes8();
   1.200 +	TDes8(const TDes8 &aRef);
   1.201 +	TDes8(TInt aLength,TInt aMaxLength);
   1.202 +	TInt iMaxLength;
   1.203 +
   1.204 +private:
   1.205 +	// Copy construction and assignment not supported
   1.206 +	TDes8 &operator=(const TDes8 &aRhs);
   1.207 +	};
   1.208 +
   1.209 +class TPtr8 : public TDes8
   1.210 +	{
   1.211 +public:
   1.212 +	TPtr8(TUint8 *aBuf, TInt aLength, TInt aMaxLength)
   1.213 +		: TDes8(aLength, aMaxLength), iPtr(aBuf)
   1.214 +		{
   1.215 +		}
   1.216 +	TPtr8(TUint8 *aBuf, TInt aMaxLength)
   1.217 +		: TDes8(0, aMaxLength), iPtr(aBuf)
   1.218 +		{
   1.219 +		}
   1.220 +
   1.221 +	TPtr8(const TPtr8 &aRhs); // Points at same data
   1.222 +	TPtr8 &operator=(const TPtr8 &aRhs); // copies data
   1.223 +
   1.224 +	virtual const TUint8 *Ptr() const;
   1.225 +	virtual const TUint8 &operator[](TInt anIndex) const;
   1.226 +
   1.227 +	virtual void Append(TChar aChar);
   1.228 +
   1.229 +protected:
   1.230 +	TUint8 *iPtr;
   1.231 +	};
   1.232 +
   1.233 +class TPtrC8 : public TDesC8
   1.234 +	{
   1.235 +public:
   1.236 +	TPtrC8(const TUint8 *aBuf, TInt aLength)
   1.237 +		: TDesC8(aLength), iPtr(aBuf)
   1.238 +		{
   1.239 +		}
   1.240 +	TPtrC8(const TPtrC8 &aRhs); // Points at same data
   1.241 +	TPtrC8 &operator=(const TPtrC8 &aRhs); // copies data
   1.242 +	void Set(TUint8 *aBuf, TInt aLength);
   1.243 +
   1.244 +	virtual const TUint8 *Ptr() const;
   1.245 +	virtual const TUint8 &operator[](TInt anIndex) const;
   1.246 +
   1.247 +protected:
   1.248 +	const TUint8 *iPtr;
   1.249 +	};
   1.250 +
   1.251 +class TDesC16
   1.252 +	{
   1.253 +public:
   1.254 +	TInt Length() const
   1.255 +		{
   1.256 +			return iCurrentLength;
   1.257 +		}
   1.258 +	
   1.259 +	TInt Size() const
   1.260 +		{
   1.261 +			return iCurrentLength * sizeof(TUint16);
   1.262 +		}
   1.263 +
   1.264 +	virtual const TUint16 *Ptr() const = 0;
   1.265 +	virtual const TUint16 &operator[](TInt anIndex) const = 0;
   1.266 +
   1.267 +	TBool operator==(const TDesC8 &aDes) const;
   1.268 +
   1.269 +protected:
   1.270 +	TDesC16();
   1.271 +	TDesC16(const TDesC16 &aRef);
   1.272 +	TDesC16( TInt aLength);
   1.273 +	TInt iCurrentLength;
   1.274 +
   1.275 +private:
   1.276 +	// Disable assignment
   1.277 +	TDesC16 &operator=(const TDesC16 &aRhs);
   1.278 +	};
   1.279 +
   1.280 +class TDes16 : public TDesC16
   1.281 +	{
   1.282 +public:
   1.283 +	TInt MaxLength() const 
   1.284 +		{
   1.285 +			return iMaxLength;
   1.286 +		}
   1.287 +	TInt MaxSize() const 
   1.288 +		{
   1.289 +			return iMaxLength * sizeof(TUint16);
   1.290 +		}
   1.291 +	void SetLength(TInt aLength);
   1.292 +
   1.293 +	virtual void Append(TChar aChar) = 0;
   1.294 +
   1.295 +protected:
   1.296 +	TDes16();
   1.297 +	TDes16(const TDes16 &aRef);
   1.298 +	TDes16(TInt aLength, TInt aMaxLength);
   1.299 +	TInt iMaxLength;
   1.300 +private:
   1.301 +	// Disabled assignment
   1.302 +	TDes16 &operator=(const TDes16 &aRhs);
   1.303 +	};
   1.304 +
   1.305 +class TPtr16 : public TDes16
   1.306 +	{
   1.307 +public:
   1.308 +	TPtr16(TUint16 *aBuf, TInt aLength, TInt aMaxLength)
   1.309 +		: TDes16(aLength, aMaxLength), iPtr(aBuf)
   1.310 +		{
   1.311 +		}
   1.312 +	TPtr16(TUint16 *aBuf, TInt aMaxLength)
   1.313 +		: TDes16(0, aMaxLength), iPtr(aBuf)
   1.314 +		{
   1.315 +		}
   1.316 +	TPtr16(const TPtr16 &aRhs); // Points at same data
   1.317 +	TPtr16 &operator=(const TPtr16 &aRhs); // copies data
   1.318 +
   1.319 +	void Copy(const TDesC8 &aDes);
   1.320 +
   1.321 +	virtual const TUint16 *Ptr() const;
   1.322 +	virtual const TUint16 &operator[](TInt anIndex) const;
   1.323 +	virtual void Append(TChar aChar);
   1.324 +	
   1.325 +protected:
   1.326 +	TUint16 *iPtr;
   1.327 +	};
   1.328 +
   1.329 +class TPtrC16 : public TDesC16
   1.330 +	{
   1.331 +public:
   1.332 +	TPtrC16(const TUint16 *aBuf, TInt aLength)
   1.333 +		: TDesC16(aLength), iPtr(aBuf)
   1.334 +		{
   1.335 +		}
   1.336 +	TPtrC16(const TPtrC16 &aRhs); // Points at same data
   1.337 +	TPtrC16 &operator=(const TPtrC16 &aRhs); // copies data
   1.338 +
   1.339 +	void Set(TUint16 *aBuf, TInt aLength);
   1.340 +
   1.341 +	virtual const TUint16 *Ptr() const;
   1.342 +
   1.343 +	virtual const TUint16 &operator[](TInt anIndex) const;
   1.344 +	
   1.345 +protected:
   1.346 +	const TUint16 *iPtr;
   1.347 +	};
   1.348 +
   1.349 +
   1.350 +typedef TDesC16 TDesC;
   1.351 +
   1.352 +/**
   1.353 +Packages a modifiable pointer descriptor which represents an object of specific 
   1.354 +type.
   1.355 +
   1.356 +The template parameter defines the type of object.
   1.357 +
   1.358 +The object represented by the packaged pointer descriptor is accessible through 
   1.359 +the package.
   1.360 +*/
   1.361 +template <class T>
   1.362 +class TPckg : public TPtr8
   1.363 +	{
   1.364 +public:
   1.365 +	inline TPckg(const T& aRef);
   1.366 +	inline T& operator()();
   1.367 +private:
   1.368 +	TPckg<T>& operator=(const TPckg<T>& aRef);
   1.369 +	};
   1.370 +
   1.371 +// Template class TPckg
   1.372 +template <class T>
   1.373 +inline TPckg<T>::TPckg(const T &aRef)
   1.374 +	: TPtr8((TUint8 *)&aRef,sizeof(T),sizeof(T))
   1.375 +/**
   1.376 +Constructs a packaged modifiable pointer descriptor to represent the specified 
   1.377 +object whose type is defined by the template parameter.
   1.378 +
   1.379 +@param aRef The object to be represented by this packaged modifiable pointer 
   1.380 +            descriptor.
   1.381 +*/
   1.382 +	{}
   1.383 +
   1.384 +template <class T>
   1.385 +inline T &TPckg<T>::operator()()
   1.386 +/**
   1.387 +Gets a reference to the object represented by this packaged
   1.388 +modifiable pointer descriptor.
   1.389 +
   1.390 +@return The packaged object.
   1.391 +*/
   1.392 +	{return(*((T *)iPtr));}
   1.393 +
   1.394 +
   1.395 +
   1.396 +
   1.397 +
   1.398 +// TLIT16 is an internal port class
   1.399 +class TLIT16
   1.400 +	{
   1.401 +public:
   1.402 +	TLIT16(const char *aStr);
   1.403 +	TLIT16(const TLIT16 &);
   1.404 +	virtual ~TLIT16();
   1.405 +	const TDesC16* operator&() const;
   1.406 +	operator const TDesC16&() const;
   1.407 +	const TDesC16& operator()() const;
   1.408 +private:
   1.409 +	TLIT16 &operator=(const TLIT16 &);
   1.410 +	TPtrC16 iDes;
   1.411 +	};
   1.412 +
   1.413 +// TLIT8 is an internal port class
   1.414 +class TLIT8 : public TPtrC8
   1.415 +	{
   1.416 +public:
   1.417 +	TLIT8(const char *aStr);
   1.418 +	TLIT8(const TLIT8 &);
   1.419 +	};
   1.420 +
   1.421 +
   1.422 +
   1.423 +template <TInt S>
   1.424 +class TBuf : public TPtr16
   1.425 +	{
   1.426 +public:
   1.427 +	inline TBuf();
   1.428 +	inline explicit TBuf(TInt aLength);
   1.429 +	inline TBuf(const TDesC& aDes);
   1.430 +private:
   1.431 +	TText iBuf[__Align(S)];
   1.432 +	};
   1.433 +
   1.434 +template <TInt S>TBuf<S>::TBuf()
   1.435 +	: TPtr16(iBuf, 0, S)
   1.436 +{
   1.437 +}
   1.438 +
   1.439 +template <TInt S>TBuf<S>::TBuf(TInt aLength)
   1.440 +	: TPtr16(iBuf, aLength, S)
   1.441 +{
   1.442 +}
   1.443 +
   1.444 +template <TInt S>TBuf<S>::TBuf(const TDesC& aDes)
   1.445 +	: TPtr16(iBuf, aDes.Length(), S)
   1.446 +{
   1.447 +	if(aDes.Length() > S) FatalError();
   1.448 +	memcpy(iBuf, aDes.Ptr(), aDes.Length()*2); // *2 for 16 bit copy
   1.449 +}
   1.450 +
   1.451 +
   1.452 +template <TInt S>
   1.453 +class TBuf8 : public TPtr8
   1.454 +	{
   1.455 +public:
   1.456 +	inline TBuf8();
   1.457 +	inline explicit TBuf8(TInt aLength);
   1.458 +	inline TBuf8(const TDesC8& aDes);
   1.459 +private:
   1.460 +	TUint8 iBuf[__Align(S)];
   1.461 +	};
   1.462 +
   1.463 +template <TInt S>TBuf8<S>::TBuf8()
   1.464 +	: TPtr8(iBuf, 0, S)
   1.465 +{
   1.466 +}
   1.467 +
   1.468 +template <TInt S>TBuf8<S>::TBuf8(TInt aLength)
   1.469 +	: TPtr8(iBuf, aLength, S)
   1.470 +{
   1.471 +}
   1.472 +
   1.473 +template <TInt S>TBuf8<S>::TBuf8(const TDesC8& aDes)
   1.474 +	: TPtr8(iBuf, aDes.Length(), S)
   1.475 +{
   1.476 +	if(aDes.Length() > S) FatalError();
   1.477 +	memcpy(iBuf, aDes.Ptr(), aDes.Length());
   1.478 +}
   1.479 +
   1.480 +
   1.481 +typedef TBuf<KMaxName> TName;
   1.482 +
   1.483 +class TUid
   1.484 +	{
   1.485 +public:
   1.486 +	enum { KNullUidValue };
   1.487 +	
   1.488 +	static TUid Uid(TInt aUid)
   1.489 +		{TUid uid={aUid};return uid;}
   1.490 +
   1.491 +	static TUid Null()
   1.492 +		{TUid uid={KNullUidValue};return uid;}
   1.493 +
   1.494 +	TBool operator==(const TUid &aUid) const
   1.495 +		{
   1.496 +		return iUid == aUid.iUid;
   1.497 +		}
   1.498 +
   1.499 +	TBool operator!=(const TUid &aUid) const
   1.500 +		{
   1.501 +		return iUid != aUid.iUid;
   1.502 +		}
   1.503 +	
   1.504 +
   1.505 +	TInt32 iUid;
   1.506 +	};
   1.507 +
   1.508 +const TInt KMaxCheckedUid=3;
   1.509 +
   1.510 +
   1.511 +class TUidType
   1.512 +	{
   1.513 +public:
   1.514 +#ifndef __KERNEL_MODE__
   1.515 +	IMPORT_C TUidType();
   1.516 +	IMPORT_C TUidType(TUid aUid1);
   1.517 +	IMPORT_C TUidType(TUid aUid1,TUid aUid2);
   1.518 +	IMPORT_C TUidType(TUid aUid1,TUid aUid2,TUid aUid3);
   1.519 +	IMPORT_C TBool operator==(const TUidType& aUidType) const;
   1.520 +	IMPORT_C TBool operator!=(const TUidType& aUidType) const;
   1.521 +	IMPORT_C const TUid& operator[](TInt anIndex) const;
   1.522 +	IMPORT_C TUid MostDerived() const;
   1.523 +	IMPORT_C TBool IsPresent(TUid aUid) const;
   1.524 +	IMPORT_C TBool IsValid() const;
   1.525 +private:
   1.526 +#endif
   1.527 +	TUid iUid[KMaxCheckedUid];
   1.528 +	};
   1.529 +
   1.530 +class TCheckedUid
   1.531 +	{
   1.532 +public:
   1.533 +	IMPORT_C TCheckedUid();
   1.534 +	IMPORT_C TCheckedUid(const TUidType& aUidType);
   1.535 +	IMPORT_C TCheckedUid(const TDesC8& aPtr);
   1.536 +	IMPORT_C void Set(const TUidType& aUidType);
   1.537 +	IMPORT_C void Set(const TDesC8& aPtr);
   1.538 +	IMPORT_C TPtrC8 Des() const;
   1.539 +	const TUidType& UidType() const {return iType;};
   1.540 +protected:
   1.541 +	IMPORT_C TUint Check() const;
   1.542 +private:
   1.543 +	TUidType iType;
   1.544 +	TUint iCheck;
   1.545 +	};
   1.546 +
   1.547 +
   1.548 +
   1.549 +class RArrayBase
   1.550 +	{
   1.551 +public:
   1.552 +	virtual ~RArrayBase() {}
   1.553 +	virtual void Close() = 0;
   1.554 +	};
   1.555 +
   1.556 +template<typename T> class RArray : public RArrayBase
   1.557 +	{
   1.558 +public:
   1.559 +	RArray();
   1.560 +	explicit RArray(TInt);
   1.561 +	TInt Count() const;
   1.562 +	const T& operator[](TInt aIndex) const;
   1.563 +	T& operator[](TInt aIndex);
   1.564 +	void Remove(TInt aIndex);
   1.565 +	void AppendL(const T &aEntry);
   1.566 +	virtual void Close() {vec.clear();};
   1.567 +private:
   1.568 +	typedef std::vector<T> VectorT;
   1.569 +	VectorT vec;
   1.570 +	};
   1.571 +
   1.572 +class Mem
   1.573 +	{
   1.574 +public:
   1.575 +	static void FillZ(TAny *aTrg, TInt aLength);
   1.576 +	static void Crc(TUint16& aCrc,const TAny* aPtr,TInt aLength);
   1.577 +	static void Crc32(TUint32& aCrc, const TAny* aPtr, TInt aLength);
   1.578 +	static TUint8* Move(TAny *aTrg, const TAny *aSrc, TInt aLength);
   1.579 +	};
   1.580 +
   1.581 +void Panic(TInt aCode);
   1.582 +
   1.583 +
   1.584 +#define KNullUid TUid::Null()
   1.585 +
   1.586 +class RWriteStream;
   1.587 +class RReadStream;
   1.588 +class CFileStore;
   1.589 +class CConsoleBase;
   1.590 +class RFs;
   1.591 +class CleanupStack
   1.592 +	{
   1.593 +public:
   1.594 +	static void PopAndDestroy(RWriteStream *aStream);
   1.595 +	static void PopAndDestroy(RReadStream *aStream);
   1.596 +	static void PopAndDestroy(CFileStore *aStore);
   1.597 +	static void PopAndDestroy(RArrayBase *aRArray);
   1.598 +	static void PopAndDestroy(CConsoleBase *aCons);
   1.599 +	static void PopAndDestroy(RFs *aFs);
   1.600 +	static void PushL(void *)
   1.601 +		{
   1.602 +		}
   1.603 +	
   1.604 +	
   1.605 +	};
   1.606 +
   1.607 +
   1.608 +class User
   1.609 +	{
   1.610 +public:
   1.611 +	static void LeaveIfError(TInt aError);
   1.612 +	static void Leave(TInt aError); // Not supported!!!!
   1.613 +	static void Invariant();
   1.614 +	static void Panic(const TDesC &aCategory, TInt aReason);
   1.615 +	};
   1.616 +
   1.617 +
   1.618 +
   1.619 +template <typename T> RArray<T>::RArray()
   1.620 +	{
   1.621 +	}
   1.622 +
   1.623 +template<typename T> RArray<T>::RArray(TInt)
   1.624 +	{
   1.625 +	}
   1.626 +	
   1.627 +template<typename T> TInt RArray<T>::Count() const
   1.628 +	{
   1.629 +	return vec.size();
   1.630 +	}
   1.631 +
   1.632 +
   1.633 +template<typename T> const T& RArray<T>::operator[](TInt aIndex) const
   1.634 +	{
   1.635 +	return vec[aIndex];
   1.636 +	}
   1.637 +
   1.638 +template<typename T> T& RArray<T>::operator[](TInt aIndex)
   1.639 +	{
   1.640 +	return vec[aIndex];
   1.641 +	}
   1.642 +
   1.643 +
   1.644 +template<typename T> void RArray<T>::Remove(TInt aIndex)
   1.645 +	{
   1.646 +	typename std::vector<T>::itrator it = vec.begin();
   1.647 +	while(aIndex) ++it;
   1.648 +	vec.erase(it);
   1.649 +	}
   1.650 +
   1.651 +template<typename T> void RArray<T>::AppendL(const T &aEntry)
   1.652 +	{
   1.653 +	vec.push_back(aEntry);
   1.654 +	}
   1.655 +
   1.656 +#endif