os/security/cryptoservices/filebasedcertificateandkeystores/source/generic/server/FSResources.cpp
First public contribution.
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
20 #include "FSResources.h"
21 #include <fstokenserver.rsg>
23 _LIT(KResourceFile, "Z:\\RESOURCE\\FSTOKENSERVER.RSC");
25 CDesCArray* FSResources::iStrings;
27 /// If the resources aren't initialised, initialise them
28 void FSResources::InitialiseL()
34 User::LeaveIfError(fs.Connect());
37 fileName.Copy(KResourceFile);
39 CleanupClosePushL(fs);
40 BaflUtils::NearestLanguageFile(fs,fileName);
41 if (!BaflUtils::FileExists(fs,fileName))
43 User::Leave(KErrNotFound);
46 RResourceFile resourceFile;
47 resourceFile.OpenL(fs,fileName);
48 CleanupClosePushL(resourceFile);
49 resourceFile.ConfirmSignatureL(0);
50 resourceFile.Offset();
51 TResourceReader reader;
52 HBufC8* resource = resourceFile.AllocReadLC(R_FSSERVER_STRINGS);
53 reader.SetBuffer(resource);
55 iStrings = reader.ReadDesCArrayL();
58 CleanupStack::PopAndDestroy(3); // Close reader, file and fs
61 /// Free all resources.
62 void FSResources::Cleanup()
68 /// Returns an array of strings. The strings are identified by
70 const RCPointerArray<HBufC>& Strings();