| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 // Create a file object for the specified stdio file descriptor | 82 // Create a file object for the specified stdio file descriptor |
| 83 // (stdin, stout or stderr). | 83 // (stdin, stout or stderr). |
| 84 static File* OpenStdio(int fd); | 84 static File* OpenStdio(int fd); |
| 85 | 85 |
| 86 static bool Exists(const char* name); | 86 static bool Exists(const char* name); |
| 87 static bool Create(const char* name); | 87 static bool Create(const char* name); |
| 88 static bool Delete(const char* name); | 88 static bool Delete(const char* name); |
| 89 static bool IsAbsolutePath(const char* pathname); | 89 static bool IsAbsolutePath(const char* pathname); |
| 90 static char* GetCanonicalPath(const char* name); | 90 static char* GetCanonicalPath(const char* name); |
| 91 static char* GetContainingDirectory(char* name); |
| 91 static const char* PathSeparator(); | 92 static const char* PathSeparator(); |
| 92 static const char* StringEscapedPathSeparator(); | 93 static const char* StringEscapedPathSeparator(); |
| 93 static StdioHandleType GetStdioHandleType(int fd); | 94 static StdioHandleType GetStdioHandleType(int fd); |
| 94 | 95 |
| 95 private: | 96 private: |
| 96 File(const char* name, FileHandle* handle) : name_(name), handle_(handle) { } | 97 File(const char* name, FileHandle* handle) : name_(name), handle_(handle) { } |
| 97 void Close(); | 98 void Close(); |
| 98 bool IsClosed(); | 99 bool IsClosed(); |
| 99 | 100 |
| 100 static const int kClosedFd = -1; | 101 static const int kClosedFd = -1; |
| 101 | 102 |
| 102 const char* name_; | 103 const char* name_; |
| 103 // FileHandle is an OS specific class which stores data about the file. | 104 // FileHandle is an OS specific class which stores data about the file. |
| 104 FileHandle* handle_; // OS specific handle for the file. | 105 FileHandle* handle_; // OS specific handle for the file. |
| 105 | 106 |
| 106 // DISALLOW_COPY_AND_ASSIGN(File). | 107 // DISALLOW_COPY_AND_ASSIGN(File). |
| 107 File(const File&); | 108 File(const File&); |
| 108 void operator=(const File&); | 109 void operator=(const File&); |
| 109 }; | 110 }; |
| 110 | 111 |
| 111 #endif // BIN_FILE_H_ | 112 #endif // BIN_FILE_H_ |
| OLD | NEW |