|
1 /* |
|
2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: array for storing dataproviders and datastores. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <s32std.h> |
|
21 #include <nsmldebug.h> |
|
22 |
|
23 #include "nsmldshostconstants.h" |
|
24 #include "Nsmldsdataproviderarray.h" |
|
25 |
|
26 #ifdef __HOST_SERVER_MTEST__ |
|
27 #include "../../stif/DSHostServerTest/inc/fakedataprovider.h" |
|
28 #else |
|
29 #include <SmlDataProvider.h> |
|
30 #endif |
|
31 |
|
32 // ======================================= MEMBER FUNCTIONS ======================================= |
|
33 |
|
34 // ------------------------------------------------------------------------------------------------ |
|
35 // TNSmlDSDataStoreElement::FreeBatchItemArray |
|
36 // ------------------------------------------------------------------------------------------------ |
|
37 void TNSmlDSDataStoreElement::FreeBatchItemArray() |
|
38 { |
|
39 if ( iBatchItemUids ) |
|
40 { |
|
41 iBatchItemUids->ResetAndDestroy(); |
|
42 delete iBatchItemUids; |
|
43 iBatchItemUids = NULL; |
|
44 } |
|
45 } |
|
46 |
|
47 // ------------------------------------------------------------------------------------------------ |
|
48 // TNSmlDSDataStoreElement::IsOpen |
|
49 // ------------------------------------------------------------------------------------------------ |
|
50 TBool TNSmlDSDataStoreElement::IsOpen() const |
|
51 { |
|
52 return ( iStoreName == NULL ); |
|
53 } |
|
54 |
|
55 // ------------------------------------------------------------------------------------------------ |
|
56 // TNSmlDSDataStoreElement::SetOpened |
|
57 // ------------------------------------------------------------------------------------------------ |
|
58 void TNSmlDSDataStoreElement::SetOpened() |
|
59 { |
|
60 delete iStoreName; |
|
61 iStoreName = NULL; |
|
62 } |
|
63 |
|
64 // ------------------------------------------------------------------------------------------------ |
|
65 // TNSmlDSDataStoreElement::StoreName |
|
66 // ------------------------------------------------------------------------------------------------ |
|
67 const TDesC& TNSmlDSDataStoreElement::StoreName() const |
|
68 { |
|
69 if ( iStoreName ) |
|
70 { |
|
71 return *iStoreName; |
|
72 } |
|
73 return iDataStore->StoreName(); |
|
74 } |
|
75 |
|
76 // ------------------------------------------------------------------------------------------------ |
|
77 // TNSmlDSDataStoreElement::setStoreFormat |
|
78 // ------------------------------------------------------------------------------------------------ |
|
79 void TNSmlDSDataStoreElement::setStoreFormat( CSmlDataStoreFormat* aDSFormat ) |
|
80 { |
|
81 delete iDSFormat; |
|
82 iDSFormat = aDSFormat; |
|
83 } |
|
84 |
|
85 // ------------------------------------------------------------------------------------------------ |
|
86 // TNSmlDSDataStoreElement::TNSmlDSDataStoreElement |
|
87 // ------------------------------------------------------------------------------------------------ |
|
88 TNSmlDSDataStoreElement::TNSmlDSDataStoreElement( const HBufC* aStoreName ) : iDSAO( NULL ), |
|
89 iDataStore( NULL ), iBatchItemUids( NULL ), iAdpLog( NULL ), iCreatedUid( 0 ), |
|
90 iHostMode( ENSmlNormalMode ), iStoreName( aStoreName ), iDSFormat( NULL ) |
|
91 { |
|
92 } |
|
93 |
|
94 // End of File |