1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // 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
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
25 #if (!defined METABUFFER_H)
28 #include <comms-infras/metatypevariablelen.h>
33 class TMetaBuf8 : public TMetaVarLen8<RBuf8>
36 Implementation of MMetaType for dynamicaly allocated RBuf8
43 inline static MMetaType* NewL(const TAny* aMem, const TAny* aData);
45 IMPORT_C virtual TInt Load(TPtrC8& aBuffer);
46 IMPORT_C virtual TInt Store(TDes8& aBuffer) const;
47 IMPORT_C virtual void Copy(const TAny* aData);
48 IMPORT_C virtual TInt Length() const;
51 TMetaBuf8(const TAny* aData) :
52 TMetaVarLen8<RBuf8>( aData )
57 class TMetaBuf16 : public TMetaVarLen16<RBuf16>
60 Implementation of MMetaType for dynamicaly allocated RBuf16
67 inline static MMetaType* NewL(const TAny* aMem, const TAny* aData);
69 IMPORT_C virtual TInt Load(TPtrC8& aBuffer);
70 IMPORT_C virtual TInt Store(TDes8& aBuffer) const;
71 IMPORT_C virtual void Copy(const TAny* aData);
72 IMPORT_C virtual TInt Length() const;
75 TMetaBuf16(const TAny* aData) :
76 TMetaVarLen16<RBuf16>( aData )
82 MMetaType* TMetaBuf8::NewL(const TAny* aMem, const TAny* aData)
84 * Instantiates a meta type for RBuf8.
85 * Used for attribure registration (in the data v-table).
88 return ::new ((TUint8*)aMem) TMetaBuf8(aData);
91 MMetaType* TMetaBuf16::NewL(const TAny* aMem, const TAny* aData)
93 * Instantiates a meta type for RBuf8.
94 * Used for attribure registration (in the data v-table).
97 return ::new ((TUint8*)aMem) TMetaBuf16(aData);
101 #if defined(_UNICODE)
102 typedef TMetaBuf16 TMetaBuf;
104 typedef TMetaBuf8 TMetaBuf;
109 #endif //METABUFFER_H