|
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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "US_STD.H" |
|
17 |
|
18 /** |
|
19 Creates a new non-secure, non-shareable database, which will be located in a stream store. |
|
20 |
|
21 Note: RDbNamedDatabase should always be the preferred choice, except the following two cases: |
|
22 @code |
|
23 - your intention is to create, fill and then compress a database, which will be used only in a read-only mode; |
|
24 - your intention is to create a database in a stream store, which stream store will be used for storing |
|
25 some additional, non-database data; |
|
26 @endcode |
|
27 |
|
28 @param aStore The stream store object, where the database will be created. |
|
29 |
|
30 @leave System-wide or database specific error codes. |
|
31 |
|
32 @return The id of the root stream of the created database. |
|
33 |
|
34 @see RDbNamedDatabase |
|
35 |
|
36 @publishedAll |
|
37 @released |
|
38 */ |
|
39 EXPORT_C TStreamId RDbStoreDatabase::CreateL(CStreamStore* aStore) |
|
40 { |
|
41 TStreamId id; |
|
42 iDatabase=CDbStoreDatabase::CreateL(aStore,id); |
|
43 return id; |
|
44 } |
|
45 |
|
46 /** |
|
47 Opens an existing non-secure, non-shareable database, which is located in a stream store. |
|
48 |
|
49 Note: RDbNamedDatabase should always be the preferred choice, except the following two cases: |
|
50 @code |
|
51 - your intention is to create, fill and then compress a database, which will be used only in a read-only mode; |
|
52 - your intention is to create a database in a stream store, which stream store will be used for storing |
|
53 some additional, non-database data; |
|
54 @endcode |
|
55 |
|
56 @param aStore The stream store object, where the database is located. |
|
57 @param aId The id of the root stream of the database. |
|
58 |
|
59 @leave System-wide or database specific error codes. |
|
60 |
|
61 @see RDbStoreDatabase::CreateL(CStreamStore* aStore) |
|
62 @see RDbNamedDatabase |
|
63 |
|
64 @publishedAll |
|
65 @released |
|
66 */ |
|
67 EXPORT_C void RDbStoreDatabase::OpenL(CStreamStore* aStore,TStreamId aId) |
|
68 { |
|
69 CDbSource* source=CDbStoreDatabase::OpenL(aStore,aId); |
|
70 CleanupStack::PushL(source); |
|
71 iDatabase=source->OpenL(); |
|
72 CleanupStack::PopAndDestroy(source); |
|
73 } |