OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_PLATFORM_FILE_H_ | 5 #ifndef BASE_PLATFORM_FILE_H_ |
6 #define BASE_PLATFORM_FILE_H_ | 6 #define BASE_PLATFORM_FILE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 enum PlatformFileError { | 44 enum PlatformFileError { |
45 PLATFORM_FILE_OK = 0, | 45 PLATFORM_FILE_OK = 0, |
46 PLATFORM_FILE_ERROR_FAILED = -1, | 46 PLATFORM_FILE_ERROR_FAILED = -1, |
47 PLATFORM_FILE_ERROR_IN_USE = -2, | 47 PLATFORM_FILE_ERROR_IN_USE = -2, |
48 PLATFORM_FILE_ERROR_EXISTS = -3, | 48 PLATFORM_FILE_ERROR_EXISTS = -3, |
49 PLATFORM_FILE_ERROR_NOT_FOUND = -4, | 49 PLATFORM_FILE_ERROR_NOT_FOUND = -4, |
50 PLATFORM_FILE_ERROR_ACCESS_DENIED = -5, | 50 PLATFORM_FILE_ERROR_ACCESS_DENIED = -5, |
51 PLATFORM_FILE_ERROR_TOO_MANY_OPENED = -6, | 51 PLATFORM_FILE_ERROR_TOO_MANY_OPENED = -6, |
52 PLATFORM_FILE_ERROR_NO_MEMORY = -7, | 52 PLATFORM_FILE_ERROR_NO_MEMORY = -7, |
53 PLATFORM_FILE_ERROR_NO_SPACE = -7, | 53 PLATFORM_FILE_ERROR_NO_SPACE = -8, |
54 PLATFORM_FILE_ERROR_NOT_A_DIRECTORY = -9 | 54 PLATFORM_FILE_ERROR_NOT_A_DIRECTORY = -9, |
| 55 PLATFORM_FILE_ERROR_INVALID_OPERATION = -10 |
55 }; | 56 }; |
56 | 57 |
57 // Creates or opens the given file. If PLATFORM_FILE_OPEN_ALWAYS is used, and | 58 // Creates or opens the given file. If PLATFORM_FILE_OPEN_ALWAYS is used, and |
58 // |created| is provided, |created| will be set to true if the file was created | 59 // |created| is provided, |created| will be set to true if the file was created |
59 // or to false in case the file was just opened. |error_code| can be NULL. | 60 // or to false in case the file was just opened. |error_code| can be NULL. |
60 PlatformFile CreatePlatformFile(const FilePath& name, | 61 PlatformFile CreatePlatformFile(const FilePath& name, |
61 int flags, | 62 int flags, |
62 bool* created, | 63 bool* created, |
63 PlatformFileError* error_code); | 64 PlatformFileError* error_code); |
64 // Deprecated. | 65 // Deprecated. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 return temp; | 104 return temp; |
104 } | 105 } |
105 | 106 |
106 private: | 107 private: |
107 PlatformFile* value_; | 108 PlatformFile* value_; |
108 }; | 109 }; |
109 | 110 |
110 } // namespace base | 111 } // namespace base |
111 | 112 |
112 #endif // BASE_PLATFORM_FILE_H_ | 113 #endif // BASE_PLATFORM_FILE_H_ |
OLD | NEW |