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