sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
* TestUtil - client interface
|
sl@0
|
16 |
*
|
sl@0
|
17 |
*/
|
sl@0
|
18 |
|
sl@0
|
19 |
|
sl@0
|
20 |
/**
|
sl@0
|
21 |
@file
|
sl@0
|
22 |
@test
|
sl@0
|
23 |
@internalComponent
|
sl@0
|
24 |
*/
|
sl@0
|
25 |
|
sl@0
|
26 |
#ifndef __TESTUTILCLIENT_H__
|
sl@0
|
27 |
#define __TESTUTILCLIENT_H__
|
sl@0
|
28 |
|
sl@0
|
29 |
#include <e32std.h>
|
sl@0
|
30 |
#include <f32file.h>
|
sl@0
|
31 |
|
sl@0
|
32 |
class RTestUtilSession : public RSessionBase
|
sl@0
|
33 |
{
|
sl@0
|
34 |
public:
|
sl@0
|
35 |
IMPORT_C TInt Connect();
|
sl@0
|
36 |
IMPORT_C TInt Copy(const TDesC& aSourceFile, const TDesC& aDestinationFile);
|
sl@0
|
37 |
IMPORT_C TInt Move(const TDesC& aSourceFile, const TDesC& aDestinationFile);
|
sl@0
|
38 |
IMPORT_C TInt Delete(const TDesC& aFileName);
|
sl@0
|
39 |
IMPORT_C TInt MkDirAll(const TDesC& aFileName);
|
sl@0
|
40 |
IMPORT_C TInt RmDir(const TDesC& aFileName);
|
sl@0
|
41 |
IMPORT_C TBool FileExistsL(const TDesC& aFileName);
|
sl@0
|
42 |
IMPORT_C TBool FileExistsL(const TDesC& aFileName, TInt aMsecTimeout);
|
sl@0
|
43 |
|
sl@0
|
44 |
/**
|
sl@0
|
45 |
* Format the specified drive
|
sl@0
|
46 |
*
|
sl@0
|
47 |
* If the drive is NOT mounted the format will fail with error -18 KErrNotReady
|
sl@0
|
48 |
*
|
sl@0
|
49 |
* nb. Formating a drive looks like an MMC insertion to the SWI
|
sl@0
|
50 |
* daemon (it does NOT look like a remove followed by an insert).
|
sl@0
|
51 |
*/
|
sl@0
|
52 |
IMPORT_C TInt FormatDrive(TInt aDrive, TBool aFormatFatTableOnly = EFalse);
|
sl@0
|
53 |
/**
|
sl@0
|
54 |
* Mount the specified drive
|
sl@0
|
55 |
*
|
sl@0
|
56 |
* Mounting an already mounted drive fails with error -21 KErrAccessDenied
|
sl@0
|
57 |
*
|
sl@0
|
58 |
* Mounting an unmounted drive looks exactly like a MMC card
|
sl@0
|
59 |
* insertion to the SWI daemon.
|
sl@0
|
60 |
*
|
sl@0
|
61 |
* [The SWI daemon detects MMC insertion by registering with the
|
sl@0
|
62 |
* FS server using NotifyChange(ENotifyEntry,,) for a non-existent
|
sl@0
|
63 |
* file on the drive being watched. It then checks if it can read
|
sl@0
|
64 |
* the Volume info to decide if media has been inserted or
|
sl@0
|
65 |
* removed.]
|
sl@0
|
66 |
*/
|
sl@0
|
67 |
IMPORT_C TInt MountDrive(TInt aDrive);
|
sl@0
|
68 |
/**
|
sl@0
|
69 |
* UnMount the specified drive
|
sl@0
|
70 |
*
|
sl@0
|
71 |
* Un-mounting an already un-mounted drive fails with error -18 KErrNotReady
|
sl@0
|
72 |
*
|
sl@0
|
73 |
* Unmounting an mounted drive looks exactly like a MMC card
|
sl@0
|
74 |
* removal to the SWI daemon.
|
sl@0
|
75 |
*
|
sl@0
|
76 |
* Will fail if there are any open file descriptors on the drive.
|
sl@0
|
77 |
*/
|
sl@0
|
78 |
IMPORT_C TInt UnMountDrive(TInt aDrive);
|
sl@0
|
79 |
|
sl@0
|
80 |
IMPORT_C TInt Lock(const TDesC& aFileName);
|
sl@0
|
81 |
IMPORT_C TInt Unlock(const TDesC& aFileName);
|
sl@0
|
82 |
|
sl@0
|
83 |
/**
|
sl@0
|
84 |
* Set or clear the read only attribute for the specified file.
|
sl@0
|
85 |
* Set the attribut if aSetReadOnly is non-zero, clear otherwise.
|
sl@0
|
86 |
*/
|
sl@0
|
87 |
IMPORT_C TInt SetReadOnly(const TDesC& aFileName, TInt aSetReadOnly = 1);
|
sl@0
|
88 |
|
sl@0
|
89 |
/**
|
sl@0
|
90 |
* Get a file handle opened for reading for the specified filename - used
|
sl@0
|
91 |
* to access files in private directories.
|
sl@0
|
92 |
*/
|
sl@0
|
93 |
IMPORT_C TInt GetFileHandle(const TDesC& aFileName, RFile &aRFile);
|
sl@0
|
94 |
|
sl@0
|
95 |
/**
|
sl@0
|
96 |
*
|
sl@0
|
97 |
* Proxy file change notify request (RFS::NotifyChange needs AllFiles)
|
sl@0
|
98 |
*
|
sl@0
|
99 |
*/
|
sl@0
|
100 |
IMPORT_C void WatchFile(const TDesC& aFileName, TRequestStatus& aStatus);
|
sl@0
|
101 |
|
sl@0
|
102 |
/**
|
sl@0
|
103 |
*
|
sl@0
|
104 |
* Cancel outstanding file watch request.
|
sl@0
|
105 |
*
|
sl@0
|
106 |
*/
|
sl@0
|
107 |
IMPORT_C void WatchFileCancelL();
|
sl@0
|
108 |
|
sl@0
|
109 |
IMPORT_C TInt GetNumFilesL(const TDesC& aDirName);
|
sl@0
|
110 |
|
sl@0
|
111 |
/**
|
sl@0
|
112 |
*
|
sl@0
|
113 |
* Set the Secure clock time.This call requires
|
sl@0
|
114 |
* TCB and WriteDeviceData Capability.
|
sl@0
|
115 |
*
|
sl@0
|
116 |
* @param aTimeOffset The secure clock time is
|
sl@0
|
117 |
* incremented by this value.
|
sl@0
|
118 |
*
|
sl@0
|
119 |
*/
|
sl@0
|
120 |
IMPORT_C TInt SetSecureClock (TInt aTimeOffset);
|
sl@0
|
121 |
};
|
sl@0
|
122 |
|
sl@0
|
123 |
#endif
|