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

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

Issue 9416096: Implement File.directory() and File.directorySync() to get (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove bogus assert Created 8 years, 10 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
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | runtime/bin/file.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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_
OLDNEW
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | runtime/bin/file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698