os/security/cryptomgmtlibs/securitytestfw/test/testhandler2extra/t_inputextra.cpp
Update contrib.
2 * Copyright (c) 1998-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.
19 #include "t_inputextra.h"
22 EXPORT_C HBufC8* InputExtra::ReadFilesLC(CDesCArray& aFilenames, RFs& aFs)
24 TInt count = aFilenames.MdcaCount();
27 for (i = 0; i < count; i++)
30 User::LeaveIfError(file.Open(aFs, aFilenames.MdcaPoint(i), EFileRead));
31 CleanupClosePushL(file);
34 CleanupStack::PopAndDestroy(2);// fileClose
37 HBufC8* res = HBufC8::NewLC(totalSize);
38 TPtr8 pRes = res->Des();
39 for (i = 0; i < count; i++)
41 HBufC8* cert = Input::ReadFileLC(aFilenames.MdcaPoint(i), aFs);
42 pRes.Append(cert->Des());
43 CleanupStack::PopAndDestroy();//cert
48 EXPORT_C HBufC8* InputExtra::ReadFilesLC(CDesCArray& aFilenames, const TDesC& aPath, RFs& aFs)
50 TInt count = aFilenames.MdcaCount();
53 for (i = 0; i < count; i++)
55 HBufC* filenameBuf = HBufC::NewLC(256);
56 TPtr fullFilename = filenameBuf->Des();
57 fullFilename.Append(aPath);
58 TPtrC filename = aFilenames.MdcaPoint(i);
59 fullFilename.Append(filename);
62 User::LeaveIfError(file.Open(aFs, fullFilename, EFileRead));
63 CleanupClosePushL(file);
66 CleanupStack::PopAndDestroy(2);//filenameBuf, fileClose
69 HBufC8* res = HBufC8::NewLC(totalSize);
70 TPtr8 pRes = res->Des();
71 for (i = 0; i < count; i++)
73 HBufC8* cert = Input::ReadFileLC(aFilenames.MdcaPoint(i), aPath, aFs);
74 pRes.Append(cert->Des());
75 CleanupStack::PopAndDestroy();//cert