| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 module filesystem; | 5 module filesystem; |
| 6 | 6 |
| 7 // Error codes used by the file system. These error codes line up exactly with | 7 // Error codes used by the file system. These error codes line up exactly with |
| 8 // those of base::File. | 8 // those of base::File. |
| 9 enum FileError { | 9 enum FileError { |
| 10 OK = 0, | 10 OK = 0, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 const uint32 kFlagCreate = 0x2; | 70 const uint32 kFlagCreate = 0x2; |
| 71 // May create a new file. | 71 // May create a new file. |
| 72 const uint32 kFlagOpenAlways = 0x4; | 72 const uint32 kFlagOpenAlways = 0x4; |
| 73 // May overwrite an old file. | 73 // May overwrite an old file. |
| 74 const uint32 kCreateAlways = 0x8; | 74 const uint32 kCreateAlways = 0x8; |
| 75 // Opens a file and truncates it, only if it exists. | 75 // Opens a file and truncates it, only if it exists. |
| 76 const uint32 kFlagOpenTruncated = 0x10; | 76 const uint32 kFlagOpenTruncated = 0x10; |
| 77 const uint32 kFlagRead = 0x20; | 77 const uint32 kFlagRead = 0x20; |
| 78 const uint32 kFlagWrite = 0x40; | 78 const uint32 kFlagWrite = 0x40; |
| 79 const uint32 kFlagAppend = 0x80; | 79 const uint32 kFlagAppend = 0x80; |
| 80 // Deletes the file when closed. |
| 81 const uint32 kDeleteOnClose = 0x2000; |
| 80 | 82 |
| 81 // File types. | 83 // File types. |
| 82 // | 84 // |
| 83 // Note: This is named FsFileType because otherwise we have a name collision | 85 // Note: This is named FsFileType because otherwise we have a name collision |
| 84 // with windows.h. | 86 // with windows.h. |
| 85 enum FsFileType { | 87 enum FsFileType { |
| 86 UNKNOWN = 0, | 88 UNKNOWN = 0, |
| 87 REGULAR_FILE, | 89 REGULAR_FILE, |
| 88 DIRECTORY, | 90 DIRECTORY, |
| 89 }; | 91 }; |
| 90 | 92 |
| 91 // Describes a directory entry (i.e., a single member of a directory). | 93 // Describes a directory entry (i.e., a single member of a directory). |
| 92 struct DirectoryEntry { | 94 struct DirectoryEntry { |
| 93 FsFileType type; | 95 FsFileType type; |
| 94 string name; | 96 string name; |
| 95 }; | 97 }; |
| 96 | 98 |
| 97 // Deletion flags: | 99 // Deletion flags: |
| 98 // Recursively delete. | 100 // Recursively delete. |
| 99 const uint32 kDeleteFlagRecursive = 0x1; | 101 const uint32 kDeleteFlagRecursive = 0x1; |
| OLD | NEW |