sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
template <class T>
|
sl@0
|
20 |
inline void DoExternalizeL(const T& anObject,RWriteStream& aStream,Externalize::Member)
|
sl@0
|
21 |
{anObject.ExternalizeL(aStream);}
|
sl@0
|
22 |
template <class T>
|
sl@0
|
23 |
inline void DoInternalizeL(T& anObject,RReadStream& aStream,Internalize::Member)
|
sl@0
|
24 |
{anObject.InternalizeL(aStream);}
|
sl@0
|
25 |
|
sl@0
|
26 |
template <class T>
|
sl@0
|
27 |
inline void DoExternalizeL(const T& anObject,RWriteStream& aStream,Externalize::Function)
|
sl@0
|
28 |
{ExternalizeL(anObject,aStream);}
|
sl@0
|
29 |
template <class T>
|
sl@0
|
30 |
inline void DoInternalizeL(T& anObject,RReadStream& aStream,Internalize::Function)
|
sl@0
|
31 |
{InternalizeL(anObject,aStream);}
|
sl@0
|
32 |
|
sl@0
|
33 |
// Externalization and internalization selectors
|
sl@0
|
34 |
inline Externalize::Member Externalization(const TAny*)
|
sl@0
|
35 |
{return Externalize::Member();}
|
sl@0
|
36 |
inline Internalize::Member Internalization(TAny*)
|
sl@0
|
37 |
{return Internalize::Member();}
|
sl@0
|
38 |
|
sl@0
|
39 |
inline Externalize::Function Externalization(const TDesC8*)
|
sl@0
|
40 |
{return Externalize::Function();}
|
sl@0
|
41 |
inline Externalize::Function Externalization(const TDesC16*)
|
sl@0
|
42 |
{return Externalize::Function();}
|
sl@0
|
43 |
inline Internalize::Function Internalization(TDes8*)
|
sl@0
|
44 |
{return Internalize::Function();}
|
sl@0
|
45 |
inline Internalize::Function Internalization(TDes16*)
|
sl@0
|
46 |
{return Internalize::Function();}
|
sl@0
|
47 |
|
sl@0
|
48 |
#if 0
|
sl@0
|
49 |
inline Externalize::Function Externalization(const CBufBase*)
|
sl@0
|
50 |
{return Externalize::Function();}
|
sl@0
|
51 |
inline Externalize::Function Externalization(const CArrayFixBase*)
|
sl@0
|
52 |
{return Externalize::Function();}
|
sl@0
|
53 |
inline Internalize::Function Internalization(CBufBase*)
|
sl@0
|
54 |
{return Internalize::Function();}
|
sl@0
|
55 |
inline Internalize::Function Internalization(CArrayFixBase*)
|
sl@0
|
56 |
{return Internalize::Function();}
|
sl@0
|
57 |
#endif
|
sl@0
|
58 |
|
sl@0
|
59 |
template <class T>
|
sl@0
|
60 |
inline Externalize::Function Externalization(T*const*)
|
sl@0
|
61 |
{return Externalize::Function();}
|
sl@0
|
62 |
|
sl@0
|
63 |
// Externalization and internalization functions
|
sl@0
|
64 |
IMPORT_C void ExternalizeL(TInt64 anInt64,RWriteStream& aStream);
|
sl@0
|
65 |
IMPORT_C void InternalizeL(TInt64& anInt64,RReadStream& aStream);
|
sl@0
|
66 |
|
sl@0
|
67 |
IMPORT_C void ExternalizeL(const TDesC8& aDes8,RWriteStream& aStream);
|
sl@0
|
68 |
IMPORT_C void ExternalizeL(const TDesC16& aDes16,RWriteStream& aStream);
|
sl@0
|
69 |
IMPORT_C void InternalizeL(TDes8& aDes8,RReadStream& aStream);
|
sl@0
|
70 |
IMPORT_C void InternalizeL(TDes16& aDes16,RReadStream& aStream);
|
sl@0
|
71 |
|
sl@0
|
72 |
IMPORT_C void ExternalizeL(const TCheckedUid& aUid,RWriteStream& aStream);
|
sl@0
|
73 |
IMPORT_C void InternalizeL(TCheckedUid& aUid,RReadStream& aStream);
|
sl@0
|
74 |
|
sl@0
|
75 |
//IMPORT_C void ExternalizeL(TPoint aPoint,RWriteStream& aStream);
|
sl@0
|
76 |
IMPORT_C void ExternalizeL(TSize aSize,RWriteStream& aStream);
|
sl@0
|
77 |
//IMPORT_C void ExternalizeL(const TRect& aRect,RWriteStream& aStream);
|
sl@0
|
78 |
//IMPORT_C void InternalizeL(TPoint& aPoint,RReadStream& aStream);
|
sl@0
|
79 |
IMPORT_C void InternalizeL(TSize& aSize,RReadStream& aStream);
|
sl@0
|
80 |
//IMPORT_C void InternalizeL(TRect& aRect,RReadStream& aStream);
|
sl@0
|
81 |
|
sl@0
|
82 |
//IMPORT_C void ExternalizeL(const CBufBase& aBuf,RWriteStream& aStream);
|
sl@0
|
83 |
//IMPORT_C void InternalizeL(CBufBase& aBuf,RReadStream& aStream);
|
sl@0
|
84 |
|
sl@0
|
85 |
IMPORT_C void ArrayExternalizeCountL(TInt aCount,RWriteStream& aStream);
|
sl@0
|
86 |
//IMPORT_C void DoExternalizeAllL(const CArrayFixBase& anArray,RWriteStream& aStream,TExternalizer<TAny> anExter);
|
sl@0
|
87 |
IMPORT_C TInt ArrayInternalizeCountL(RReadStream& aStream);
|
sl@0
|
88 |
//IMPORT_C void DoInternalizeAllL(CArrayFixBase& anArray,RReadStream& aStream,TInternalizer<TAny> anInter);
|
sl@0
|
89 |
|
sl@0
|
90 |
// Input and output operators
|
sl@0
|
91 |
template <class T>
|
sl@0
|
92 |
inline RWriteStream& operator<<(RWriteStream& aStream,const T& anObject)
|
sl@0
|
93 |
{DoExternalizeL(anObject,aStream,Externalization(&anObject));return aStream;}
|
sl@0
|
94 |
template <class T>
|
sl@0
|
95 |
inline RReadStream& operator>>(RReadStream& aStream,T& anObject)
|
sl@0
|
96 |
{DoInternalizeL(anObject,aStream,Internalization(&anObject));return aStream;}
|
sl@0
|
97 |
|
sl@0
|
98 |
inline RWriteStream& operator<<(RWriteStream& aStream,const TInt8& anInt8)
|
sl@0
|
99 |
{aStream.WriteInt8L(anInt8);return aStream;}
|
sl@0
|
100 |
inline RWriteStream& operator<<(RWriteStream& aStream,const TInt16& anInt16)
|
sl@0
|
101 |
{aStream.WriteInt16L(anInt16);return aStream;}
|
sl@0
|
102 |
inline RWriteStream& operator<<(RWriteStream& aStream,const TInt32& anInt32)
|
sl@0
|
103 |
{aStream.WriteInt32L(anInt32);return aStream;}
|
sl@0
|
104 |
inline RWriteStream& operator<<(RWriteStream& aStream,const TUint8& aUint8)
|
sl@0
|
105 |
{aStream.WriteUint8L(aUint8);return aStream;}
|
sl@0
|
106 |
inline RWriteStream& operator<<(RWriteStream& aStream,const TUint16& aUint16)
|
sl@0
|
107 |
{aStream.WriteUint16L(aUint16);return aStream;}
|
sl@0
|
108 |
inline RWriteStream& operator<<(RWriteStream& aStream,const TUint32& aUint32)
|
sl@0
|
109 |
{aStream.WriteUint32L(aUint32);return aStream;}
|
sl@0
|
110 |
//inline RWriteStream& operator<<(RWriteStream& aStream,const TReal32& aReal32)
|
sl@0
|
111 |
// {aStream.WriteReal32L(aReal32);return aStream;}
|
sl@0
|
112 |
//inline RWriteStream& operator<<(RWriteStream& aStream,const TReal64& aReal64)
|
sl@0
|
113 |
// {aStream.WriteReal64L(aReal64);return aStream;}
|
sl@0
|
114 |
|
sl@0
|
115 |
inline RReadStream& operator>>(RReadStream& aStream,TInt8& anInt8)
|
sl@0
|
116 |
{anInt8=aStream.ReadInt8L();return aStream;}
|
sl@0
|
117 |
inline RReadStream& operator>>(RReadStream& aStream,TInt16& anInt16)
|
sl@0
|
118 |
{anInt16=aStream.ReadInt16L();return aStream;}
|
sl@0
|
119 |
inline RReadStream& operator>>(RReadStream& aStream,TInt32& anInt32)
|
sl@0
|
120 |
{anInt32=aStream.ReadInt32L();return aStream;}
|
sl@0
|
121 |
inline RReadStream& operator>>(RReadStream& aStream,TUint8& aUint8)
|
sl@0
|
122 |
{aUint8=aStream.ReadUint8L();return aStream;}
|
sl@0
|
123 |
inline RReadStream& operator>>(RReadStream& aStream,TUint16& aUint16)
|
sl@0
|
124 |
{aUint16=aStream.ReadUint16L();return aStream;}
|
sl@0
|
125 |
inline RReadStream& operator>>(RReadStream& aStream,TUint32& aUint32)
|
sl@0
|
126 |
{aUint32=aStream.ReadUint32L();return aStream;}
|
sl@0
|
127 |
//inline RReadStream& operator>>(RReadStream& aStream,TReal32& aReal32)
|
sl@0
|
128 |
// {aReal32=aStream.ReadReal32L();return aStream;}
|
sl@0
|
129 |
//inline RReadStream& operator>>(RReadStream& aStream,TReal64& aReal64)
|
sl@0
|
130 |
// {aReal64=aStream.ReadReal64L();return aStream;}
|
sl@0
|
131 |
|
sl@0
|
132 |
|
sl@0
|
133 |
//inline RWriteStream& operator<<(RWriteStream& aStream,const TInt64& anInt64)
|
sl@0
|
134 |
// {ExternalizeL(anInt64,aStream);return aStream;}
|
sl@0
|
135 |
//inline RReadStream& operator>>(RReadStream& aStream,TInt64& anInt64)
|
sl@0
|
136 |
// {InternalizeL(anInt64,aStream);return aStream;}
|
sl@0
|
137 |
|
sl@0
|
138 |
inline RWriteStream& operator<<(RWriteStream& aStream,const TUid& aUid)
|
sl@0
|
139 |
{return aStream<<aUid.iUid;}
|
sl@0
|
140 |
inline RWriteStream& operator<<(RWriteStream& aStream,const TCheckedUid& aUid)
|
sl@0
|
141 |
{ExternalizeL(aUid,aStream);return aStream;}
|
sl@0
|
142 |
inline RReadStream& operator>>(RReadStream& aStream,TUid& aUid)
|
sl@0
|
143 |
{return aStream>>aUid.iUid;}
|
sl@0
|
144 |
inline RReadStream& operator>>(RReadStream& aStream,TCheckedUid& aUid)
|
sl@0
|
145 |
{InternalizeL(aUid,aStream);return aStream;}
|
sl@0
|
146 |
|
sl@0
|
147 |
//inline RWriteStream& operator<<(RWriteStream& aStream,const TPoint& aPoint)
|
sl@0
|
148 |
// {ExternalizeL(aPoint,aStream);return aStream;}
|
sl@0
|
149 |
//inline RWriteStream& operator<<(RWriteStream& aStream,const TSize& aSize)
|
sl@0
|
150 |
// {ExternalizeL(aSize,aStream);return aStream;}
|
sl@0
|
151 |
//inline RWriteStream& operator<<(RWriteStream& aStream,const TRect& aRect)
|
sl@0
|
152 |
// {ExternalizeL(aRect,aStream);return aStream;}
|
sl@0
|
153 |
//inline RReadStream& operator>>(RReadStream& aStream,TPoint& aPoint)
|
sl@0
|
154 |
// {InternalizeL(aPoint,aStream);return aStream;}
|
sl@0
|
155 |
//inline RReadStream& operator>>(RReadStream& aStream,TSize& aSize)
|
sl@0
|
156 |
// {InternalizeL(aSize,aStream);return aStream;}
|
sl@0
|
157 |
//inline RReadStream& operator>>(RReadStream& aStream,TRect& aRect)
|
sl@0
|
158 |
// {InternalizeL(aRect,aStream);return aStream;}
|
sl@0
|
159 |
|
sl@0
|
160 |
//inline RWriteStream& operator<<(RWriteStream& aStream,const TStreamRef& aRef)
|
sl@0
|
161 |
// {aRef.ExternalizeL(aStream);return aStream;}
|
sl@0
|
162 |
|
sl@0
|
163 |
// Class TCardinality
|
sl@0
|
164 |
inline TCardinality::TCardinality(TInt aCount)
|
sl@0
|
165 |
:iCount(aCount)
|
sl@0
|
166 |
/** Constructs the object with the specified value.
|
sl@0
|
167 |
|
sl@0
|
168 |
@param aCount The value for this object. */
|
sl@0
|
169 |
{
|
sl@0
|
170 |
#if defined (_DEBUG)
|
sl@0
|
171 |
__DbgChkRange(aCount);
|
sl@0
|
172 |
#endif
|
sl@0
|
173 |
}
|
sl@0
|
174 |
inline TCardinality::operator TInt() const
|
sl@0
|
175 |
{
|
sl@0
|
176 |
#if defined (_DEBUG)
|
sl@0
|
177 |
__DbgChkRange(iCount);
|
sl@0
|
178 |
#endif
|
sl@0
|
179 |
return iCount;
|
sl@0
|
180 |
}
|
sl@0
|
181 |
// Class TDesInternalizer
|
sl@0
|
182 |
inline const TDesHeader& TDesInternalizer::Header() const
|
sl@0
|
183 |
{return iHeader;}
|
sl@0
|
184 |
inline TDesHeader& TDesInternalizer::Header()
|
sl@0
|
185 |
{return iHeader;}
|