Update contrib.
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.
15 * TestUtil - client interface
26 #ifndef __TESTUTILCLIENT_H__
27 #define __TESTUTILCLIENT_H__
32 class RTestUtilSession : public RSessionBase
35 IMPORT_C TInt Connect();
36 IMPORT_C TInt Copy(const TDesC& aSourceFile, const TDesC& aDestinationFile);
37 IMPORT_C TInt Move(const TDesC& aSourceFile, const TDesC& aDestinationFile);
38 IMPORT_C TInt Delete(const TDesC& aFileName);
39 IMPORT_C TInt MkDirAll(const TDesC& aFileName);
40 IMPORT_C TInt RmDir(const TDesC& aFileName);
41 IMPORT_C TBool FileExistsL(const TDesC& aFileName);
42 IMPORT_C TBool FileExistsL(const TDesC& aFileName, TInt aMsecTimeout);
45 * Format the specified drive
47 * If the drive is NOT mounted the format will fail with error -18 KErrNotReady
49 * nb. Formating a drive looks like an MMC insertion to the SWI
50 * daemon (it does NOT look like a remove followed by an insert).
52 IMPORT_C TInt FormatDrive(TInt aDrive, TBool aFormatFatTableOnly = EFalse);
54 * Mount the specified drive
56 * Mounting an already mounted drive fails with error -21 KErrAccessDenied
58 * Mounting an unmounted drive looks exactly like a MMC card
59 * insertion to the SWI daemon.
61 * [The SWI daemon detects MMC insertion by registering with the
62 * FS server using NotifyChange(ENotifyEntry,,) for a non-existent
63 * file on the drive being watched. It then checks if it can read
64 * the Volume info to decide if media has been inserted or
67 IMPORT_C TInt MountDrive(TInt aDrive);
69 * UnMount the specified drive
71 * Un-mounting an already un-mounted drive fails with error -18 KErrNotReady
73 * Unmounting an mounted drive looks exactly like a MMC card
74 * removal to the SWI daemon.
76 * Will fail if there are any open file descriptors on the drive.
78 IMPORT_C TInt UnMountDrive(TInt aDrive);
80 IMPORT_C TInt Lock(const TDesC& aFileName);
81 IMPORT_C TInt Unlock(const TDesC& aFileName);
84 * Set or clear the read only attribute for the specified file.
85 * Set the attribut if aSetReadOnly is non-zero, clear otherwise.
87 IMPORT_C TInt SetReadOnly(const TDesC& aFileName, TInt aSetReadOnly = 1);
90 * Get a file handle opened for reading for the specified filename - used
91 * to access files in private directories.
93 IMPORT_C TInt GetFileHandle(const TDesC& aFileName, RFile &aRFile);
97 * Proxy file change notify request (RFS::NotifyChange needs AllFiles)
100 IMPORT_C void WatchFile(const TDesC& aFileName, TRequestStatus& aStatus);
104 * Cancel outstanding file watch request.
107 IMPORT_C void WatchFileCancelL();
109 IMPORT_C TInt GetNumFilesL(const TDesC& aDirName);
113 * Set the Secure clock time.This call requires
114 * TCB and WriteDeviceData Capability.
116 * @param aTimeOffset The secure clock time is
117 * incremented by this value.
120 IMPORT_C TInt SetSecureClock (TInt aTimeOffset);