Update contrib.
1 // Copyright (c) 1998-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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
18 GLDEF_C void Panic(TDbsPanic aPanic)
23 _LIT(KCategory,"DBMS-server");
24 Dbms::Panic(KCategory,aPanic);
29 EXPORT_C void Dbms::Panic(const TDesC& aCategory,TInt aCode)
32 // Outside of the server this calls User::Panic, within it calls the server and LEAVES!
37 CDbsServer* server=CDbsServer::Instance();
40 server->Panic(aCategory,aCode);
41 __LEAVE(KDbsLeavePanic);
44 User::Panic(aCategory,aCode);
47 // streaming functions
49 GLDEF_C void ExternalizeL(const TDbCol& aCol,RWriteStream& aStream)
51 aStream<<aCol.iName<<TUint8(aCol.iType)<<TInt32(aCol.iMaxLength)<<TUint8(aCol.iAttributes);
54 GLDEF_C void ExternalizeL(const CDbColSet& aColSet,RWriteStream& aStream)
56 TInt cc=aColSet.Count();
57 aStream.WriteInt32L(cc);
58 for (TInt ii=0;++ii<=cc;)
62 GLDEF_C void InternalizeL(CDbColSet& aColSet,RReadStream& aStream)
64 __ASSERT(aColSet.Count()==0);
66 TPtr name(col.iName.Des());
67 TInt cc=aStream.ReadInt32L();
71 col.iType=TDbColType(aStream.ReadUint8L());
72 col.iMaxLength=aStream.ReadInt32L();
73 col.iAttributes=aStream.ReadUint8L();
78 GLDEF_C void ExternalizeL(const CDbKey& aKey,RWriteStream& aStream)
81 aStream.WriteInt32L(cc);
82 for (TInt ii=0;ii<cc;++ii)
84 const TDbKeyCol& col=aKey[ii];
85 aStream<<col.iName<<TUint8(col.iOrder)<<TInt32(col.iLength);
87 aStream<<TUint8(aKey.Comparison())<<TUint8(aKey.IsUnique());
90 GLDEF_C void InternalizeL(CDbKey& aKey,RReadStream& aStream)
92 __ASSERT(aKey.Count()==0);
94 TPtr name(col.iName.Des());
95 TInt cc=aStream.ReadInt32L();
99 TUint8 uInt = aStream.ReadUint8L();
100 col.iOrder=TDbKeyCol::TOrder(uInt);
101 col.iLength=aStream.ReadInt32L();
104 aKey.SetComparison(TDbTextComparison(aStream.ReadUint8L()));
105 if (aStream.ReadUint8L())
109 GLDEF_C void ExternalizeL(const CDbNames& aNames,RWriteStream& aStream)
111 TInt cc=aNames.Count();
112 aStream.WriteInt32L(cc);
113 for (TInt ii=0;ii<cc;++ii)
117 GLDEF_C void InternalizeL(CDbNames& aNames,RReadStream& aStream)
119 __ASSERT(aNames.Count()==0);
121 TInt cc=aStream.ReadInt32L();
130 A helper function, used in
131 "RWriteStream& operator<<(RWriteStream& aStream,const CDbStrings& aStrings)".
134 GLDEF_C void ExternalizeL(const CDbStrings& aStrings,RWriteStream& aStream)
136 TInt cc=aStrings.Count();
137 aStream.WriteInt32L(cc);
138 for (TInt ii=0;ii<cc;++ii)
139 aStream<<aStrings[ii];
143 Represents a generic read/write DBMS string. It maps to a modifiable buffer descriptor
144 with maximum size KDbMaxStrLen.
149 typedef TBuf<KDbMaxStrLen> TDbString;
152 A helper function, used in
153 "RReadStream& operator>>(RReadStream& aStream,CDbStrings& aStrings)".
156 GLDEF_C void InternalizeL(CDbStrings& aStrings,RReadStream& aStream)
158 __ASSERT(aStrings.Count()==0);
160 TInt cc=aStream.ReadInt32L();