os/ossrv/genericservices/httputils/Test/Integration/TestFileUriSuite/TestFileUriServer.h
First public contribution.
1 // Copyright (c) 2004-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __TEST__FILE_URI_SERVER_H__
17 #define __TEST__FILE_URI_SERVER_H__
20 // For accessing TEF classes
21 #include <testexecuteserverbase.h>
24 // Literal constants for INI file field-names
25 _LIT(KIniFileName, "filename" );
26 _LIT(KIniFileUri, "fileuri" );
27 _LIT(KIniExpectedFileName, "expectedfilename" );
28 _LIT(KIniExpectedFileUri, "expectedfileuri" );
29 _LIT(KIniFileType, "filetype" );
30 _LIT(KIniCharacterSet, "characterset" );
31 _LIT(KIniDrive, "drive" );
35 // Literal constants used by some test steps
36 _LIT(KFileTypePrivate, "private" );
37 _LIT(KFileTypePublic, "public" );
38 _LIT(KExtMedia, "ext-media" );
39 _LIT(KDrivePlaceHolder, "<drive>" );
40 _LIT(KDriveSeparator, ":" );
41 _LIT(KBackSlash, "\\" );
45 const TInt KCharSet8 = 8 ;
46 const TInt KCharSet16 = 16;
47 const TInt KLetterA = 97; // ASCII of 'a'
53 class CTestFileUriServer : public CTestServer
57 static CTestFileUriServer* NewL();
59 // Base class pure virtual
60 virtual CTestStep* CreateTestStep(const TDesC& aStepName);
62 // Common static functions used by the test steps
63 static void GetDriveNumber(const TDesC& aDrive, TDriveNumber& aDriveNum);
64 static TInt IsRemovableDrive(const TDriveNumber& aDrive, TBool& aResult);
65 static HBufC16* CheckAndFillDriveNameL(const TPtrC& aFileUri, const TPtrC& aDrive);
66 static TInt FirstRemovableDriveWithSameFileName(const TDesC& aFileName, TBuf<1>& aCorrectDrive);
68 static TInt CreateFullyQualifiedName(const TPtrC& aRelativeName, const TPtrC& aDrive, TFileName& aFullyQualifiedName);
72 static TInt PopulateRemovableDrivesBuf(const RFs& aFs);
75 // To idebtify the removable drive letters
76 static TBuf<KMaxDrives> iRemovableDrives;
79 #endif // __TEST__FILE_URI_SERVER_H__