| 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> |
| 11 #include <sys/types.h> | 11 #include <sys/types.h> |
| 12 | 12 |
| 13 #include "bin/builtin.h" | 13 #include "bin/builtin.h" |
| 14 #include "bin/dartutils.h" | 14 #include "bin/dartutils.h" |
| 15 #include "bin/native_service.h" | |
| 16 #include "platform/globals.h" | 15 #include "platform/globals.h" |
| 17 #include "platform/thread.h" | 16 #include "platform/thread.h" |
| 18 | 17 |
| 19 | 18 |
| 20 namespace dart { | 19 namespace dart { |
| 21 namespace bin { | 20 namespace bin { |
| 22 | 21 |
| 23 // Forward declaration. | 22 // Forward declaration. |
| 24 class FileHandle; | 23 class FileHandle; |
| 25 | 24 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 static bool IsAbsolutePath(const char* path); | 162 static bool IsAbsolutePath(const char* path); |
| 164 static char* GetCanonicalPath(const char* path); | 163 static char* GetCanonicalPath(const char* path); |
| 165 static const char* PathSeparator(); | 164 static const char* PathSeparator(); |
| 166 static const char* StringEscapedPathSeparator(); | 165 static const char* StringEscapedPathSeparator(); |
| 167 static Type GetType(const char* path, bool follow_links); | 166 static Type GetType(const char* path, bool follow_links); |
| 168 static Identical AreIdentical(const char* file_1, const char* file_2); | 167 static Identical AreIdentical(const char* file_1, const char* file_2); |
| 169 static StdioHandleType GetStdioHandleType(int fd); | 168 static StdioHandleType GetStdioHandleType(int fd); |
| 170 | 169 |
| 171 static FileOpenMode DartModeToFileMode(DartFileOpenMode mode); | 170 static FileOpenMode DartModeToFileMode(DartFileOpenMode mode); |
| 172 | 171 |
| 173 static Dart_Port GetServicePort(); | 172 static CObject* ExistsRequest(const CObjectArray& request); |
| 173 static CObject* CreateRequest(const CObjectArray& request); |
| 174 static CObject* DeleteRequest(const CObjectArray& request); |
| 175 static CObject* RenameRequest(const CObjectArray& request); |
| 176 static CObject* OpenRequest(const CObjectArray& request); |
| 177 static CObject* ResolveSymbolicLinksRequest(const CObjectArray& request); |
| 178 static CObject* CloseRequest(const CObjectArray& request); |
| 179 static CObject* PositionRequest(const CObjectArray& request); |
| 180 static CObject* SetPositionRequest(const CObjectArray& request); |
| 181 static CObject* TruncateRequest(const CObjectArray& request); |
| 182 static CObject* LengthRequest(const CObjectArray& request); |
| 183 static CObject* LengthFromPathRequest(const CObjectArray& request); |
| 184 static CObject* LastModifiedRequest(const CObjectArray& request); |
| 185 static CObject* FlushRequest(const CObjectArray& request); |
| 186 static CObject* ReadByteRequest(const CObjectArray& request); |
| 187 static CObject* WriteByteRequest(const CObjectArray& request); |
| 188 static CObject* ReadRequest(const CObjectArray& request); |
| 189 static CObject* ReadIntoRequest(const CObjectArray& request); |
| 190 static CObject* WriteFromRequest(const CObjectArray& request); |
| 191 static CObject* CreateLinkRequest(const CObjectArray& request); |
| 192 static CObject* DeleteLinkRequest(const CObjectArray& request); |
| 193 static CObject* RenameLinkRequest(const CObjectArray& request); |
| 194 static CObject* LinkTargetRequest(const CObjectArray& request); |
| 195 static CObject* TypeRequest(const CObjectArray& request); |
| 196 static CObject* IdenticalRequest(const CObjectArray& request); |
| 197 static CObject* StatRequest(const CObjectArray& request); |
| 174 | 198 |
| 175 private: | 199 private: |
| 176 explicit File(FileHandle* handle) : handle_(handle) { } | 200 explicit File(FileHandle* handle) : handle_(handle) { } |
| 177 void Close(); | 201 void Close(); |
| 178 | 202 |
| 179 static const int kClosedFd = -1; | 203 static const int kClosedFd = -1; |
| 180 | 204 |
| 181 // FileHandle is an OS specific class which stores data about the file. | 205 // FileHandle is an OS specific class which stores data about the file. |
| 182 FileHandle* handle_; // OS specific handle for the file. | 206 FileHandle* handle_; // OS specific handle for the file. |
| 183 | 207 |
| 184 static NativeService file_service_; | |
| 185 | |
| 186 DISALLOW_COPY_AND_ASSIGN(File); | 208 DISALLOW_COPY_AND_ASSIGN(File); |
| 187 }; | 209 }; |
| 188 | 210 |
| 189 } // namespace bin | 211 } // namespace bin |
| 190 } // namespace dart | 212 } // namespace dart |
| 191 | 213 |
| 192 #endif // BIN_FILE_H_ | 214 #endif // BIN_FILE_H_ |
| OLD | NEW |