os/ossrv/genericservices/httputils/Test/Integration/TestFileUriSuite/TestFileUriServer.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#ifndef __TEST__FILE_URI_SERVER_H__
sl@0
    17
#define __TEST__FILE_URI_SERVER_H__
sl@0
    18
sl@0
    19
// Epoc Include
sl@0
    20
// For accessing TEF classes 
sl@0
    21
#include <testexecuteserverbase.h>
sl@0
    22
sl@0
    23
/*@{*/
sl@0
    24
// Literal constants for INI file field-names
sl@0
    25
_LIT(KIniFileName, 			"filename"			);
sl@0
    26
_LIT(KIniFileUri, 			"fileuri"			);
sl@0
    27
_LIT(KIniExpectedFileName, 	"expectedfilename"	);
sl@0
    28
_LIT(KIniExpectedFileUri, 	"expectedfileuri"	);
sl@0
    29
_LIT(KIniFileType, 			"filetype"			);
sl@0
    30
_LIT(KIniCharacterSet, 		"characterset"		);
sl@0
    31
_LIT(KIniDrive, 			"drive"				);
sl@0
    32
/*@}*/
sl@0
    33
sl@0
    34
/*@{*/
sl@0
    35
// Literal constants used by some test steps
sl@0
    36
_LIT(KFileTypePrivate, 		"private"			);
sl@0
    37
_LIT(KFileTypePublic, 		"public"			);
sl@0
    38
_LIT(KExtMedia, 			"ext-media"			);
sl@0
    39
_LIT(KDrivePlaceHolder, 	"<drive>"			);
sl@0
    40
_LIT(KDriveSeparator, 		":"					);
sl@0
    41
_LIT(KBackSlash, 			"\\"				);
sl@0
    42
/*@}*/
sl@0
    43
sl@0
    44
// constants used
sl@0
    45
const TInt KCharSet8		= 8 ;
sl@0
    46
const TInt KCharSet16		= 16;
sl@0
    47
const TInt KLetterA 		= 97; 	// ASCII of 'a'
sl@0
    48
sl@0
    49
/**
sl@0
    50
The test server. 
sl@0
    51
@internalTechnology
sl@0
    52
*/
sl@0
    53
class CTestFileUriServer : public CTestServer
sl@0
    54
	{
sl@0
    55
public:
sl@0
    56
	// Construction
sl@0
    57
	static	CTestFileUriServer* 	NewL();
sl@0
    58
	
sl@0
    59
	// Base class pure virtual
sl@0
    60
	virtual CTestStep* 				CreateTestStep(const TDesC& aStepName);
sl@0
    61
	
sl@0
    62
	// Common static functions used by the test steps
sl@0
    63
	static	void 					GetDriveNumber(const TDesC& aDrive, TDriveNumber& aDriveNum);
sl@0
    64
	static 	TInt 					IsRemovableDrive(const TDriveNumber& aDrive, TBool& aResult);
sl@0
    65
	static	HBufC16*				CheckAndFillDriveNameL(const TPtrC& aFileUri, const TPtrC& aDrive);
sl@0
    66
	static	TInt 					FirstRemovableDriveWithSameFileName(const TDesC& aFileName, TBuf<1>& aCorrectDrive);
sl@0
    67
	
sl@0
    68
	static	TInt 					CreateFullyQualifiedName(const TPtrC& aRelativeName, const TPtrC& aDrive, TFileName& aFullyQualifiedName);
sl@0
    69
	
sl@0
    70
	private:
sl@0
    71
	// Private function
sl@0
    72
	static 	TInt 					PopulateRemovableDrivesBuf(const RFs& aFs);
sl@0
    73
	
sl@0
    74
	private:
sl@0
    75
	// To idebtify the removable drive letters
sl@0
    76
	static TBuf<KMaxDrives> 		iRemovableDrives;
sl@0
    77
	};
sl@0
    78
sl@0
    79
#endif		// __TEST__FILE_URI_SERVER_H__
sl@0
    80