sl@0
|
1 |
// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#if !defined(__D32DBAS_H__)
|
sl@0
|
17 |
#define __D32DBAS_H__
|
sl@0
|
18 |
#if !defined(__D32DBMS_H__)
|
sl@0
|
19 |
#include <d32dbms.h>
|
sl@0
|
20 |
#endif
|
sl@0
|
21 |
|
sl@0
|
22 |
// other classes referenced
|
sl@0
|
23 |
class RFs;
|
sl@0
|
24 |
class CDbContext;
|
sl@0
|
25 |
|
sl@0
|
26 |
// classes defined
|
sl@0
|
27 |
class TTextOps;
|
sl@0
|
28 |
class TDbBlob;
|
sl@0
|
29 |
class TDbCell;
|
sl@0
|
30 |
class TDbColumnC;
|
sl@0
|
31 |
class TDbColumn;
|
sl@0
|
32 |
class RDbRow;
|
sl@0
|
33 |
class CDbObject;
|
sl@0
|
34 |
class CDbRowConstraint;
|
sl@0
|
35 |
class CDbCursor;
|
sl@0
|
36 |
class CDbNotifier;
|
sl@0
|
37 |
class CDbIncremental;
|
sl@0
|
38 |
class CDbSyncIncremental;
|
sl@0
|
39 |
class CDbAsyncIncremental;
|
sl@0
|
40 |
class CDbDatabase;
|
sl@0
|
41 |
class CDbSource;
|
sl@0
|
42 |
class TDbDriver;
|
sl@0
|
43 |
class TDbFormat;
|
sl@0
|
44 |
|
sl@0
|
45 |
/**
|
sl@0
|
46 |
@internalComponent
|
sl@0
|
47 |
*/
|
sl@0
|
48 |
const TInt KDbMaxFormatName=32;
|
sl@0
|
49 |
const TInt KDbMaxDatabaseName=KMaxFileName;
|
sl@0
|
50 |
|
sl@0
|
51 |
/**
|
sl@0
|
52 |
@internalComponent
|
sl@0
|
53 |
*/
|
sl@0
|
54 |
const TInt KDbMaxInlineBlobSize=255;
|
sl@0
|
55 |
|
sl@0
|
56 |
/**
|
sl@0
|
57 |
@internalComponent
|
sl@0
|
58 |
*/
|
sl@0
|
59 |
typedef TUint32 TDbBlobId;
|
sl@0
|
60 |
|
sl@0
|
61 |
/**
|
sl@0
|
62 |
@internalComponent
|
sl@0
|
63 |
*/
|
sl@0
|
64 |
const TDbBlobId KDbNullBlobId=0;
|
sl@0
|
65 |
|
sl@0
|
66 |
/**
|
sl@0
|
67 |
@internalComponent
|
sl@0
|
68 |
*/
|
sl@0
|
69 |
class Dbms
|
sl@0
|
70 |
{
|
sl@0
|
71 |
public:
|
sl@0
|
72 |
IMPORT_C static void Panic(const TDesC& aCategory,TInt aCode);
|
sl@0
|
73 |
};
|
sl@0
|
74 |
|
sl@0
|
75 |
/**
|
sl@0
|
76 |
@internalComponent
|
sl@0
|
77 |
*/
|
sl@0
|
78 |
class TTextOps
|
sl@0
|
79 |
{
|
sl@0
|
80 |
public:
|
sl@0
|
81 |
IMPORT_C static const TTextOps& Ops(TDbTextComparison aType=EDbCompareNormal);
|
sl@0
|
82 |
//
|
sl@0
|
83 |
inline TUint Fold(TUint aChar) const;
|
sl@0
|
84 |
IMPORT_C TInt Compare(const TDesC8& aLeft,const TDesC8& aRight) const;
|
sl@0
|
85 |
IMPORT_C TInt Compare(const TDesC16& aLeft,const TDesC16& aRight) const;
|
sl@0
|
86 |
inline TInt Compare(const TText8* aLeftPtr,TInt aLeftLen,const TText8* aRightPtr,TInt aRightLen) const;
|
sl@0
|
87 |
inline TInt Compare(const TText16* aLeftPtr,TInt aLeftLen,const TText16* aRightPtr,TInt aRightLen) const;
|
sl@0
|
88 |
inline TInt Match(const TDesC8& aDes,const TDesC8& aPattern) const;
|
sl@0
|
89 |
inline TInt Match(const TDesC16& aDes,const TDesC16& aPattern) const;
|
sl@0
|
90 |
IMPORT_C TInt Match(const TText8* aPtr,TInt aLen,const TText8* aPatternPtr,TInt aPatternLen) const;
|
sl@0
|
91 |
IMPORT_C TInt Match(const TText16* aPtr,TInt aLen,const TText16* aPatternPtr,TInt aPatternLen) const;
|
sl@0
|
92 |
IMPORT_C TInt Find(const TDesC8& aDes,const TDesC8& aSub) const;
|
sl@0
|
93 |
IMPORT_C TInt Find(const TDesC16& aDes,const TDesC16& aSub) const;
|
sl@0
|
94 |
IMPORT_C TInt Find(const TText8* aPtr,TInt aLen,const TText8* aSubPtr,TInt aSubLen) const;
|
sl@0
|
95 |
IMPORT_C TInt Find(const TText16* aPtr,TInt aLen,const TText16* aSubPtr,TInt aSubLen) const;
|
sl@0
|
96 |
TInt Order(const TDesC16& aLeft, const TDesC16& aRight) const;
|
sl@0
|
97 |
inline TInt Order(const TText16* aLeftPtr, TInt aLeftLen, const TText16* aRightPtr, TInt aRightLen) const;
|
sl@0
|
98 |
public:
|
sl@0
|
99 |
TUint (*iFold)(TUint aChar);
|
sl@0
|
100 |
TInt (*iCompare8)(const TText8*,TInt,const TText8*,TInt);
|
sl@0
|
101 |
TInt (*iMatch8)(const TDesC8&,const TDesC8&);
|
sl@0
|
102 |
TInt (*iFind8)(const TDesC8&,const TText8*,TInt);
|
sl@0
|
103 |
TInt (*iCompare16)(const TText16*,TInt,const TText16*,TInt);
|
sl@0
|
104 |
TInt (*iMatch16)(const TDesC16&,const TDesC16&);
|
sl@0
|
105 |
TInt (*iFind16)(const TDesC16&,const TText16*,TInt);
|
sl@0
|
106 |
TInt (*iOrder16)(const TText16*, TInt, const TText16*, TInt);
|
sl@0
|
107 |
};
|
sl@0
|
108 |
|
sl@0
|
109 |
/**
|
sl@0
|
110 |
@internalComponent
|
sl@0
|
111 |
*/
|
sl@0
|
112 |
class TDbBlob
|
sl@0
|
113 |
{
|
sl@0
|
114 |
public:
|
sl@0
|
115 |
inline TDbBlob();
|
sl@0
|
116 |
inline TDbBlob(TDbBlobId anId,TInt aSize=KDbUndefinedLength);
|
sl@0
|
117 |
inline TDbBlob(const TUint8* aPtr,TInt aSize);
|
sl@0
|
118 |
inline TUint8* InlineBuffer();
|
sl@0
|
119 |
inline void SetId(TDbBlobId anId);
|
sl@0
|
120 |
inline void SetSize(TInt aSize);
|
sl@0
|
121 |
//
|
sl@0
|
122 |
inline TBool IsInline() const;
|
sl@0
|
123 |
inline TInt Size() const;
|
sl@0
|
124 |
inline const TUint8* Data() const;
|
sl@0
|
125 |
inline TPtrC8 PtrC8() const;
|
sl@0
|
126 |
inline TPtrC16 PtrC16() const;
|
sl@0
|
127 |
inline TDbBlobId Id() const;
|
sl@0
|
128 |
//
|
sl@0
|
129 |
inline TInt CellSize() const;
|
sl@0
|
130 |
static inline TInt InlineSize(TInt aSize);
|
sl@0
|
131 |
static inline TInt RefSize();
|
sl@0
|
132 |
private:
|
sl@0
|
133 |
TDbBlobId iId;
|
sl@0
|
134 |
TInt iSize;
|
sl@0
|
135 |
TUint8 iInline[KDbMaxInlineBlobSize];
|
sl@0
|
136 |
};
|
sl@0
|
137 |
|
sl@0
|
138 |
/**
|
sl@0
|
139 |
@internalComponent
|
sl@0
|
140 |
*/
|
sl@0
|
141 |
class TDbCell
|
sl@0
|
142 |
{
|
sl@0
|
143 |
public:
|
sl@0
|
144 |
static inline TInt Size(TInt aLength);
|
sl@0
|
145 |
inline TInt Size() const; // total cell size
|
sl@0
|
146 |
inline TDbCell* Next(); // pointer to next cell
|
sl@0
|
147 |
inline const TDbCell* Next() const; // pointer to next cell
|
sl@0
|
148 |
inline TInt Length() const; // data size
|
sl@0
|
149 |
inline void SetLength(TInt aLength);
|
sl@0
|
150 |
inline TAny* Data(); // data pointer
|
sl@0
|
151 |
inline const TAny* Data() const; // data pointer
|
sl@0
|
152 |
private:
|
sl@0
|
153 |
TInt iLength;
|
sl@0
|
154 |
TUint8 iBuf[1];
|
sl@0
|
155 |
};
|
sl@0
|
156 |
|
sl@0
|
157 |
/**
|
sl@0
|
158 |
@internalComponent
|
sl@0
|
159 |
*/
|
sl@0
|
160 |
class TDbColumnC
|
sl@0
|
161 |
{
|
sl@0
|
162 |
friend class TDbColumn;
|
sl@0
|
163 |
public:
|
sl@0
|
164 |
inline TDbColumnC(const RDbRow& aRow,TDbColNo aCol);
|
sl@0
|
165 |
inline TDbColumnC(const TDbColumn& aCol);
|
sl@0
|
166 |
inline TInt Size() const;
|
sl@0
|
167 |
inline TBool IsNull() const;
|
sl@0
|
168 |
inline TInt8 Int8() const;
|
sl@0
|
169 |
inline TInt16 Int16() const;
|
sl@0
|
170 |
inline TInt32 Int32() const;
|
sl@0
|
171 |
inline const TInt64& Int64() const;
|
sl@0
|
172 |
inline TUint8 Uint8() const;
|
sl@0
|
173 |
inline TUint16 Uint16() const;
|
sl@0
|
174 |
inline TUint32 Uint32() const;
|
sl@0
|
175 |
inline TReal32 Real32() const;
|
sl@0
|
176 |
inline const TReal64& Real64() const;
|
sl@0
|
177 |
inline TPtrC8 PtrC8() const;
|
sl@0
|
178 |
inline TPtrC16 PtrC16() const;
|
sl@0
|
179 |
inline const TTime& Time() const;
|
sl@0
|
180 |
inline const TDbBlob& Blob() const;
|
sl@0
|
181 |
private:
|
sl@0
|
182 |
const TDbCell* iCell;
|
sl@0
|
183 |
};
|
sl@0
|
184 |
|
sl@0
|
185 |
/**
|
sl@0
|
186 |
@internalComponent
|
sl@0
|
187 |
*/
|
sl@0
|
188 |
class TDbColumn
|
sl@0
|
189 |
{
|
sl@0
|
190 |
friend class TDbColumnC;
|
sl@0
|
191 |
public:
|
sl@0
|
192 |
inline TDbColumn();
|
sl@0
|
193 |
inline TDbColumn(RDbRow& aRow,TDbColNo aCol);
|
sl@0
|
194 |
inline void SetNull();
|
sl@0
|
195 |
inline void SetL(TInt32 aValue);
|
sl@0
|
196 |
IMPORT_C void SetL(TUint32 aValue);
|
sl@0
|
197 |
IMPORT_C void SetL(TInt64 aValue);
|
sl@0
|
198 |
IMPORT_C void SetL(TReal32 aValue) __SOFTFP;
|
sl@0
|
199 |
IMPORT_C void SetL(TReal64 aValue) __SOFTFP;
|
sl@0
|
200 |
IMPORT_C void SetL(const TDesC8& aValue);
|
sl@0
|
201 |
IMPORT_C void SetL(const TDesC16& aValue);
|
sl@0
|
202 |
inline void SetL(const TTime& aValue);
|
sl@0
|
203 |
IMPORT_C void SetBlobL(TDbBlobId aBlobId,TInt aSize=KDbUndefinedLength);
|
sl@0
|
204 |
IMPORT_C void SetBlobL(const TUint8* aData,TInt aSize);
|
sl@0
|
205 |
//
|
sl@0
|
206 |
IMPORT_C TDbBlob& InitBlobL();
|
sl@0
|
207 |
IMPORT_C void CommitBlob(const TDbBlob& aBlob);
|
sl@0
|
208 |
//
|
sl@0
|
209 |
inline void SetL(const TDbCell* aCell);
|
sl@0
|
210 |
inline void SetL(const TDbColumnC& aColumn);
|
sl@0
|
211 |
private:
|
sl@0
|
212 |
inline RDbRow& Row() const;
|
sl@0
|
213 |
IMPORT_C void SetL(const TAny* aPtr,TInt aSize);
|
sl@0
|
214 |
private:
|
sl@0
|
215 |
RDbRow* iRow;
|
sl@0
|
216 |
TDbColNo iColumn;
|
sl@0
|
217 |
};
|
sl@0
|
218 |
|
sl@0
|
219 |
/**
|
sl@0
|
220 |
@internalComponent
|
sl@0
|
221 |
*/
|
sl@0
|
222 |
class RDbRow
|
sl@0
|
223 |
{
|
sl@0
|
224 |
friend class TDbColumn;
|
sl@0
|
225 |
public:
|
sl@0
|
226 |
IMPORT_C RDbRow();
|
sl@0
|
227 |
inline RDbRow(TAny* aBuf,TInt aMaxSize);
|
sl@0
|
228 |
inline RDbRow(TAny* aBuf,TInt aSize,TInt aMaxSize);
|
sl@0
|
229 |
inline void Open(TAny* aBuf,TInt aMaxSize);
|
sl@0
|
230 |
IMPORT_C void Open(TAny* aBuf,TInt aSize,TInt aMaxSize);
|
sl@0
|
231 |
IMPORT_C void CreateL(TInt aMaxSize);
|
sl@0
|
232 |
void PushL();
|
sl@0
|
233 |
IMPORT_C void Close();
|
sl@0
|
234 |
inline void Reset();
|
sl@0
|
235 |
//
|
sl@0
|
236 |
inline TDbCell* First();
|
sl@0
|
237 |
inline const TDbCell* First() const;
|
sl@0
|
238 |
inline const TDbCell* Last() const;
|
sl@0
|
239 |
inline const TDbCell* End() const;
|
sl@0
|
240 |
IMPORT_C void SetSize(TInt aSize);
|
sl@0
|
241 |
inline TInt Size() const;
|
sl@0
|
242 |
inline TInt MaxSize() const;
|
sl@0
|
243 |
IMPORT_C void GrowL(TInt aMaxSize);
|
sl@0
|
244 |
// for use by data sources
|
sl@0
|
245 |
static inline TInt Diff(const TDbCell* aBegin,const TDbCell* aEnd);
|
sl@0
|
246 |
IMPORT_C const TDbCell* ColCell(TDbColNo aCol) const;
|
sl@0
|
247 |
private:
|
sl@0
|
248 |
IMPORT_C TAny* SetColumnWidthL(TDbColNo aCol,TInt aWidth);
|
sl@0
|
249 |
TDbCell* Column(TDbColNo aCol) const;
|
sl@0
|
250 |
TInt ReallocL(TInt aMaxSize);
|
sl@0
|
251 |
void ExtendL(TInt aAdjust); // change the row buffer length
|
sl@0
|
252 |
//
|
sl@0
|
253 |
inline TBool Owned() const;
|
sl@0
|
254 |
inline TInt Column() const;
|
sl@0
|
255 |
inline void SetCache(TDbCell* aCell,TInt aColumn);
|
sl@0
|
256 |
private:
|
sl@0
|
257 |
enum {EOwned=0x80000000};
|
sl@0
|
258 |
enum {EGranularity=0x100};
|
sl@0
|
259 |
private:
|
sl@0
|
260 |
TDbCell* iFirst; // first column
|
sl@0
|
261 |
TDbCell* iLast; // pointer past last cell
|
sl@0
|
262 |
TDbCell* iEnd; // pointer past end of available buffer
|
sl@0
|
263 |
TDbCell* iCell; // cached cell pointer
|
sl@0
|
264 |
TUint iColumn; // cached column number/ownership flag
|
sl@0
|
265 |
};
|
sl@0
|
266 |
|
sl@0
|
267 |
|
sl@0
|
268 |
/**
|
sl@0
|
269 |
@internalComponent
|
sl@0
|
270 |
*/
|
sl@0
|
271 |
class CDbObject : public CBase
|
sl@0
|
272 |
{
|
sl@0
|
273 |
friend class CDbContext;
|
sl@0
|
274 |
public:
|
sl@0
|
275 |
static void Destroy(CDbObject* aObject); // context-safe deletion
|
sl@0
|
276 |
CDbObject* Attach(CDbObject* aObject);
|
sl@0
|
277 |
inline const CDbContext* Context() const;
|
sl@0
|
278 |
//
|
sl@0
|
279 |
void PushL();
|
sl@0
|
280 |
protected:
|
sl@0
|
281 |
inline CDbObject() {}
|
sl@0
|
282 |
private:
|
sl@0
|
283 |
CDbContext* iContext;
|
sl@0
|
284 |
};
|
sl@0
|
285 |
|
sl@0
|
286 |
/**
|
sl@0
|
287 |
@internalComponent
|
sl@0
|
288 |
*/
|
sl@0
|
289 |
class CDbRowConstraint : public CDbObject
|
sl@0
|
290 |
{
|
sl@0
|
291 |
protected:
|
sl@0
|
292 |
CDbRowConstraint() {}
|
sl@0
|
293 |
};
|
sl@0
|
294 |
|
sl@0
|
295 |
/**
|
sl@0
|
296 |
@internalComponent
|
sl@0
|
297 |
*/
|
sl@0
|
298 |
class CDbCursor : public CDbObject
|
sl@0
|
299 |
{
|
sl@0
|
300 |
public:
|
sl@0
|
301 |
enum TInsert {EClear,ECopy};
|
sl@0
|
302 |
protected:
|
sl@0
|
303 |
CDbCursor() {}
|
sl@0
|
304 |
public:
|
sl@0
|
305 |
// Pure virtual
|
sl@0
|
306 |
virtual void Reset() =0;
|
sl@0
|
307 |
virtual TBool EvaluateL()=0;
|
sl@0
|
308 |
TInt Evaluate();
|
sl@0
|
309 |
// virtual void Evaluate(TRequestStatus& aStatus)=0;
|
sl@0
|
310 |
virtual TBool Unevaluated()=0;
|
sl@0
|
311 |
//
|
sl@0
|
312 |
virtual void SetIndexL(const TDesC* anIndex)=0;
|
sl@0
|
313 |
virtual TBool SeekL(const TDbLookupKey& aKey,RDbTable::TComparison aComparison) =0;
|
sl@0
|
314 |
CDbRowConstraint* ConstraintL(const TDbQuery& aCriteria);
|
sl@0
|
315 |
virtual TBool MatchL(CDbRowConstraint& aConstraint) =0;
|
sl@0
|
316 |
IMPORT_C virtual TInt FindL(RDbRowSet::TDirection aDirection,const TDbQuery& aCriteria);
|
sl@0
|
317 |
//
|
sl@0
|
318 |
virtual TBool AtBeginning()=0;
|
sl@0
|
319 |
virtual TBool AtEnd()=0;
|
sl@0
|
320 |
virtual TBool AtRow()=0;
|
sl@0
|
321 |
IMPORT_C virtual TInt CountL(RDbRowSet::TAccuracy aAccuracy);
|
sl@0
|
322 |
virtual TBool GotoL(RDbRowSet::TPosition aPosition)=0;
|
sl@0
|
323 |
virtual void Bookmark(TDbBookmark::TMark& aMark) =0;
|
sl@0
|
324 |
virtual void GotoL(const TDbBookmark::TMark& aMark) =0;
|
sl@0
|
325 |
virtual void GetL()=0;
|
sl@0
|
326 |
virtual void InsertL(TInsert aClearRow)=0;
|
sl@0
|
327 |
virtual void UpdateL()=0;
|
sl@0
|
328 |
virtual void Cancel()=0;
|
sl@0
|
329 |
virtual void PutL()=0;
|
sl@0
|
330 |
virtual void DeleteL()=0;
|
sl@0
|
331 |
// column validation
|
sl@0
|
332 |
virtual TInt ColumnCount()=0;
|
sl@0
|
333 |
IMPORT_C virtual void ColumnsL(CDbColSet& aColSet);
|
sl@0
|
334 |
virtual void ColumnDef(TDbCol& aCol,TDbColNo aColNo)=0;
|
sl@0
|
335 |
virtual TDbColType ColumnType(TDbColNo aCol)=0;
|
sl@0
|
336 |
// Column Accessors
|
sl@0
|
337 |
virtual TDbColumnC ColumnC(TDbColNo aCol)=0; // non-writeable column
|
sl@0
|
338 |
virtual TDbColumn Column(TDbColNo aCol)=0; // writeable column
|
sl@0
|
339 |
virtual void SetNullL(TDbColNo aCol)=0;
|
sl@0
|
340 |
virtual TInt ColumnSize(TDbColNo aCol)=0;
|
sl@0
|
341 |
// Optimized whole row access for server
|
sl@0
|
342 |
virtual RDbRow* RowBuffer() =0;
|
sl@0
|
343 |
// Blob functions
|
sl@0
|
344 |
virtual MStreamBuf* ColumnSourceL(TDbColNo aCol)=0;
|
sl@0
|
345 |
virtual MStreamBuf* ColumnSinkL(TDbColNo aCol)=0;
|
sl@0
|
346 |
private:
|
sl@0
|
347 |
virtual CDbRowConstraint* OpenConstraintL(const TDbQuery& aCriteria) =0;
|
sl@0
|
348 |
// Reserved virtuals
|
sl@0
|
349 |
IMPORT_C virtual void Reserved_1();
|
sl@0
|
350 |
IMPORT_C virtual void Reserved_2();
|
sl@0
|
351 |
};
|
sl@0
|
352 |
|
sl@0
|
353 |
/**
|
sl@0
|
354 |
@internalComponent
|
sl@0
|
355 |
*/
|
sl@0
|
356 |
class CDbIncremental : public CDbObject
|
sl@0
|
357 |
{
|
sl@0
|
358 |
protected:
|
sl@0
|
359 |
CDbIncremental() {}
|
sl@0
|
360 |
public:
|
sl@0
|
361 |
virtual TBool NextL(TInt& aStep) =0;
|
sl@0
|
362 |
// virtual void Next(TPckgBuf<TInt>& aStep,TRequestStatus& aStatus) =0;
|
sl@0
|
363 |
};
|
sl@0
|
364 |
|
sl@0
|
365 |
/**
|
sl@0
|
366 |
@internalComponent
|
sl@0
|
367 |
*/
|
sl@0
|
368 |
class CDbSyncIncremental : public CDbIncremental
|
sl@0
|
369 |
{
|
sl@0
|
370 |
protected:
|
sl@0
|
371 |
CDbSyncIncremental() {}
|
sl@0
|
372 |
private:
|
sl@0
|
373 |
// IMPORT_C void Next(TPckgBuf<TInt>& aStep,TRequestStatus& aStatus);
|
sl@0
|
374 |
};
|
sl@0
|
375 |
|
sl@0
|
376 |
/**
|
sl@0
|
377 |
@internalComponent
|
sl@0
|
378 |
*/
|
sl@0
|
379 |
class CDbAsyncIncremental : public CDbIncremental
|
sl@0
|
380 |
{
|
sl@0
|
381 |
protected:
|
sl@0
|
382 |
CDbAsyncIncremental() {}
|
sl@0
|
383 |
private:
|
sl@0
|
384 |
IMPORT_C TBool NextL(TInt& aStep);
|
sl@0
|
385 |
};
|
sl@0
|
386 |
|
sl@0
|
387 |
/**
|
sl@0
|
388 |
@internalComponent
|
sl@0
|
389 |
*/
|
sl@0
|
390 |
class CDbDatabase : public CDbObject
|
sl@0
|
391 |
{
|
sl@0
|
392 |
protected:
|
sl@0
|
393 |
CDbDatabase() {}
|
sl@0
|
394 |
public:
|
sl@0
|
395 |
enum TUtility {EStats=1,ECompact,ERecover};
|
sl@0
|
396 |
enum TProperty {EUpdateStats=-EStats,ECompactable=-ECompact,EIsDamaged=-ERecover,
|
sl@0
|
397 |
EInTransaction=0,ESize,EUsage};
|
sl@0
|
398 |
public:
|
sl@0
|
399 |
// Pure virtual
|
sl@0
|
400 |
virtual TInt Destroy()=0;
|
sl@0
|
401 |
virtual TInt Begin()=0;
|
sl@0
|
402 |
virtual TInt Commit()=0;
|
sl@0
|
403 |
virtual void Rollback()=0;
|
sl@0
|
404 |
virtual TInt Property(TProperty aProperty) =0;
|
sl@0
|
405 |
virtual void CreateTableL(const TDesC& aName,const CDbColSet& aColSet,const CDbKey* aPrimaryKey)=0;
|
sl@0
|
406 |
CDbNotifier* NotifierL();
|
sl@0
|
407 |
CDbIncremental* UtilityL(TUtility aType,TInt& aStep);
|
sl@0
|
408 |
CDbIncremental* DropTableL(const TDesC& aTable,TInt& aStep);
|
sl@0
|
409 |
CDbIncremental* AlterTableL(const TDesC& aTable,const CDbColSet& aNewDef,TInt& aStep);
|
sl@0
|
410 |
CDbIncremental* CreateIndexL(const TDesC& aName,const TDesC& aTable,const CDbKey& aKey,TInt& aStep);
|
sl@0
|
411 |
CDbIncremental* DropIndexL(const TDesC& aName,const TDesC& aTable,TInt& aStep);
|
sl@0
|
412 |
CDbIncremental* ExecuteL(const TDesC& aSql,TDbTextComparison aComparison,TInt& aInit);
|
sl@0
|
413 |
CDbCursor* ViewL(const TDbQuery& aQuery,const TDbWindow& aWindow,RDbRowSet::TAccess anAccess);
|
sl@0
|
414 |
CDbCursor* TableL(const TDesC& aName,RDbRowSet::TAccess anAccess);
|
sl@0
|
415 |
virtual void TablesL(CDbTableNames& aNames)=0;
|
sl@0
|
416 |
virtual void ColumnsL(CDbColSet& aColSet,const TDesC& aName)=0;
|
sl@0
|
417 |
virtual void IndexesL(CDbIndexNames& aNames,const TDesC& aTable)=0;
|
sl@0
|
418 |
virtual void KeysL(CDbKey& aKey,const TDesC& aName,const TDesC& aTable)=0;
|
sl@0
|
419 |
private:
|
sl@0
|
420 |
virtual CDbNotifier* OpenNotifierL() =0;
|
sl@0
|
421 |
virtual CDbIncremental* OpenUtilityL(TUtility aType,TInt& aStep) =0;
|
sl@0
|
422 |
virtual CDbIncremental* OpenDropTableL(const TDesC& aTable,TInt& aStep) =0;
|
sl@0
|
423 |
virtual CDbIncremental* OpenAlterTableL(const TDesC& aTable,const CDbColSet& aNewDef,TInt& aStep) =0;
|
sl@0
|
424 |
virtual CDbIncremental* OpenCreateIndexL(const TDesC& aName,const TDesC& aTable,const CDbKey& aKey,TInt& aStep) =0;
|
sl@0
|
425 |
virtual CDbIncremental* OpenDropIndexL(const TDesC& aName,const TDesC& aTable,TInt& aStep) =0;
|
sl@0
|
426 |
virtual CDbCursor* PrepareViewL(const TDbQuery& aQuery,const TDbWindow& aWindow,RDbRowSet::TAccess anAccess) =0;
|
sl@0
|
427 |
virtual CDbCursor* OpenTableL(const TDesC& aName,RDbRowSet::TAccess anAccess) =0;
|
sl@0
|
428 |
virtual CDbIncremental* OpenExecuteL(const TDesC& aSql,TDbTextComparison aComparison,TInt& aInit) =0;
|
sl@0
|
429 |
// Reserved virtuals
|
sl@0
|
430 |
IMPORT_C virtual void Reserved_1();
|
sl@0
|
431 |
IMPORT_C virtual void Reserved_2();
|
sl@0
|
432 |
};
|
sl@0
|
433 |
|
sl@0
|
434 |
/**
|
sl@0
|
435 |
@internalComponent
|
sl@0
|
436 |
*/
|
sl@0
|
437 |
class CDbNotifier : public CDbObject
|
sl@0
|
438 |
{
|
sl@0
|
439 |
public:
|
sl@0
|
440 |
enum TType {EUnlock=-1,EChange=-2};
|
sl@0
|
441 |
protected:
|
sl@0
|
442 |
CDbNotifier() {}
|
sl@0
|
443 |
public:
|
sl@0
|
444 |
// pure virtual
|
sl@0
|
445 |
// virtual void Notify(TType aEvent,TRequestStatus& aStatus) =0;
|
sl@0
|
446 |
virtual void Cancel() =0;
|
sl@0
|
447 |
};
|
sl@0
|
448 |
|
sl@0
|
449 |
|
sl@0
|
450 |
/**
|
sl@0
|
451 |
CDbSource class declaration - SYMBIAN_REMOVE_TRIVIAL_ENCRYPTION version
|
sl@0
|
452 |
@internalComponent
|
sl@0
|
453 |
*/
|
sl@0
|
454 |
class CDbSource : public CDbObject
|
sl@0
|
455 |
{
|
sl@0
|
456 |
protected:
|
sl@0
|
457 |
CDbSource()
|
sl@0
|
458 |
{
|
sl@0
|
459 |
}
|
sl@0
|
460 |
public:
|
sl@0
|
461 |
CDbDatabase* OpenL();
|
sl@0
|
462 |
virtual CDbDatabase* AuthenticateL() = 0;
|
sl@0
|
463 |
CDbNotifier* NotifierL();
|
sl@0
|
464 |
private:
|
sl@0
|
465 |
virtual CDbNotifier* OpenNotifierL() =0;
|
sl@0
|
466 |
};
|
sl@0
|
467 |
|
sl@0
|
468 |
|
sl@0
|
469 |
/**
|
sl@0
|
470 |
@internalComponent
|
sl@0
|
471 |
*/
|
sl@0
|
472 |
class TDbDriver
|
sl@0
|
473 |
{
|
sl@0
|
474 |
public:
|
sl@0
|
475 |
TInt iCount;
|
sl@0
|
476 |
const TDbFormat* iFormats;
|
sl@0
|
477 |
};
|
sl@0
|
478 |
|
sl@0
|
479 |
/**
|
sl@0
|
480 |
@internalComponent
|
sl@0
|
481 |
*/
|
sl@0
|
482 |
class TDbFormat
|
sl@0
|
483 |
{
|
sl@0
|
484 |
public:
|
sl@0
|
485 |
enum TCreate {ECreate,EReplace};
|
sl@0
|
486 |
enum TOpen {EReadWrite,EReadOnly};
|
sl@0
|
487 |
typedef CDbDatabase* (*FCreateL)(RFs& aFs, const TDesC& aName, TCreate aMode,
|
sl@0
|
488 |
const TUidType& aType);
|
sl@0
|
489 |
typedef CDbSource* (*FOpenL)(RFs& aFs,const TDesC& aName,TOpen aMode);
|
sl@0
|
490 |
public:
|
sl@0
|
491 |
const TText* iName;
|
sl@0
|
492 |
FCreateL CreateL;
|
sl@0
|
493 |
FOpenL OpenL;
|
sl@0
|
494 |
TInt32 iUid[KMaxCheckedUid];
|
sl@0
|
495 |
};
|
sl@0
|
496 |
|
sl@0
|
497 |
/**
|
sl@0
|
498 |
@internalComponent
|
sl@0
|
499 |
*/
|
sl@0
|
500 |
#define KDbmsDriverUidValue KDbmsDriverUidValue16
|
sl@0
|
501 |
#define KDbmsDriverUid KDbmsDriverUid16
|
sl@0
|
502 |
|
sl@0
|
503 |
/**
|
sl@0
|
504 |
@internalComponent
|
sl@0
|
505 |
*/
|
sl@0
|
506 |
const TInt32 KDbmsDriverUidValue8=0x10000EBC;
|
sl@0
|
507 |
const TUid KDbmsDriverUid8={KDbmsDriverUidValue8};
|
sl@0
|
508 |
const TInt32 KDbmsDriverUidValue16=0x10003B0F;
|
sl@0
|
509 |
const TUid KDbmsDriverUid16={KDbmsDriverUidValue16};
|
sl@0
|
510 |
|
sl@0
|
511 |
#include "D32DBAS.INL"
|
sl@0
|
512 |
#endif
|