Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: runtime/bin/file.h

Issue 12812010: dart:io | Add Link.targetSync on all platforms. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Improve error handling on Windows. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 CreateLink(const char* path, const char* target);
127 static bool Delete(const char* path); 127 static bool Delete(const char* path);
128 static off_t LengthFromPath(const char* path); 128 static off_t LengthFromPath(const char* path);
129 static time_t LastModified(const char* path); 129 static time_t LastModified(const char* path);
130 static char* LinkTarget(const char* pathname);
130 static bool IsAbsolutePath(const char* path); 131 static bool IsAbsolutePath(const char* path);
131 static char* GetCanonicalPath(const char* path); 132 static char* GetCanonicalPath(const char* path);
132 static char* GetContainingDirectory(char* path); 133 static char* GetContainingDirectory(char* path);
133 static const char* PathSeparator(); 134 static const char* PathSeparator();
134 static const char* StringEscapedPathSeparator(); 135 static const char* StringEscapedPathSeparator();
135 static Type GetType(const char* path, bool follow_links); 136 static Type GetType(const char* path, bool follow_links);
136 static StdioHandleType GetStdioHandleType(int fd); 137 static StdioHandleType GetStdioHandleType(int fd);
137 138
138 static FileOpenMode DartModeToFileMode(DartFileOpenMode mode); 139 static FileOpenMode DartModeToFileMode(DartFileOpenMode mode);
139 140
140 static Dart_Port GetServicePort(); 141 static Dart_Port GetServicePort();
141 142
142 private: 143 private:
143 explicit File(FileHandle* handle) : handle_(handle) { } 144 explicit File(FileHandle* handle) : handle_(handle) { }
144 void Close(); 145 void Close();
145 146
146 static const int kClosedFd = -1; 147 static const int kClosedFd = -1;
147 148
148 // FileHandle is an OS specific class which stores data about the file. 149 // FileHandle is an OS specific class which stores data about the file.
149 FileHandle* handle_; // OS specific handle for the file. 150 FileHandle* handle_; // OS specific handle for the file.
150 151
151 static NativeService file_service_; 152 static NativeService file_service_;
152 153
153 DISALLOW_COPY_AND_ASSIGN(File); 154 DISALLOW_COPY_AND_ASSIGN(File);
154 }; 155 };
155 156
156 #endif // BIN_FILE_H_ 157 #endif // BIN_FILE_H_
OLDNEW
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | runtime/bin/file.cc » ('j') | runtime/bin/file_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698