|
1 /* |
|
2 * Copyright (c) 2007 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: WMDRM Server implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <e32math.h> |
|
20 #include <symmetric.h> |
|
21 #include <bacntf.h> |
|
22 |
|
23 #include "namespaceenumerator.h" |
|
24 #include "wmdrmserver.h" |
|
25 #include "wmdrmdb.h" |
|
26 |
|
27 #define _LOGGING_FILE L"wmdrmserver.txt" |
|
28 |
|
29 #include "flogger.h" |
|
30 #include "logfn.h" |
|
31 |
|
32 CNameSpaceEnumerator* CNameSpaceEnumerator::NewL( |
|
33 CWmDrmServer* aServer, |
|
34 const TDesC8& aStore, |
|
35 const TDesC8& aNameSpace ) |
|
36 { |
|
37 CNameSpaceEnumerator* self = new (ELeave) CNameSpaceEnumerator(); |
|
38 CleanupStack::PushL( self ); |
|
39 self->ConstructL( aServer, aStore, aNameSpace ); |
|
40 CleanupStack::Pop( self ); |
|
41 return self; |
|
42 } |
|
43 |
|
44 void CNameSpaceEnumerator::ConstructL( |
|
45 CWmDrmServer* aServer, |
|
46 const TDesC8& aStore, |
|
47 const TDesC8& aNameSpace ) |
|
48 { |
|
49 LOGFN( "CNameSpaceEnumerator::ConstructL" ); |
|
50 iServer = aServer; |
|
51 iStore.Copy( aStore ); |
|
52 iNamespace.Copy( aNameSpace ); |
|
53 LOG( iNamespace ); |
|
54 iServer->Db()->EnumerateNameSpaceStartL( iStore, iNamespace ); |
|
55 } |
|
56 |
|
57 TInt CNameSpaceEnumerator::NextL() |
|
58 { |
|
59 TInt r = KErrNone; |
|
60 LOGFN( "CNameSpaceEnumerator::Next"); |
|
61 iServer->Db()->EnumerateNameSpaceNextL( iHashKey, iUniqueKey ); |
|
62 LOG3( "Saved slot info %S, %S", &iHashKey, &iUniqueKey ); |
|
63 return r; |
|
64 } |