| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BIN_FILE_H_ | 5 #ifndef BIN_FILE_H_ |
| 6 #define BIN_FILE_H_ | 6 #define BIN_FILE_H_ |
| 7 | 7 |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 kPipe = 1, | 58 kPipe = 1, |
| 59 kFile = 2, | 59 kFile = 2, |
| 60 kSocket = 3, | 60 kSocket = 3, |
| 61 kOther = 4 | 61 kOther = 4 |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 enum FileRequest { | 64 enum FileRequest { |
| 65 kExistsRequest = 0, | 65 kExistsRequest = 0, |
| 66 kCreateRequest = 1, | 66 kCreateRequest = 1, |
| 67 kDeleteRequest = 2, | 67 kDeleteRequest = 2, |
| 68 kOpenRequest = 3, | 68 kRenameRequest = 3, |
| 69 kFullPathRequest = 4, | 69 kOpenRequest = 4, |
| 70 kCloseRequest = 5, | 70 kFullPathRequest = 5, |
| 71 kPositionRequest = 6, | 71 kCloseRequest = 6, |
| 72 kSetPositionRequest = 7, | 72 kPositionRequest = 7, |
| 73 kTruncateRequest = 8, | 73 kSetPositionRequest = 8, |
| 74 kLengthRequest = 9, | 74 kTruncateRequest = 9, |
| 75 kLengthFromPathRequest = 10, | 75 kLengthRequest = 10, |
| 76 kLastModifiedRequest = 11, | 76 kLengthFromPathRequest = 11, |
| 77 kFlushRequest = 12, | 77 kLastModifiedRequest = 12, |
| 78 kReadByteRequest = 13, | 78 kFlushRequest = 13, |
| 79 kWriteByteRequest = 14, | 79 kReadByteRequest = 14, |
| 80 kReadRequest = 15, | 80 kWriteByteRequest = 15, |
| 81 kReadIntoRequest = 16, | 81 kReadRequest = 16, |
| 82 kWriteFromRequest = 17, | 82 kReadIntoRequest = 17, |
| 83 kCreateLinkRequest = 18, | 83 kWriteFromRequest = 18, |
| 84 kDeleteLinkRequest = 19, | 84 kCreateLinkRequest = 19, |
| 85 kLinkTargetRequest = 20, | 85 kDeleteLinkRequest = 20, |
| 86 kTypeRequest = 21, | 86 kLinkTargetRequest = 21, |
| 87 kIdenticalRequest = 22, | 87 kTypeRequest = 22, |
| 88 kStatRequest = 23 | 88 kIdenticalRequest = 23, |
| 89 kStatRequest = 24 |
| 89 }; | 90 }; |
| 90 | 91 |
| 91 enum FileStat { | 92 enum FileStat { |
| 92 // These match the constants in FileStat in file_system_entity.dart. | 93 // These match the constants in FileStat in file_system_entity.dart. |
| 93 kType = 0, | 94 kType = 0, |
| 94 kCreatedTime = 1, | 95 kCreatedTime = 1, |
| 95 kModifiedTime = 2, | 96 kModifiedTime = 2, |
| 96 kAccessedTime = 3, | 97 kAccessedTime = 3, |
| 97 kMode = 4, | 98 kMode = 4, |
| 98 kSize = 5, | 99 kSize = 5, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 146 |
| 146 // Create a file object for the specified stdio file descriptor | 147 // Create a file object for the specified stdio file descriptor |
| 147 // (stdin, stout or stderr). | 148 // (stdin, stout or stderr). |
| 148 static File* OpenStdio(int fd); | 149 static File* OpenStdio(int fd); |
| 149 | 150 |
| 150 static bool Exists(const char* path); | 151 static bool Exists(const char* path); |
| 151 static bool Create(const char* path); | 152 static bool Create(const char* path); |
| 152 static bool CreateLink(const char* path, const char* target); | 153 static bool CreateLink(const char* path, const char* target); |
| 153 static bool Delete(const char* path); | 154 static bool Delete(const char* path); |
| 154 static bool DeleteLink(const char* path); | 155 static bool DeleteLink(const char* path); |
| 156 static bool Rename(const char* old_path, const char* new_path); |
| 155 static off_t LengthFromPath(const char* path); | 157 static off_t LengthFromPath(const char* path); |
| 156 static void Stat(const char* path, int64_t* data); | 158 static void Stat(const char* path, int64_t* data); |
| 157 static time_t LastModified(const char* path); | 159 static time_t LastModified(const char* path); |
| 158 static char* LinkTarget(const char* pathname); | 160 static char* LinkTarget(const char* pathname); |
| 159 static bool IsAbsolutePath(const char* path); | 161 static bool IsAbsolutePath(const char* path); |
| 160 static char* GetCanonicalPath(const char* path); | 162 static char* GetCanonicalPath(const char* path); |
| 161 static const char* PathSeparator(); | 163 static const char* PathSeparator(); |
| 162 static const char* StringEscapedPathSeparator(); | 164 static const char* StringEscapedPathSeparator(); |
| 163 static Type GetType(const char* path, bool follow_links); | 165 static Type GetType(const char* path, bool follow_links); |
| 164 static Identical AreIdentical(const char* file_1, const char* file_2); | 166 static Identical AreIdentical(const char* file_1, const char* file_2); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 179 | 181 |
| 180 static NativeService file_service_; | 182 static NativeService file_service_; |
| 181 | 183 |
| 182 DISALLOW_COPY_AND_ASSIGN(File); | 184 DISALLOW_COPY_AND_ASSIGN(File); |
| 183 }; | 185 }; |
| 184 | 186 |
| 185 } // namespace bin | 187 } // namespace bin |
| 186 } // namespace dart | 188 } // namespace dart |
| 187 | 189 |
| 188 #endif // BIN_FILE_H_ | 190 #endif // BIN_FILE_H_ |
| OLD | NEW |