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 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // not exist the file is created. The file is truncated to length 0 if | 116 // not exist the file is created. The file is truncated to length 0 if |
117 // mode contains kTruncate. | 117 // mode contains kTruncate. |
118 static File* Open(const char* path, FileOpenMode mode); | 118 static File* Open(const char* path, FileOpenMode mode); |
119 | 119 |
120 // Create a file object for the specified stdio file descriptor | 120 // Create a file object for the specified stdio file descriptor |
121 // (stdin, stout or stderr). | 121 // (stdin, stout or stderr). |
122 static File* OpenStdio(int fd); | 122 static File* OpenStdio(int fd); |
123 | 123 |
124 static bool Exists(const char* path); | 124 static bool Exists(const char* path); |
125 static bool Create(const char* path); | 125 static bool Create(const char* path); |
| 126 static bool CreateLink(const char* path, const char* target); |
126 static bool Delete(const char* path); | 127 static bool Delete(const char* path); |
127 static off_t LengthFromPath(const char* path); | 128 static off_t LengthFromPath(const char* path); |
128 static time_t LastModified(const char* path); | 129 static time_t LastModified(const char* path); |
129 static bool IsAbsolutePath(const char* path); | 130 static bool IsAbsolutePath(const char* path); |
130 static char* GetCanonicalPath(const char* path); | 131 static char* GetCanonicalPath(const char* path); |
131 static char* GetContainingDirectory(char* path); | 132 static char* GetContainingDirectory(char* path); |
132 static const char* PathSeparator(); | 133 static const char* PathSeparator(); |
133 static const char* StringEscapedPathSeparator(); | 134 static const char* StringEscapedPathSeparator(); |
134 static Type GetType(const char* path, bool follow_links); | 135 static Type GetType(const char* path, bool follow_links); |
135 static StdioHandleType GetStdioHandleType(int fd); | 136 static StdioHandleType GetStdioHandleType(int fd); |
(...skipping 10 matching lines...) Expand all Loading... |
146 | 147 |
147 // FileHandle is an OS specific class which stores data about the file. | 148 // FileHandle is an OS specific class which stores data about the file. |
148 FileHandle* handle_; // OS specific handle for the file. | 149 FileHandle* handle_; // OS specific handle for the file. |
149 | 150 |
150 static NativeService file_service_; | 151 static NativeService file_service_; |
151 | 152 |
152 DISALLOW_COPY_AND_ASSIGN(File); | 153 DISALLOW_COPY_AND_ASSIGN(File); |
153 }; | 154 }; |
154 | 155 |
155 #endif // BIN_FILE_H_ | 156 #endif // BIN_FILE_H_ |
OLD | NEW |