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 |
// DBMS Client/Server architecture
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
#include "U32STD.H"
|
sl@0
|
20 |
#include "D32SRV.H"
|
sl@0
|
21 |
#include "D32DRVR.H"
|
sl@0
|
22 |
#include <f32file.h>
|
sl@0
|
23 |
#include <s32mem.h>
|
sl@0
|
24 |
#include "D32VER.H"
|
sl@0
|
25 |
#include "D32Map.h"
|
sl@0
|
26 |
#include "Sd_DbProps.h"
|
sl@0
|
27 |
#include "Sd_PolicyProxy.h"
|
sl@0
|
28 |
#include "Sd_DriveSpace.h"
|
sl@0
|
29 |
|
sl@0
|
30 |
// other classes referenced
|
sl@0
|
31 |
class HDbsColumns;
|
sl@0
|
32 |
struct TDbProps;
|
sl@0
|
33 |
|
sl@0
|
34 |
// classes defined
|
sl@0
|
35 |
class TDbsParam;
|
sl@0
|
36 |
class RDbsObject;
|
sl@0
|
37 |
class CDbsDatabase;
|
sl@0
|
38 |
class CDbsIncremental;
|
sl@0
|
39 |
class CDbsCursor;
|
sl@0
|
40 |
class CDbsConstraint;
|
sl@0
|
41 |
class CDbsNotifier;
|
sl@0
|
42 |
class CDbsSource;
|
sl@0
|
43 |
class RDbsSources;
|
sl@0
|
44 |
class CDbsServer;
|
sl@0
|
45 |
class CDbsSession;
|
sl@0
|
46 |
class HDbsStream;
|
sl@0
|
47 |
|
sl@0
|
48 |
#if defined(_DEBUG)
|
sl@0
|
49 |
/**
|
sl@0
|
50 |
@internalComponent
|
sl@0
|
51 |
*/
|
sl@0
|
52 |
#define _SMALL_BUFFER
|
sl@0
|
53 |
#endif
|
sl@0
|
54 |
|
sl@0
|
55 |
using namespace DBSC;
|
sl@0
|
56 |
|
sl@0
|
57 |
/**
|
sl@0
|
58 |
@internalComponent
|
sl@0
|
59 |
*/
|
sl@0
|
60 |
enum TDbsPanic
|
sl@0
|
61 |
{
|
sl@0
|
62 |
EDbsUnimplemented, //0
|
sl@0
|
63 |
EDbsInvalidColumn,
|
sl@0
|
64 |
EDbsWrongType,
|
sl@0
|
65 |
EDbsNoRowData,
|
sl@0
|
66 |
EDbsNotInUpdate,
|
sl@0
|
67 |
EDbsBadDescriptor,
|
sl@0
|
68 |
EDbsBadHandle,
|
sl@0
|
69 |
EDbsStreamMarkInvalid,
|
sl@0
|
70 |
EDbsStreamLocationInvalid,
|
sl@0
|
71 |
EDbsObserverRequestPending,
|
sl@0
|
72 |
EDbsInvalidDrive //10
|
sl@0
|
73 |
};
|
sl@0
|
74 |
|
sl@0
|
75 |
/**
|
sl@0
|
76 |
used by proxy classes
|
sl@0
|
77 |
@internalComponent
|
sl@0
|
78 |
*/
|
sl@0
|
79 |
GLREF_C void Panic(TDbsPanic aPanic);
|
sl@0
|
80 |
|
sl@0
|
81 |
/**
|
sl@0
|
82 |
@internalComponent
|
sl@0
|
83 |
*/
|
sl@0
|
84 |
GLREF_C void ExternalizeL(const TDbCol& aCol,RWriteStream& aStream);
|
sl@0
|
85 |
GLREF_C void ExternalizeL(const CDbColSet& aColSet,RWriteStream& aStream);
|
sl@0
|
86 |
GLREF_C void InternalizeL(CDbColSet& aColSet,RReadStream& aStream);
|
sl@0
|
87 |
GLREF_C void ExternalizeL(const CDbKey& aKey,RWriteStream& aStream);
|
sl@0
|
88 |
GLREF_C void InternalizeL(CDbKey& aKey,RReadStream& aStream);
|
sl@0
|
89 |
GLREF_C void ExternalizeL(const CDbNames& aNames,RWriteStream& aStream);
|
sl@0
|
90 |
GLREF_C void InternalizeL(CDbNames& aNames,RReadStream& aStream);
|
sl@0
|
91 |
GLREF_C void ExternalizeL(const CDbStrings& aNames,RWriteStream& aStream);
|
sl@0
|
92 |
GLREF_C void InternalizeL(CDbStrings& aNames,RReadStream& aStream);
|
sl@0
|
93 |
|
sl@0
|
94 |
/**
|
sl@0
|
95 |
@internalComponent
|
sl@0
|
96 |
*/
|
sl@0
|
97 |
_LIT(KDbsServerName,"!DBMS server");
|
sl@0
|
98 |
_LIT(KDbsServerImg,"EDBSRV"); // DLL/EXE name
|
sl@0
|
99 |
const TUid KDbsServerUid3={0x100012a5};
|
sl@0
|
100 |
|
sl@0
|
101 |
|
sl@0
|
102 |
/**
|
sl@0
|
103 |
@internalComponent
|
sl@0
|
104 |
*/
|
sl@0
|
105 |
const TInt KDbsExitDelay=4*0x100000; // ~4 seconds
|
sl@0
|
106 |
const TInt KDbsLeavePanic=~(1<<20);
|
sl@0
|
107 |
const TInt KTablePolicyMaskBit = 1024; //Used in RDbs::Get<Obj>Policy() methods
|
sl@0
|
108 |
|
sl@0
|
109 |
/**
|
sl@0
|
110 |
shared classes
|
sl@0
|
111 |
@internalComponent
|
sl@0
|
112 |
*/
|
sl@0
|
113 |
enum TDbsType {EDbsFree,EDbsDatabase,EDbsIncremental,EDbsCursor,EDbsConstraint,EDbsStream,EDbsObserver,EDbsMaxType=EDbsObserver,EDbsSession=EDbsFree};
|
sl@0
|
114 |
|
sl@0
|
115 |
/**
|
sl@0
|
116 |
Make sure that KDbsFunc2SecurityPolicyMask array in SD_PolicyProxy.cpp gets updated if
|
sl@0
|
117 |
new enum items are going to be added to TDbsFunction.
|
sl@0
|
118 |
@internalComponent
|
sl@0
|
119 |
*/
|
sl@0
|
120 |
enum TDbsFunction
|
sl@0
|
121 |
{
|
sl@0
|
122 |
// Session functions
|
sl@0
|
123 |
EDbsResourceMark, //0
|
sl@0
|
124 |
EDbsResourceCheck,
|
sl@0
|
125 |
EDbsResourceCount,
|
sl@0
|
126 |
EDbsSetHeapFailure,
|
sl@0
|
127 |
EDbsOpenDatabase,
|
sl@0
|
128 |
// common functions
|
sl@0
|
129 |
EDbsClose,
|
sl@0
|
130 |
// Database functions
|
sl@0
|
131 |
EDbsDatabaseAuthenticate, //Not used in SYMBIAN_REMOVE_TRIVIAL_ENCRYPTION version
|
sl@0
|
132 |
EDbsDatabaseDestroy,
|
sl@0
|
133 |
EDbsDatabaseBegin,
|
sl@0
|
134 |
EDbsDatabaseCommit,
|
sl@0
|
135 |
EDbsDatabaseRollback, //10
|
sl@0
|
136 |
EDbsDatabaseProperty,
|
sl@0
|
137 |
EDbsDatabaseCreateTable,
|
sl@0
|
138 |
EDbsDatabaseTables,
|
sl@0
|
139 |
EDbsDatabaseColumns,
|
sl@0
|
140 |
EDbsDatabaseIndexes,
|
sl@0
|
141 |
EDbsDatabaseKeys,
|
sl@0
|
142 |
EDbsDatabaseOpenObserver,
|
sl@0
|
143 |
EDbsDatabaseOpenUtility,
|
sl@0
|
144 |
EDbsDatabaseOpenDropTable,
|
sl@0
|
145 |
EDbsDatabaseOpenAlterTable, //20
|
sl@0
|
146 |
EDbsDatabaseOpenCreateIndex,
|
sl@0
|
147 |
EDbsDatabaseOpenDropIndex,
|
sl@0
|
148 |
EDbsDatabaseExecute,
|
sl@0
|
149 |
EDbsDatabasePrepareView,
|
sl@0
|
150 |
EDbsDatabaseOpenTable,
|
sl@0
|
151 |
// Observer functions
|
sl@0
|
152 |
EDbsObserverNotify,
|
sl@0
|
153 |
EDbsObserverCancel,
|
sl@0
|
154 |
// Incremental functions
|
sl@0
|
155 |
EDbsIncrementalNext,
|
sl@0
|
156 |
// Cursor functions
|
sl@0
|
157 |
EDbsCursorColumnTypes,
|
sl@0
|
158 |
EDbsCursorReset, //30
|
sl@0
|
159 |
EDbsCursorEvaluate,
|
sl@0
|
160 |
EDbsCursorUnevaluated,
|
sl@0
|
161 |
EDbsCursorSetIndex,
|
sl@0
|
162 |
EDbsCursorSeek,
|
sl@0
|
163 |
EDbsCursorAtBeginning,
|
sl@0
|
164 |
EDbsCursorAtEnd,
|
sl@0
|
165 |
EDbsCursorAtRow,
|
sl@0
|
166 |
EDbsCursorCount,
|
sl@0
|
167 |
EDbsCursorGotoPos,
|
sl@0
|
168 |
EDbsCursorBookmark, //40
|
sl@0
|
169 |
EDbsCursorGotoBookmark,
|
sl@0
|
170 |
EDbsCursorGet,
|
sl@0
|
171 |
EDbsCursorInsert,
|
sl@0
|
172 |
EDbsCursorUpdate,
|
sl@0
|
173 |
EDbsCursorRetrieveRow,
|
sl@0
|
174 |
EDbsCursorCancel,
|
sl@0
|
175 |
EDbsCursorPut,
|
sl@0
|
176 |
EDbsCursorDelete,
|
sl@0
|
177 |
EDbsCursorColumns,
|
sl@0
|
178 |
EDbsCursorColumnDef, //50
|
sl@0
|
179 |
EDbsCursorSetNull,
|
sl@0
|
180 |
EDbsCursorColumnSize,
|
sl@0
|
181 |
EDbsCursorColumnSource,
|
sl@0
|
182 |
EDbsCursorColumnSink,
|
sl@0
|
183 |
EDbsCursorOpenConstraint,
|
sl@0
|
184 |
EDbsCursorMatch,
|
sl@0
|
185 |
EDbsCursorFind,
|
sl@0
|
186 |
// stream functions
|
sl@0
|
187 |
EDbsStreamRead,
|
sl@0
|
188 |
EDbsStreamWrite,
|
sl@0
|
189 |
EDbsStreamSize, //60
|
sl@0
|
190 |
EDbsStreamSynch,
|
sl@0
|
191 |
// Session functions
|
sl@0
|
192 |
EDbsCreateDatabase,
|
sl@0
|
193 |
EDbsDatabaseList,
|
sl@0
|
194 |
EDbsCopyDatabase,
|
sl@0
|
195 |
EDbsDeleteDatabase,
|
sl@0
|
196 |
EDbsGetSecurityPolicy,
|
sl@0
|
197 |
// reserved disk space handling functions
|
sl@0
|
198 |
EDbsReserveDriveSpace,
|
sl@0
|
199 |
EDbsFreeReservedSpace,
|
sl@0
|
200 |
EDbsReserveGetAccess,
|
sl@0
|
201 |
EDbsReserveReleaseAccess, //70
|
sl@0
|
202 |
//
|
sl@0
|
203 |
EDbsGetBackupPath,
|
sl@0
|
204 |
EDbsGetBackupPaths,
|
sl@0
|
205 |
//Insert new functuions here
|
sl@0
|
206 |
EDbsLast
|
sl@0
|
207 |
};
|
sl@0
|
208 |
|
sl@0
|
209 |
/**
|
sl@0
|
210 |
@internalComponent
|
sl@0
|
211 |
*/
|
sl@0
|
212 |
const TInt KDbsTypeBits=4;
|
sl@0
|
213 |
const TInt KDbsMagicBits=4;
|
sl@0
|
214 |
const TInt KDbsIndexBits=14;
|
sl@0
|
215 |
const TInt KDbsFunctionBits=9;
|
sl@0
|
216 |
const TInt KDbsHandleBits=KDbsTypeBits+KDbsMagicBits+KDbsIndexBits;
|
sl@0
|
217 |
const TInt KDbsTypeMask=(1<<KDbsTypeBits)-1;
|
sl@0
|
218 |
const TInt KDbsMagicMask=(1<<KDbsMagicBits)-1;
|
sl@0
|
219 |
const TInt KDbsHandleMask=(1<<KDbsHandleBits)-1;
|
sl@0
|
220 |
const TInt KDbsObjectReturn=1<<(KDbsFunctionBits-1);
|
sl@0
|
221 |
const TInt KDbsIndexLimit=1<<KDbsIndexBits;
|
sl@0
|
222 |
|
sl@0
|
223 |
/**
|
sl@0
|
224 |
@internalComponent
|
sl@0
|
225 |
*/
|
sl@0
|
226 |
#define KDbsSessionHandle DbsSessionHandle()
|
sl@0
|
227 |
|
sl@0
|
228 |
/**
|
sl@0
|
229 |
@internalComponent
|
sl@0
|
230 |
*/
|
sl@0
|
231 |
inline TInt DbsMessage(TInt aFunction,TInt aHandle);
|
sl@0
|
232 |
inline TDbsFunction DbsFunction(TInt aMessage);
|
sl@0
|
233 |
inline TInt DbsHandle(TInt aMessage);
|
sl@0
|
234 |
inline TDbsType DbsType(TInt aHandle);
|
sl@0
|
235 |
inline TInt DbsMagic(TInt aHandle);
|
sl@0
|
236 |
inline TInt DbsObjectIndex(TInt aHandle);
|
sl@0
|
237 |
inline TInt DbsMakeHandle(TInt aIndex,TInt aMagic,TDbsType aType);
|
sl@0
|
238 |
inline TInt DbsSessionHandle();
|
sl@0
|
239 |
|
sl@0
|
240 |
#if !defined(_SMALL_BUFFER)
|
sl@0
|
241 |
/**
|
sl@0
|
242 |
@internalComponent
|
sl@0
|
243 |
*/
|
sl@0
|
244 |
const TInt KDbsStreamBufSize=0x600; // 1.5K
|
sl@0
|
245 |
const TInt KDbsStreamIoSize=0xc00; // 3K
|
sl@0
|
246 |
const TInt KDbsColumnTypesSize=0x200; // .5K
|
sl@0
|
247 |
#else
|
sl@0
|
248 |
const TInt KDbsStreamBufSize=2;
|
sl@0
|
249 |
const TInt KDbsStreamIoSize=32;
|
sl@0
|
250 |
const TInt KDbsColumnTypesSize=2;
|
sl@0
|
251 |
#endif
|
sl@0
|
252 |
|
sl@0
|
253 |
/**
|
sl@0
|
254 |
@internalComponent
|
sl@0
|
255 |
*/
|
sl@0
|
256 |
class TDbsStreamBuf
|
sl@0
|
257 |
{
|
sl@0
|
258 |
public:
|
sl@0
|
259 |
enum {ESize=KDbsStreamBufSize};
|
sl@0
|
260 |
public:
|
sl@0
|
261 |
TInt iExt;
|
sl@0
|
262 |
TUint8 iData[ESize];
|
sl@0
|
263 |
};
|
sl@0
|
264 |
|
sl@0
|
265 |
/**
|
sl@0
|
266 |
@internalComponent
|
sl@0
|
267 |
*/
|
sl@0
|
268 |
class TDbsColumns
|
sl@0
|
269 |
{
|
sl@0
|
270 |
public:
|
sl@0
|
271 |
enum {EMax=KDbsColumnTypesSize};
|
sl@0
|
272 |
public:
|
sl@0
|
273 |
TInt iCount;
|
sl@0
|
274 |
TUint8 iData[EMax];
|
sl@0
|
275 |
};
|
sl@0
|
276 |
|
sl@0
|
277 |
/**
|
sl@0
|
278 |
client side classes
|
sl@0
|
279 |
@internalComponent
|
sl@0
|
280 |
*/
|
sl@0
|
281 |
class TDbsParam
|
sl@0
|
282 |
{
|
sl@0
|
283 |
public:
|
sl@0
|
284 |
inline void operator=(const TDesC8& aDes);
|
sl@0
|
285 |
inline void operator=(const TDesC16& aDes);
|
sl@0
|
286 |
inline void operator=(TInt aVal);
|
sl@0
|
287 |
//
|
sl@0
|
288 |
static TPtrC8 PrepareLC(const CDbColSet& aColSet);
|
sl@0
|
289 |
static TPtrC8 PrepareLC(const CDbKey& aKey);
|
sl@0
|
290 |
static TPtrC8 PrepareLC(const TDbLookupKey& aKey);
|
sl@0
|
291 |
|
sl@0
|
292 |
private:
|
sl@0
|
293 |
union
|
sl@0
|
294 |
{
|
sl@0
|
295 |
const TAny* iPtr;
|
sl@0
|
296 |
TInt iInt;
|
sl@0
|
297 |
};
|
sl@0
|
298 |
};
|
sl@0
|
299 |
|
sl@0
|
300 |
/**
|
sl@0
|
301 |
@internalComponent
|
sl@0
|
302 |
*/
|
sl@0
|
303 |
typedef TDbsParam TDbsMessage[4];
|
sl@0
|
304 |
|
sl@0
|
305 |
/**
|
sl@0
|
306 |
@internalComponent
|
sl@0
|
307 |
*/
|
sl@0
|
308 |
class RDbsObject : private RDbs
|
sl@0
|
309 |
{
|
sl@0
|
310 |
public:
|
sl@0
|
311 |
inline RDbsObject();
|
sl@0
|
312 |
inline void OpenL(const RDbsObject& aDbs,TDbsFunction aFunction);
|
sl@0
|
313 |
inline void OpenL(const RDbsObject& aDbs,TDbsFunction aFunction,const TIpcArgs& aArgs);
|
sl@0
|
314 |
inline void OpenL(const RDbs& aDbs,TDbsFunction aFunction,const TIpcArgs& aArgs);
|
sl@0
|
315 |
void Close();
|
sl@0
|
316 |
//
|
sl@0
|
317 |
inline TInt Handle() const;
|
sl@0
|
318 |
//
|
sl@0
|
319 |
TInt SendReceive(TDbsFunction aFunction) const;
|
sl@0
|
320 |
inline TInt SendReceive(TDbsFunction aFunction,const TIpcArgs& aArgs) const;
|
sl@0
|
321 |
TInt SendReceiveL(TDbsFunction aFunction) const;
|
sl@0
|
322 |
inline TInt SendReceiveL(TDbsFunction aFunction,const TIpcArgs& aArgs) const;
|
sl@0
|
323 |
inline void SendReceive(TDbsFunction aFunction,TRequestStatus& aStatus) const;
|
sl@0
|
324 |
inline void SendReceive(TDbsFunction aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const;
|
sl@0
|
325 |
private:
|
sl@0
|
326 |
inline RDbsObject(const RDbs& aDbs);
|
sl@0
|
327 |
void SendReceive(TDbsFunction aFunction,const TIpcArgs* aArgs,TRequestStatus& aStatus) const;
|
sl@0
|
328 |
TInt SendReceive(TDbsFunction aFunction,const TIpcArgs* aArgs) const;
|
sl@0
|
329 |
TInt SendReceiveL(TDbsFunction aFunction,const TIpcArgs* aArgs) const;
|
sl@0
|
330 |
void OpenL(const RDbsObject& aDbs,TDbsFunction aFunction,const TIpcArgs* aArgs);
|
sl@0
|
331 |
private:
|
sl@0
|
332 |
TInt iHandle;
|
sl@0
|
333 |
};
|
sl@0
|
334 |
|
sl@0
|
335 |
/**
|
sl@0
|
336 |
@internalComponent
|
sl@0
|
337 |
*/
|
sl@0
|
338 |
NONSHARABLE_CLASS(CDbsDatabase) : public CDbDatabase
|
sl@0
|
339 |
{
|
sl@0
|
340 |
friend class CDbsSecureDatabase;
|
sl@0
|
341 |
public:
|
sl@0
|
342 |
static CDbsDatabase* NewL(const RDbs& aDbs,const TDesC& aDatabase,const TDesC& aFormat);
|
sl@0
|
343 |
~CDbsDatabase();
|
sl@0
|
344 |
//
|
sl@0
|
345 |
private:
|
sl@0
|
346 |
inline CDbsDatabase();
|
sl@0
|
347 |
void ConstructL(const RDbs& aDbs,TIpcArgs& aArgs);
|
sl@0
|
348 |
// from CDbDatabase
|
sl@0
|
349 |
TInt Destroy();
|
sl@0
|
350 |
TInt Begin();
|
sl@0
|
351 |
TInt Commit();
|
sl@0
|
352 |
void Rollback();
|
sl@0
|
353 |
TInt Property(TProperty aProperty);
|
sl@0
|
354 |
void CreateTableL(const TDesC& aName,const CDbColSet& aColSet,const CDbKey* aPrimaryKey);
|
sl@0
|
355 |
void TablesL(CDbTableNames& aNames);
|
sl@0
|
356 |
void ColumnsL(CDbColSet& aColSet,const TDesC& aName);
|
sl@0
|
357 |
void IndexesL(CDbIndexNames& aNames,const TDesC& aTable);
|
sl@0
|
358 |
void KeysL(CDbKey& aKey,const TDesC& aName,const TDesC& aTable);
|
sl@0
|
359 |
CDbNotifier* OpenNotifierL();
|
sl@0
|
360 |
CDbIncremental* OpenUtilityL(TUtility aType,TInt& aStep);
|
sl@0
|
361 |
CDbIncremental* OpenCompactL(TInt& aStep);
|
sl@0
|
362 |
CDbIncremental* OpenRecoverL(TInt& aStep);
|
sl@0
|
363 |
CDbIncremental* OpenDropTableL(const TDesC& aTable,TInt& aStep);
|
sl@0
|
364 |
CDbIncremental* OpenAlterTableL(const TDesC& aTable,const CDbColSet& aNewDef,TInt& aStep);
|
sl@0
|
365 |
CDbIncremental* OpenCreateIndexL(const TDesC& aName,const TDesC& aTable,const CDbKey& aKey,TInt& aStep);
|
sl@0
|
366 |
CDbIncremental* OpenDropIndexL(const TDesC& aName,const TDesC& aTable,TInt& aStep);
|
sl@0
|
367 |
CDbIncremental* OpenExecuteL(const TDesC& aSql,TDbTextComparison aComparison,TInt& aInit);
|
sl@0
|
368 |
CDbCursor* PrepareViewL(const TDbQuery& aQuery,const TDbWindow& aWindow,RDbRowSet::TAccess anAccess);
|
sl@0
|
369 |
CDbCursor* OpenTableL(const TDesC& aName,RDbRowSet::TAccess anAccess);
|
sl@0
|
370 |
private:
|
sl@0
|
371 |
RDbsObject iObject;
|
sl@0
|
372 |
};
|
sl@0
|
373 |
|
sl@0
|
374 |
//Secure shared database
|
sl@0
|
375 |
NONSHARABLE_CLASS(CDbsSecureDatabase) : public CDbsDatabase
|
sl@0
|
376 |
{
|
sl@0
|
377 |
public:
|
sl@0
|
378 |
static CDbsSecureDatabase* NewL(const RDbs& aDbs,const TDesC& aDatabase,const TDesC& aFormat);
|
sl@0
|
379 |
virtual ~CDbsSecureDatabase();
|
sl@0
|
380 |
|
sl@0
|
381 |
private:
|
sl@0
|
382 |
inline CDbsSecureDatabase();
|
sl@0
|
383 |
void ConstructL(const RDbs& aDbs,TIpcArgs& aArgs);
|
sl@0
|
384 |
|
sl@0
|
385 |
};
|
sl@0
|
386 |
|
sl@0
|
387 |
/**
|
sl@0
|
388 |
@internalComponent
|
sl@0
|
389 |
*/
|
sl@0
|
390 |
NONSHARABLE_CLASS(CDbsNotifier) : public CDbNotifier
|
sl@0
|
391 |
{
|
sl@0
|
392 |
public:
|
sl@0
|
393 |
static CDbsNotifier* NewL(const RDbsObject& aDatabase);
|
sl@0
|
394 |
private:
|
sl@0
|
395 |
inline CDbsNotifier();
|
sl@0
|
396 |
~CDbsNotifier();
|
sl@0
|
397 |
// from CDbObserver
|
sl@0
|
398 |
void Notify(TType aEvent,TRequestStatus& aStatus);
|
sl@0
|
399 |
void Cancel();
|
sl@0
|
400 |
private:
|
sl@0
|
401 |
RDbsObject iObject;
|
sl@0
|
402 |
};
|
sl@0
|
403 |
|
sl@0
|
404 |
/**
|
sl@0
|
405 |
@internalComponent
|
sl@0
|
406 |
*/
|
sl@0
|
407 |
NONSHARABLE_CLASS(CDbsIncremental) : public CDbAsyncIncremental
|
sl@0
|
408 |
{
|
sl@0
|
409 |
public:
|
sl@0
|
410 |
static CDbsIncremental* NewL(const RDbsObject& aDbs,TDbsFunction aFunction,TIpcArgs& aArgs,TInt& aStep);
|
sl@0
|
411 |
~CDbsIncremental();
|
sl@0
|
412 |
private:
|
sl@0
|
413 |
inline CDbsIncremental();
|
sl@0
|
414 |
// from CDbAsyncIncremental
|
sl@0
|
415 |
void Next(TPckgBuf<TInt>& aStep,TRequestStatus& aStatus);
|
sl@0
|
416 |
private:
|
sl@0
|
417 |
RDbsObject iObject;
|
sl@0
|
418 |
};
|
sl@0
|
419 |
|
sl@0
|
420 |
/**
|
sl@0
|
421 |
@internalComponent
|
sl@0
|
422 |
*/
|
sl@0
|
423 |
NONSHARABLE_CLASS(CDbsCursor) : public CDbCursor
|
sl@0
|
424 |
{
|
sl@0
|
425 |
public:
|
sl@0
|
426 |
static CDbsCursor* NewL(const RDbsObject& aDbs,TDbsFunction aFunction,TIpcArgs& aArgs);
|
sl@0
|
427 |
~CDbsCursor();
|
sl@0
|
428 |
private:
|
sl@0
|
429 |
CDbsCursor();
|
sl@0
|
430 |
void ConstructL(const RDbsObject& aDbs,TDbsFunction aFunction,TIpcArgs& aArgs);
|
sl@0
|
431 |
//
|
sl@0
|
432 |
TDbColType Type(TDbColNo aCol) const;
|
sl@0
|
433 |
void ReplaceBlobL(TDbColumn& aCol);
|
sl@0
|
434 |
TBool RetrieveL(TDbsFunction aFunction,TInt aArg0=0);
|
sl@0
|
435 |
// from CDbCursor
|
sl@0
|
436 |
void Reset();
|
sl@0
|
437 |
TBool EvaluateL();
|
sl@0
|
438 |
void Evaluate(TRequestStatus& aStatus);
|
sl@0
|
439 |
TBool Unevaluated();
|
sl@0
|
440 |
void SetIndexL(const TDesC* anIndex);
|
sl@0
|
441 |
TBool SeekL(const TDbLookupKey& aKey,RDbTable::TComparison aComparison);
|
sl@0
|
442 |
TBool AtBeginning();
|
sl@0
|
443 |
TBool AtEnd();
|
sl@0
|
444 |
TBool AtRow();
|
sl@0
|
445 |
TInt CountL(RDbRowSet::TAccuracy aAccuracy);
|
sl@0
|
446 |
TBool GotoL(RDbRowSet::TPosition aPosition);
|
sl@0
|
447 |
void Bookmark(TDbBookmark::TMark& aMark);
|
sl@0
|
448 |
void GotoL(const TDbBookmark::TMark& aMark);
|
sl@0
|
449 |
void GetL();
|
sl@0
|
450 |
void InsertL(TInsert aClearRow);
|
sl@0
|
451 |
void UpdateL();
|
sl@0
|
452 |
void Cancel();
|
sl@0
|
453 |
void PutL();
|
sl@0
|
454 |
void DeleteL();
|
sl@0
|
455 |
TInt ColumnCount();
|
sl@0
|
456 |
void ColumnsL(CDbColSet& aColSet);
|
sl@0
|
457 |
void ColumnDef(TDbCol& aCol,TDbColNo aColNo);
|
sl@0
|
458 |
TDbColType ColumnType(TDbColNo aCol);
|
sl@0
|
459 |
RDbRow* RowBuffer();
|
sl@0
|
460 |
TDbColumnC ColumnC(TDbColNo aCol); // non-writeable column
|
sl@0
|
461 |
TDbColumn Column(TDbColNo aCol); // writeable column
|
sl@0
|
462 |
void SetNullL(TDbColNo aCol);
|
sl@0
|
463 |
TInt ColumnSize(TDbColNo aCol);
|
sl@0
|
464 |
MStreamBuf* ColumnSourceL(TDbColNo aCol);
|
sl@0
|
465 |
MStreamBuf* ColumnSinkL(TDbColNo aCol);
|
sl@0
|
466 |
CDbRowConstraint* OpenConstraintL(const TDbQuery& aCriteria);
|
sl@0
|
467 |
TBool MatchL(CDbRowConstraint& aCursor);
|
sl@0
|
468 |
TInt FindL(RDbRowSet::TDirection aDirection,const TDbQuery& aCriteria);
|
sl@0
|
469 |
private:
|
sl@0
|
470 |
enum TState {EUnknown,EAtBeginning,EAtEnd,EAtRow,ERetrieve,ERead,EWrite};
|
sl@0
|
471 |
private:
|
sl@0
|
472 |
RDbsObject iObject;
|
sl@0
|
473 |
TState iState;
|
sl@0
|
474 |
TBool iChangedBlob;
|
sl@0
|
475 |
HDbsColumns* iColumns;
|
sl@0
|
476 |
RDbRow iRow;
|
sl@0
|
477 |
};
|
sl@0
|
478 |
|
sl@0
|
479 |
/**
|
sl@0
|
480 |
@internalComponent
|
sl@0
|
481 |
*/
|
sl@0
|
482 |
NONSHARABLE_CLASS(CDbsConstraint) : public CDbRowConstraint
|
sl@0
|
483 |
{
|
sl@0
|
484 |
friend class CDbsCursor;
|
sl@0
|
485 |
private:
|
sl@0
|
486 |
inline CDbsConstraint();
|
sl@0
|
487 |
~CDbsConstraint();
|
sl@0
|
488 |
private:
|
sl@0
|
489 |
RDbsObject iObject;
|
sl@0
|
490 |
};
|
sl@0
|
491 |
|
sl@0
|
492 |
/**
|
sl@0
|
493 |
@internalComponent
|
sl@0
|
494 |
*/
|
sl@0
|
495 |
NONSHARABLE_CLASS(HDbsBuf) : public TStreamBuf
|
sl@0
|
496 |
{
|
sl@0
|
497 |
public:
|
sl@0
|
498 |
static HDbsBuf* NewL(const RDbsObject& aObject,TDbsFunction aFunction,TIpcArgs& aArgs);
|
sl@0
|
499 |
static HDbsBuf* NewLC(const RDbsObject& aObject,TDbsFunction aFunction,TIpcArgs& aArgs);
|
sl@0
|
500 |
static HDbsBuf* NewLC(const RDbs& aDbSession, TDbsFunction aFunction, TIpcArgs& aArgs);
|
sl@0
|
501 |
virtual inline ~HDbsBuf();
|
sl@0
|
502 |
private:
|
sl@0
|
503 |
inline HDbsBuf();
|
sl@0
|
504 |
void ConstructL(const RDbsObject& aObject,TDbsFunction aFunction,TIpcArgs& aArgs);
|
sl@0
|
505 |
void ConstructL(const RDbs& aDbSession, TDbsFunction aFunction, TIpcArgs& aArgs);
|
sl@0
|
506 |
// from TStreamBuf
|
sl@0
|
507 |
TInt UnderflowL(TInt aMaxLength);
|
sl@0
|
508 |
void OverflowL();
|
sl@0
|
509 |
void DoRelease();
|
sl@0
|
510 |
void DoSynchL();
|
sl@0
|
511 |
TInt DoReadL(TAny* aPtr,TInt aMaxLength);
|
sl@0
|
512 |
void DoWriteL(const TAny* aPtr,TInt aLength);
|
sl@0
|
513 |
TStreamPos DoSeekL(TMark aMark,TStreamLocation aLocation,TInt anOffset);
|
sl@0
|
514 |
private:
|
sl@0
|
515 |
inline void SetPos(TRead,TInt aPos);
|
sl@0
|
516 |
inline void SetPos(TWrite,TInt aPos);
|
sl@0
|
517 |
inline TInt Pos(TRead) const;
|
sl@0
|
518 |
inline TInt Pos(TWrite) const;
|
sl@0
|
519 |
inline TInt MovePos(TRead,TInt anOffset);
|
sl@0
|
520 |
inline TInt MovePos(TWrite,TInt anOffset);
|
sl@0
|
521 |
TInt IpcReadL(TAny* aPtr,TInt aMaxLength);
|
sl@0
|
522 |
void IpcWriteL(const TAny* aPtr,TInt aLength);
|
sl@0
|
523 |
TInt EndL();
|
sl@0
|
524 |
//
|
sl@0
|
525 |
inline TInt Lag(TRead) const;
|
sl@0
|
526 |
inline TInt Lag(TWrite) const;
|
sl@0
|
527 |
inline TInt Mark(TRead) const;
|
sl@0
|
528 |
inline TInt Mark(TWrite) const;
|
sl@0
|
529 |
private:
|
sl@0
|
530 |
RDbsObject iIpc;
|
sl@0
|
531 |
TInt iRPos;
|
sl@0
|
532 |
TInt iWPos;
|
sl@0
|
533 |
TDbsStreamBuf iBuf;
|
sl@0
|
534 |
};
|
sl@0
|
535 |
|
sl@0
|
536 |
/**
|
sl@0
|
537 |
@internalComponent
|
sl@0
|
538 |
*/
|
sl@0
|
539 |
NONSHARABLE_CLASS(HDbsReadBuf) : public TMemBuf
|
sl@0
|
540 |
{
|
sl@0
|
541 |
public:
|
sl@0
|
542 |
static HDbsReadBuf* NewL(const TDesC8& aDes);
|
sl@0
|
543 |
protected:
|
sl@0
|
544 |
inline HDbsReadBuf(const TDesC8& aDes);
|
sl@0
|
545 |
void DoRelease();
|
sl@0
|
546 |
};
|
sl@0
|
547 |
|
sl@0
|
548 |
/**
|
sl@0
|
549 |
@internalComponent
|
sl@0
|
550 |
*/
|
sl@0
|
551 |
NONSHARABLE_CLASS(CDbsObserver) : public CActive
|
sl@0
|
552 |
{
|
sl@0
|
553 |
public:
|
sl@0
|
554 |
/**
|
sl@0
|
555 |
@internalComponent
|
sl@0
|
556 |
*/
|
sl@0
|
557 |
class HObserver
|
sl@0
|
558 |
{
|
sl@0
|
559 |
friend class CDbsObserver;
|
sl@0
|
560 |
public:
|
sl@0
|
561 |
~HObserver();
|
sl@0
|
562 |
void Notify(const RMessage2& aMessage);
|
sl@0
|
563 |
void Cancel();
|
sl@0
|
564 |
private:
|
sl@0
|
565 |
inline HObserver();
|
sl@0
|
566 |
void Complete(TInt aStatus);
|
sl@0
|
567 |
void Event(TInt aEvent);
|
sl@0
|
568 |
private:
|
sl@0
|
569 |
TDblQueLink iLink;
|
sl@0
|
570 |
TInt iPending;
|
sl@0
|
571 |
RMessagePtr2 iMessage;
|
sl@0
|
572 |
};
|
sl@0
|
573 |
friend class HObserver;
|
sl@0
|
574 |
public:
|
sl@0
|
575 |
static CDbsObserver* NewL(CDbsSource& aSource);
|
sl@0
|
576 |
static CDbsObserver* Collect(CDbsObserver* aNotifier);
|
sl@0
|
577 |
HObserver* ObserverL();
|
sl@0
|
578 |
private:
|
sl@0
|
579 |
inline CDbsObserver(CDbsSource& aSource);
|
sl@0
|
580 |
~CDbsObserver();
|
sl@0
|
581 |
//
|
sl@0
|
582 |
void Queue();
|
sl@0
|
583 |
// from CActive
|
sl@0
|
584 |
void RunL();
|
sl@0
|
585 |
void DoCancel();
|
sl@0
|
586 |
private:
|
sl@0
|
587 |
CDbsSource& iSource;
|
sl@0
|
588 |
CDbNotifier* iNotifier;
|
sl@0
|
589 |
TDblQue<HObserver> iQueue;
|
sl@0
|
590 |
};
|
sl@0
|
591 |
|
sl@0
|
592 |
/**
|
sl@0
|
593 |
@internalComponent
|
sl@0
|
594 |
*/
|
sl@0
|
595 |
NONSHARABLE_CLASS(CDbsConnection) : public CDbContext
|
sl@0
|
596 |
{
|
sl@0
|
597 |
friend class RDbsSources;
|
sl@0
|
598 |
public:
|
sl@0
|
599 |
inline CDbsSource& Source() const;
|
sl@0
|
600 |
static inline const CDbsConnection& Connection(const CDbObject& aObject);
|
sl@0
|
601 |
static inline CDbsSource& Source(const CDbObject& aObject);
|
sl@0
|
602 |
private:
|
sl@0
|
603 |
inline CDbsConnection() {}
|
sl@0
|
604 |
~CDbsConnection();
|
sl@0
|
605 |
inline void Set(CDbsSource& aSource);
|
sl@0
|
606 |
private:
|
sl@0
|
607 |
CDbsSource* iSource;
|
sl@0
|
608 |
};
|
sl@0
|
609 |
|
sl@0
|
610 |
/**
|
sl@0
|
611 |
@internalComponent
|
sl@0
|
612 |
*/
|
sl@0
|
613 |
class CDbsDatabaseStub : public CDbObject
|
sl@0
|
614 |
{
|
sl@0
|
615 |
public:
|
sl@0
|
616 |
static CDbsDatabaseStub* NewL();
|
sl@0
|
617 |
CDbDatabase* AuthenticateL();
|
sl@0
|
618 |
private:
|
sl@0
|
619 |
inline CDbsDatabaseStub();
|
sl@0
|
620 |
};
|
sl@0
|
621 |
|
sl@0
|
622 |
/**
|
sl@0
|
623 |
@internalComponent
|
sl@0
|
624 |
*/
|
sl@0
|
625 |
NONSHARABLE_CLASS(CDbsSource) : public CBase
|
sl@0
|
626 |
{
|
sl@0
|
627 |
friend class CDbsConnection;
|
sl@0
|
628 |
friend class CDbsObserver;
|
sl@0
|
629 |
public:
|
sl@0
|
630 |
static CDbsSource* NewL(RFs& aFs,const TDesC& aSource);
|
sl@0
|
631 |
//
|
sl@0
|
632 |
static inline TInt LinkOffset();
|
sl@0
|
633 |
TBool Is(const TDesC& aSource) const;
|
sl@0
|
634 |
//
|
sl@0
|
635 |
inline CDbSource& Source();
|
sl@0
|
636 |
CDbsObserver::HObserver* ObserverL();
|
sl@0
|
637 |
private:
|
sl@0
|
638 |
inline CDbsSource(const TDbFormat& aFormat);
|
sl@0
|
639 |
~CDbsSource();
|
sl@0
|
640 |
void Closed();
|
sl@0
|
641 |
//
|
sl@0
|
642 |
inline void Open();
|
sl@0
|
643 |
void Close();
|
sl@0
|
644 |
private:
|
sl@0
|
645 |
TDblQueLink iLink;
|
sl@0
|
646 |
HBufC* iName;
|
sl@0
|
647 |
const TDbFormat& iFormat;
|
sl@0
|
648 |
TInt iConnections;
|
sl@0
|
649 |
CDbSource* iSource;
|
sl@0
|
650 |
CDbsObserver* iObserver;
|
sl@0
|
651 |
};
|
sl@0
|
652 |
|
sl@0
|
653 |
/**
|
sl@0
|
654 |
@internalComponent
|
sl@0
|
655 |
*/
|
sl@0
|
656 |
class RDbsSources
|
sl@0
|
657 |
{
|
sl@0
|
658 |
private:
|
sl@0
|
659 |
typedef TDblQueIter<CDbsSource> TIter;
|
sl@0
|
660 |
public:
|
sl@0
|
661 |
inline RDbsSources(RDbCache& aCache);
|
sl@0
|
662 |
inline void Close();
|
sl@0
|
663 |
//
|
sl@0
|
664 |
CDbsConnection* OpenLC(RFs& aFs,const TDesC& aSource,const TDesC& aFormat);
|
sl@0
|
665 |
private:
|
sl@0
|
666 |
TDblQue<CDbsSource> iSources;
|
sl@0
|
667 |
RDbCache iDrivers;
|
sl@0
|
668 |
};
|
sl@0
|
669 |
|
sl@0
|
670 |
/**
|
sl@0
|
671 |
@internalComponent
|
sl@0
|
672 |
*/
|
sl@0
|
673 |
NONSHARABLE_CLASS(CDbsServer) : public CServer2
|
sl@0
|
674 |
{
|
sl@0
|
675 |
public:
|
sl@0
|
676 |
static CDbsServer* NewL();
|
sl@0
|
677 |
//
|
sl@0
|
678 |
inline TDes& Name0();
|
sl@0
|
679 |
inline TDes& Name1();
|
sl@0
|
680 |
inline TDes& FileName();
|
sl@0
|
681 |
inline RDbsSources& Sources();
|
sl@0
|
682 |
inline RFs& Fs();
|
sl@0
|
683 |
inline RDriveSpaceCol& DriveSpaceCol();
|
sl@0
|
684 |
void RemoveSession();
|
sl@0
|
685 |
//
|
sl@0
|
686 |
static CDbsServer* Instance();
|
sl@0
|
687 |
void Panic(const TDesC& aCategory,TInt aCode); // .. panic client!
|
sl@0
|
688 |
|
sl@0
|
689 |
inline CPolicyProxy& PolicyProxy() const;
|
sl@0
|
690 |
inline RDbPropsFactory& DbPropsFactory();
|
sl@0
|
691 |
|
sl@0
|
692 |
private:
|
sl@0
|
693 |
inline CDbsServer();
|
sl@0
|
694 |
~CDbsServer();
|
sl@0
|
695 |
void ConstructL();
|
sl@0
|
696 |
// from CServer
|
sl@0
|
697 |
CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const;
|
sl@0
|
698 |
private:
|
sl@0
|
699 |
enum {ECacheSize=8};
|
sl@0
|
700 |
enum {EServerPriority=0};
|
sl@0
|
701 |
private:
|
sl@0
|
702 |
RDbCache iCache;
|
sl@0
|
703 |
RDbsSources iSources;
|
sl@0
|
704 |
TDbName iName0; // used for message servicing
|
sl@0
|
705 |
TDbName iName1;
|
sl@0
|
706 |
TFileName iFileName;
|
sl@0
|
707 |
RFs iFs;
|
sl@0
|
708 |
CPolicyProxy* iPolicyProxy;
|
sl@0
|
709 |
RDbPropsFactory iDbPropsFactory;
|
sl@0
|
710 |
RDriveSpaceCol iDriveSpaceCol;
|
sl@0
|
711 |
};
|
sl@0
|
712 |
|
sl@0
|
713 |
/**
|
sl@0
|
714 |
@internalComponent
|
sl@0
|
715 |
*/
|
sl@0
|
716 |
NONSHARABLE_CLASS(CDbsSession) : public CSession2
|
sl@0
|
717 |
{
|
sl@0
|
718 |
private:
|
sl@0
|
719 |
#if !defined(_SMALL_BUFFER)
|
sl@0
|
720 |
enum {EIndexGranularity=8};
|
sl@0
|
721 |
#else
|
sl@0
|
722 |
enum {EIndexGranularity=1};
|
sl@0
|
723 |
#endif
|
sl@0
|
724 |
struct TEntry
|
sl@0
|
725 |
{
|
sl@0
|
726 |
union
|
sl@0
|
727 |
{
|
sl@0
|
728 |
TAny* iObject;
|
sl@0
|
729 |
TInt iNext;
|
sl@0
|
730 |
};
|
sl@0
|
731 |
TUint8 iType;
|
sl@0
|
732 |
const MPolicy* iPolicy;
|
sl@0
|
733 |
TUint8 iMagic;
|
sl@0
|
734 |
public:
|
sl@0
|
735 |
void Release();
|
sl@0
|
736 |
DECLARE_DB_DUMP3(aFile)
|
sl@0
|
737 |
//
|
sl@0
|
738 |
inline TDbsType Type() const;
|
sl@0
|
739 |
inline CDbsDatabaseStub& DatabaseStub();
|
sl@0
|
740 |
inline CDbDatabase& Database();
|
sl@0
|
741 |
inline CDbIncremental& Incremental();
|
sl@0
|
742 |
inline CDbCursor& Cursor();
|
sl@0
|
743 |
inline CDbRowConstraint& Constraint();
|
sl@0
|
744 |
inline HDbsStream& Stream();
|
sl@0
|
745 |
inline CDbsObserver::HObserver& Observer();
|
sl@0
|
746 |
};
|
sl@0
|
747 |
public:
|
sl@0
|
748 |
CDbsSession();
|
sl@0
|
749 |
virtual ~CDbsSession();
|
sl@0
|
750 |
private:
|
sl@0
|
751 |
//From CSession2
|
sl@0
|
752 |
virtual void CreateL();
|
sl@0
|
753 |
// from CSession
|
sl@0
|
754 |
void ServiceL(const RMessage2& aMessage);
|
sl@0
|
755 |
TInt ExtServiceL(const RMessage2& aMessage, TDbsFunction aDbsFunction);
|
sl@0
|
756 |
void ServiceError(const RMessage2& aMessage,TInt aError);
|
sl@0
|
757 |
TInt CountResources();
|
sl@0
|
758 |
//
|
sl@0
|
759 |
inline CDbsServer& Server() const;
|
sl@0
|
760 |
inline RDbsSources& Sources();
|
sl@0
|
761 |
//
|
sl@0
|
762 |
const TDesC& ReadName0L(TInt aIndex,const RMessage2& aMessage);
|
sl@0
|
763 |
const TDesC& ReadName1L(TInt aIndex,const RMessage2& aMessage);
|
sl@0
|
764 |
const TDesC& ReadFileNameL(TInt aIndex, const RMessage2& aMessage);
|
sl@0
|
765 |
HBufC* ReadHBufLC(TInt aIndex,const RMessage2& aMessage);
|
sl@0
|
766 |
HBufC8* ReadHBuf8LC(TInt aIndex,const RMessage2& aMessage);
|
sl@0
|
767 |
CDbColSet* ColSetLC(TInt aIndex,const RMessage2& aMessage);
|
sl@0
|
768 |
CDbKey* KeyLC(TInt aIndex,const RMessage2& aMessage);
|
sl@0
|
769 |
TDbLookupKey* LookupKeyLC(TInt aIndex,TInt aSize,const RMessage2& aMessage);
|
sl@0
|
770 |
CDbObject* DoAuthenticateL(CDbsConnection* aDbsConnection, const RMessage2& aMessage);
|
sl@0
|
771 |
TInt DoOpenDatabaseL(const RMessage2& aMessage, const TDbProps& aDbProps);
|
sl@0
|
772 |
|
sl@0
|
773 |
TDbProps* ExtractDbPropsLC(const RMessage2& aMessage);
|
sl@0
|
774 |
TInt OpenDatabaseL(const RMessage2& aMessage);
|
sl@0
|
775 |
TInt CreateDatabaseL(const RMessage2& aMessage);
|
sl@0
|
776 |
TInt DoCreateDatabaseL(const RMessage2& aMessage, const TDbProps& aDbProps);
|
sl@0
|
777 |
void CopyDatabaseL(const RMessage2& aMessage);
|
sl@0
|
778 |
void DeleteDatabaseL(const RMessage2& aMessage);
|
sl@0
|
779 |
TInt GetDatabaseListL(const RMessage2& aMessage);
|
sl@0
|
780 |
void GetSecurityPolicyL(const RMessage2& aMessage);
|
sl@0
|
781 |
void ReadRowL(RDbRow& aRow,TInt aSize,const RMessage2& aMessage);
|
sl@0
|
782 |
void PutRowL(CDbCursor& aCursor,const RMessage2& aMessage);
|
sl@0
|
783 |
TInt WriteRowL(const RDbRow& aRow,const RMessage2& aMessage);
|
sl@0
|
784 |
TInt RetrieveRowL(CDbCursor& aCursor,const RMessage2& aMessage);
|
sl@0
|
785 |
TInt NewCursorL(CDbCursor* aCursor,const RMessage2& aMessage,const MPolicy* aTblSecurityPolicy);
|
sl@0
|
786 |
TInt NewIncrementalL(CDbIncremental* aCursor,TInt& aInit,const RMessage2& aMessage,const MPolicy* aPolicy);
|
sl@0
|
787 |
TInt NewStreamL(MStreamBuf* aHost,const RMessage2& aMessage,const MPolicy* aPolicy,TInt aExtent=-1);
|
sl@0
|
788 |
TInt NewStreamL(TAny* aPtr,TExternalizeFunction aExter,const RMessage2& aMessage,const MPolicy* aPolicy);
|
sl@0
|
789 |
void NewDbEntryL(CDbObject* aDbObject, const TDbPolicyRequest& aDbPolicyRequest, TInt& aDbHandle);
|
sl@0
|
790 |
|
sl@0
|
791 |
#ifdef __DBDUMP__
|
sl@0
|
792 |
void Dump();
|
sl@0
|
793 |
#endif
|
sl@0
|
794 |
|
sl@0
|
795 |
void ReserveDriveSpaceL(TDriveNumber aDrive);
|
sl@0
|
796 |
void FreeReservedSpace(TDriveNumber aDrive);
|
sl@0
|
797 |
void GetReserveAccessL(TDriveNumber aDrive);
|
sl@0
|
798 |
void ReleaseReserveAccess(TDriveNumber aDrive);
|
sl@0
|
799 |
|
sl@0
|
800 |
void GetBackupPathL(const RMessage2& aMessage);
|
sl@0
|
801 |
TInt GetBackupPathsL(const RMessage2& aMessage);
|
sl@0
|
802 |
|
sl@0
|
803 |
inline TInt Add(CDbIncremental* aIncremental, const MPolicy* aPolicy);
|
sl@0
|
804 |
inline TInt Add(CDbCursor* aCursor, const MPolicy* aPolicy);
|
sl@0
|
805 |
inline TInt Add(CDbRowConstraint* aConstraint, const MPolicy* aPolicy);
|
sl@0
|
806 |
inline TInt Add(HDbsStream* aStream, const MPolicy* aPolicy);
|
sl@0
|
807 |
inline TInt Add(CDbsObserver::HObserver* aObserver, const MPolicy* aPolicy);
|
sl@0
|
808 |
|
sl@0
|
809 |
TEntry& Object(TInt aHandle);
|
sl@0
|
810 |
void AllocL();
|
sl@0
|
811 |
TInt DoAdd(TAny* aObject,TDbsType aType, const MPolicy* aPolicy);
|
sl@0
|
812 |
void Free(TEntry& aEntry);
|
sl@0
|
813 |
|
sl@0
|
814 |
private:
|
sl@0
|
815 |
TEntry* iIx;
|
sl@0
|
816 |
TInt iSize;
|
sl@0
|
817 |
TInt iFree;
|
sl@0
|
818 |
RMap<TInt, TDbPolicyRequest> iDbPolicyRqColl;
|
sl@0
|
819 |
CDbsSessDriveSpace* iSessDriveSpace;
|
sl@0
|
820 |
};
|
sl@0
|
821 |
|
sl@0
|
822 |
/**
|
sl@0
|
823 |
@internalComponent
|
sl@0
|
824 |
*/
|
sl@0
|
825 |
class HDbsStream
|
sl@0
|
826 |
{
|
sl@0
|
827 |
public:
|
sl@0
|
828 |
inline HDbsStream(MStreamBuf* aHost,TInt aReadPos);
|
sl@0
|
829 |
inline ~HDbsStream();
|
sl@0
|
830 |
//
|
sl@0
|
831 |
TInt ReadL(const RMessage2& aMessage);
|
sl@0
|
832 |
void WriteL(const RMessage2& aMessage);
|
sl@0
|
833 |
inline TInt SizeL();
|
sl@0
|
834 |
inline void SynchL();
|
sl@0
|
835 |
private:
|
sl@0
|
836 |
MStreamBuf& iHost;
|
sl@0
|
837 |
TInt iRPos;
|
sl@0
|
838 |
TInt iWPos;
|
sl@0
|
839 |
};
|
sl@0
|
840 |
|
sl@0
|
841 |
/**
|
sl@0
|
842 |
@internalComponent
|
sl@0
|
843 |
*/
|
sl@0
|
844 |
NONSHARABLE_CLASS(HBufBuf) : public TBufBuf
|
sl@0
|
845 |
{
|
sl@0
|
846 |
enum {EGranularity=512};
|
sl@0
|
847 |
public:
|
sl@0
|
848 |
static HBufBuf* NewLC();
|
sl@0
|
849 |
private:
|
sl@0
|
850 |
inline HBufBuf();
|
sl@0
|
851 |
virtual inline ~HBufBuf();
|
sl@0
|
852 |
void DoRelease();
|
sl@0
|
853 |
private:
|
sl@0
|
854 |
CBufBase* iBuf;
|
sl@0
|
855 |
};
|
sl@0
|
856 |
|
sl@0
|
857 |
#include "SD_STD.INL"
|
sl@0
|
858 |
|
sl@0
|
859 |
|
sl@0
|
860 |
|