| 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 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 PLATFORM_FILE_CREATE = 2, | 27 PLATFORM_FILE_CREATE = 2, |
| 28 PLATFORM_FILE_OPEN_ALWAYS = 4, // May create a new file. | 28 PLATFORM_FILE_OPEN_ALWAYS = 4, // May create a new file. |
| 29 PLATFORM_FILE_CREATE_ALWAYS = 8, // May overwrite an old file. | 29 PLATFORM_FILE_CREATE_ALWAYS = 8, // May overwrite an old file. |
| 30 PLATFORM_FILE_READ = 16, | 30 PLATFORM_FILE_READ = 16, |
| 31 PLATFORM_FILE_WRITE = 32, | 31 PLATFORM_FILE_WRITE = 32, |
| 32 PLATFORM_FILE_EXCLUSIVE_READ = 64, // EXCLUSIVE is opposite of Windows SHARE | 32 PLATFORM_FILE_EXCLUSIVE_READ = 64, // EXCLUSIVE is opposite of Windows SHARE |
| 33 PLATFORM_FILE_EXCLUSIVE_WRITE = 128, | 33 PLATFORM_FILE_EXCLUSIVE_WRITE = 128, |
| 34 PLATFORM_FILE_ASYNC = 256, | 34 PLATFORM_FILE_ASYNC = 256, |
| 35 PLATFORM_FILE_TEMPORARY = 512, // Used on Windows only | 35 PLATFORM_FILE_TEMPORARY = 512, // Used on Windows only |
| 36 PLATFORM_FILE_HIDDEN = 1024, // Used on Windows only | 36 PLATFORM_FILE_HIDDEN = 1024, // Used on Windows only |
| 37 PLATFORM_FILE_DELETE_ON_CLOSE = 2048 // Used on Windows only | 37 PLATFORM_FILE_DELETE_ON_CLOSE = 2048 |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 // Creates or open the given file. If PLATFORM_FILE_OPEN_ALWAYS is used, and | 40 // Creates or opens the given file. If PLATFORM_FILE_OPEN_ALWAYS is used, and |
| 41 // |created| is provided, |created| will be set to true if the file was created | 41 // |created| is provided, |created| will be set to true if the file was created |
| 42 // or to false in case the file was just opened. | 42 // or to false in case the file was just opened. |
| 43 PlatformFile CreatePlatformFile(const std::wstring& name, | 43 PlatformFile CreatePlatformFile(const std::wstring& name, |
| 44 int flags, | 44 int flags, |
| 45 bool* created); | 45 bool* created); |
| 46 | 46 |
| 47 // Closes a file handle |
| 48 bool ClosePlatformFile(PlatformFile file); |
| 49 |
| 47 } // namespace base | 50 } // namespace base |
| 48 | 51 |
| 49 #endif // BASE_PLATFORM_FILE_H_ | 52 #endif // BASE_PLATFORM_FILE_H_ |
| OLD | NEW |