| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #if defined(_WIN32) | 8 #if defined(_WIN32) |
| 9 typedef signed __int64 int64_t; | 9 typedef signed __int64 int64_t; |
| 10 typedef unsigned __int8 uint8_t; | 10 typedef unsigned __int8 uint8_t; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 static File* OpenStdio(int fd); | 122 static File* OpenStdio(int fd); |
| 123 | 123 |
| 124 static bool Exists(const char* name); | 124 static bool Exists(const char* name); |
| 125 static bool Create(const char* name); | 125 static bool Create(const char* name); |
| 126 static bool Delete(const char* name); | 126 static bool Delete(const char* name); |
| 127 static off_t LengthFromName(const char* name); | 127 static off_t LengthFromName(const char* name); |
| 128 static bool IsAbsolutePath(const char* pathname); | 128 static bool IsAbsolutePath(const char* pathname); |
| 129 static char* GetCanonicalPath(const char* name); | 129 static char* GetCanonicalPath(const char* name); |
| 130 static char* GetContainingDirectory(char* name); | 130 static char* GetContainingDirectory(char* name); |
| 131 static const char* PathSeparator(); | 131 static const char* PathSeparator(); |
| 132 static char PathSeparatorCharacter(); |
| 132 static const char* StringEscapedPathSeparator(); | 133 static const char* StringEscapedPathSeparator(); |
| 133 static StdioHandleType GetStdioHandleType(int fd); | 134 static StdioHandleType GetStdioHandleType(int fd); |
| 134 | 135 |
| 135 static FileOpenMode DartModeToFileMode(DartFileOpenMode mode); | 136 static FileOpenMode DartModeToFileMode(DartFileOpenMode mode); |
| 136 | 137 |
| 137 static Dart_Port GetServicePort(); | 138 static Dart_Port GetServicePort(); |
| 138 | 139 |
| 139 private: | 140 private: |
| 140 File(const char* name, FileHandle* handle) : name_(name), handle_(handle) { } | 141 File(const char* name, FileHandle* handle) : name_(name), handle_(handle) { } |
| 141 void Close(); | 142 void Close(); |
| 142 | 143 |
| 143 static const int kClosedFd = -1; | 144 static const int kClosedFd = -1; |
| 144 | 145 |
| 145 const char* name_; | 146 const char* name_; |
| 146 // FileHandle is an OS specific class which stores data about the file. | 147 // FileHandle is an OS specific class which stores data about the file. |
| 147 FileHandle* handle_; // OS specific handle for the file. | 148 FileHandle* handle_; // OS specific handle for the file. |
| 148 | 149 |
| 149 // DISALLOW_COPY_AND_ASSIGN(File). | 150 // DISALLOW_COPY_AND_ASSIGN(File). |
| 150 File(const File&); | 151 File(const File&); |
| 151 void operator=(const File&); | 152 void operator=(const File&); |
| 152 | 153 |
| 153 static dart::Mutex mutex_; | 154 static dart::Mutex mutex_; |
| 154 static int service_ports_size_; | 155 static int service_ports_size_; |
| 155 static Dart_Port* service_ports_; | 156 static Dart_Port* service_ports_; |
| 156 static int service_ports_index_; | 157 static int service_ports_index_; |
| 157 }; | 158 }; |
| 158 | 159 |
| 159 #endif // BIN_FILE_H_ | 160 #endif // BIN_FILE_H_ |
| OLD | NEW |