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

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

Issue 8437056: Implemented File create API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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_in.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 // Get the current position in the file. 46 // Get the current position in the file.
47 // Returns a negative value if position cannot be determined. 47 // Returns a negative value if position cannot be determined.
48 off_t Position(); 48 off_t Position();
49 49
50 // Flush contents of file. 50 // Flush contents of file.
51 void Flush(); 51 void Flush();
52 52
53 const char* name() const { return name_; } 53 const char* name() const { return name_; }
54 54
55 static File* OpenFile(const char* name, bool writable); 55 static File* Open(const char* name, bool writable);
56 static bool FileExists(const char* name); 56 static bool Exists(const char* name);
57 static bool Create(const char* name);
57 static bool IsAbsolutePath(const char* pathname); 58 static bool IsAbsolutePath(const char* pathname);
58 static char* GetCanonicalPath(const char* name); 59 static char* GetCanonicalPath(const char* name);
59 static const char* PathSeparator(); 60 static const char* PathSeparator();
60 static const char* StringEscapedPathSeparator(); 61 static const char* StringEscapedPathSeparator();
61 62
62 private: 63 private:
63 File(const char* name, FileHandle* handle) : name_(name), handle_(handle) { } 64 File(const char* name, FileHandle* handle) : name_(name), handle_(handle) { }
64 void Close(); 65 void Close();
65 bool IsClosed(); 66 bool IsClosed();
66 67
67 static const int kClosedFd = -1; 68 static const int kClosedFd = -1;
68 69
69 const char* name_; 70 const char* name_;
70 // FileHandle is an OS specific class which stores data about the file. 71 // FileHandle is an OS specific class which stores data about the file.
71 FileHandle* handle_; // OS specific handle for the file. 72 FileHandle* handle_; // OS specific handle for the file.
72 73
73 // DISALLOW_COPY_AND_ASSIGN(File). 74 // DISALLOW_COPY_AND_ASSIGN(File).
74 File(const File&); 75 File(const File&);
75 void operator=(const File&); 76 void operator=(const File&);
76 }; 77 };
77 78
78 #endif // BIN_FILE_H_ 79 #endif // BIN_FILE_H_
OLDNEW
« no previous file with comments | « runtime/bin/builtin_in.cc ('k') | runtime/bin/file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698