Update contrib.
1 // Copyright (c) 2005-2010 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.
16 #ifndef __SQLSRVSECURITYMAP_H__
17 #define __SQLSRVSECURITYMAP_H__
19 #include "SqlMap.h" //RSqlMap
21 //Forward declarations
22 class CSqlSecurityPolicy;
24 /////////////////////////////////////////////////////////////////////////////////////////////////////////
25 // {Secure database name : Security policy} map declarations
26 // "Secure database name" is UTF8 encoded, zero-terminated.
28 // "Secure database name" == <DRIVE:><NAME>[.EXT]
29 /////////////////////////////////////////////////////////////////////////////////////////////////////////
32 {const TUint8*, const CSqlSecurityPolicy*} pair destructor.
33 Used as a template argument (DESTRUCTOR) in RSqlMap class.
41 NONSHARABLE_STRUCT(TSqlSecurityDestructor)
43 void Destroy(const TUint8*& aKey, const CSqlSecurityPolicy*& aData);
47 {const TUint8*, const CSqlSecurityPolicy*} pair reference counter.
48 Used as a template argument (REFCNTR) in RSqlMap class.
56 NONSHARABLE_STRUCT(TSqlSecurityRefCounter)
58 inline TSqlSecurityRefCounter() :
63 inline TInt Increment()
67 inline TInt Decrement()
75 //Typedefs for {const TUint8*, const CSqlSecurityPolicy*} map.
76 typedef struct TSqlPair<const TUint8*, const CSqlSecurityPolicy*, TSqlSecurityRefCounter> TSqlSecurityPair;
77 typedef class TLinearOrder<TSqlSecurityPair> TSqlSecurityLinearOrder;
78 typedef class RSqlMap<const TUint8*, const CSqlSecurityPolicy*, TSqlSecurityRefCounter, TSqlSecurityDestructor> RSqlSecurityMap;
80 /////////////////////////////////////////////////////////////////////////////////////////////////////////
81 // {Attached database name : Secure database file name} map declarations
82 // "Attached database name" is UTF8 encoded, zero-terminated.
83 // "Secure database file name" is UTF8 encoded, zero-terminated. Format: <Drive:><FileName[.Ext]>
84 /////////////////////////////////////////////////////////////////////////////////////////////////////////
87 {const TUint8*, const TUint8*} pair destructor.
88 Used as a template argument (DESTRUCTOR) in RSqlMap class.
96 NONSHARABLE_STRUCT(TSqlAttachDbDestructor)
98 void Destroy(const TUint8*& aKey, const TUint8*& aData);
102 {const TUint8*, const TUint8*} pair reference counter.
103 Used as a template argument (REFCNTR) in RSqlMap class.
111 NONSHARABLE_STRUCT(TSqlAttachDbRefCounter)
113 inline TSqlAttachDbRefCounter()
117 inline TInt Increment()
121 inline TInt Decrement()
127 //Typedefs for {const TUint8*, const TUint8*} map.
128 typedef struct TSqlPair<const TUint8*, const TUint8*, TSqlAttachDbRefCounter> TSqlAttachDbPair;
129 typedef class TLinearOrder<TSqlAttachDbPair> TSqlAttachDbLinearOrder;
130 typedef class RSqlMap<const TUint8*, const TUint8*, TSqlAttachDbRefCounter, TSqlAttachDbDestructor> RSqlAttachDbMap;
132 /////////////////////////////////////////////////////////////////////////////////////////////////////////
133 // {Compact database name ("main" or attached db name) : Full database file name} map declarations
134 // "Compact database name" is UTF16 encoded.
135 // "Full database file name" is UTF16 encoded.
136 /////////////////////////////////////////////////////////////////////////////////////////////////////////
139 A reference counter for the TSqlCompactDbPair pair and RSqlCompactDbMap.
147 NONSHARABLE_STRUCT(TSqlCompactDbRefCounter)
149 inline TSqlCompactDbRefCounter()
153 inline TInt Increment()
157 inline TInt Decrement()
164 Destrucor for the TSqlCompactDbPair pair.
172 NONSHARABLE_STRUCT(TSqlCompactDbDestructor)
174 inline void Destroy(const HBufC*& aKey, const HBufC*& aData)
176 delete const_cast <HBufC*&> (aData);
177 delete const_cast <HBufC*&> (aKey);
181 //Typedefs for the {const HBufC*, const HBufC*} map.
182 typedef struct TSqlPair<const HBufC*, const HBufC*, TSqlCompactDbRefCounter> TSqlCompactDbPair;
183 typedef class TLinearOrder<TSqlCompactDbPair> TSqlCompactDbLinearOrder;
184 typedef class RSqlMap<const HBufC*, const HBufC*, TSqlCompactDbRefCounter, TSqlCompactDbDestructor> RSqlCompactDbMap;
185 typedef class TSqlMapIterator<const HBufC*, const HBufC*, TSqlCompactDbRefCounter, TSqlCompactDbDestructor> TSqlCompactDbMapIterator;
186 typedef TSqlMapIterator<const TUint8*, const TUint8*, TSqlAttachDbRefCounter, TSqlAttachDbDestructor> TSqlAttachDbMapIterator;
188 /////////////////////////////////////////////////////////////////////////////////////////////////////////
190 #endif//__SQLSRVSECURITYMAP_H__