|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: FileTestUtils |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef FILETESTUTILS_H |
|
20 #define FILETESTUTILS_H |
|
21 |
|
22 #include <string> |
|
23 #include <fcntl.h> |
|
24 #include <unistd.h> |
|
25 #include <wchar.h> |
|
26 #include <stdio.h> |
|
27 #include <stdlib.h> |
|
28 |
|
29 namespace java |
|
30 { |
|
31 namespace filetest |
|
32 { |
|
33 |
|
34 using namespace std; |
|
35 class FileTestUtils |
|
36 { |
|
37 public: |
|
38 //File Operations |
|
39 static void createReadOnlyFile(const wstring& aPath); |
|
40 static void createWriteOnlyFile(const wstring& aPath); |
|
41 static void createNormalFile(const wstring& aPath); |
|
42 static void createFile(const wstring &aPath, const int aFlags, int aMode=0); |
|
43 static void createHiddenFile(const wstring &aPath, const wstring &aFile); |
|
44 static void createSystemFile(const wstring &aPath); |
|
45 static void setFileHidden(const wstring &aPath, const wstring &aFile); |
|
46 static void setFileReadOnly(const wstring &aPath); |
|
47 |
|
48 //Directory Operations |
|
49 static void createDirMode(const wstring &aPath, const int mode); |
|
50 static void createDir(const wstring &aPath); |
|
51 static void createHiddenDir(const wstring &aPath, const wstring& aDirName); |
|
52 static void createSystemDir(const wstring &aPath); |
|
53 static void createReadOnlyDir(const wstring &aPath); |
|
54 static void setDirHidden(const wstring &aPath, const wstring &aName); |
|
55 |
|
56 static void appendDataToFile(const wstring &aPath, const int aData); |
|
57 static void appendDataToFile(const wstring &aPath, const wstring& aData); |
|
58 static void writeDataToFile(const wstring &aPath, const string &aData); |
|
59 static void checkError(const wstring &aString, const int aErr); |
|
60 |
|
61 static void writeDataInLoop(const wstring &aPath, const int aData, const int aTimes); |
|
62 static void doInitDRMContents(); |
|
63 }; |
|
64 |
|
65 } //end namespace filetest |
|
66 } //end namespace java |
|
67 |
|
68 #endif // FILETESTUTILS_H |