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

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

Issue 10443008: Implement File.lastModified. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 #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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 kDeleteRequest = 2, 56 kDeleteRequest = 2,
57 kOpenRequest = 3, 57 kOpenRequest = 3,
58 kFullPathRequest = 4, 58 kFullPathRequest = 4,
59 kDirectoryRequest = 5, 59 kDirectoryRequest = 5,
60 kCloseRequest = 6, 60 kCloseRequest = 6,
61 kPositionRequest = 7, 61 kPositionRequest = 7,
62 kSetPositionRequest = 8, 62 kSetPositionRequest = 8,
63 kTruncateRequest = 9, 63 kTruncateRequest = 9,
64 kLengthRequest = 10, 64 kLengthRequest = 10,
65 kLengthFromNameRequest = 11, 65 kLengthFromNameRequest = 11,
66 kFlushRequest = 12, 66 kLastModifiedRequest = 12,
67 kReadByteRequest = 13, 67 kFlushRequest = 13,
68 kWriteByteRequest = 14, 68 kReadByteRequest = 14,
69 kReadListRequest = 15, 69 kWriteByteRequest = 15,
70 kWriteListRequest = 16, 70 kReadListRequest = 16,
71 kWriteStringRequest = 17 71 kWriteListRequest = 17,
72 kWriteStringRequest = 18
72 }; 73 };
73 74
74 ~File(); 75 ~File();
75 76
76 // Read/Write attempt to transfer num_bytes to/from buffer. It returns 77 // Read/Write attempt to transfer num_bytes to/from buffer. It returns
77 // the number of bytes read/written. 78 // the number of bytes read/written.
78 int64_t Read(void* buffer, int64_t num_bytes); 79 int64_t Read(void* buffer, int64_t num_bytes);
79 int64_t Write(const void* buffer, int64_t num_bytes); 80 int64_t Write(const void* buffer, int64_t num_bytes);
80 81
81 // ReadFully and WriteFully do attempt to transfer num_bytes to/from 82 // ReadFully and WriteFully do attempt to transfer num_bytes to/from
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 static File* Open(const char* name, FileOpenMode mode); 119 static File* Open(const char* name, FileOpenMode mode);
119 120
120 // Create a file object for the specified stdio file descriptor 121 // Create a file object for the specified stdio file descriptor
121 // (stdin, stout or stderr). 122 // (stdin, stout or stderr).
122 static File* OpenStdio(int fd); 123 static File* OpenStdio(int fd);
123 124
124 static bool Exists(const char* name); 125 static bool Exists(const char* name);
125 static bool Create(const char* name); 126 static bool Create(const char* name);
126 static bool Delete(const char* name); 127 static bool Delete(const char* name);
127 static off_t LengthFromName(const char* name); 128 static off_t LengthFromName(const char* name);
129 static time_t LastModified(const char* name);
Anders Johnsen 2012/05/24 12:05:42 I guess this should return an intptr_t?
Mads Ager (google) 2012/05/24 12:09:21 I'm keeping it consistent with Length which return
Anders Johnsen 2012/05/24 12:12:59 Okay.
128 static bool IsAbsolutePath(const char* pathname); 130 static bool IsAbsolutePath(const char* pathname);
129 static char* GetCanonicalPath(const char* name); 131 static char* GetCanonicalPath(const char* name);
130 static char* GetContainingDirectory(char* name); 132 static char* GetContainingDirectory(char* name);
131 static const char* PathSeparator(); 133 static const char* PathSeparator();
132 static const char* StringEscapedPathSeparator(); 134 static const char* StringEscapedPathSeparator();
133 static StdioHandleType GetStdioHandleType(int fd); 135 static StdioHandleType GetStdioHandleType(int fd);
134 136
135 static FileOpenMode DartModeToFileMode(DartFileOpenMode mode); 137 static FileOpenMode DartModeToFileMode(DartFileOpenMode mode);
136 138
137 static Dart_Port GetServicePort(); 139 static Dart_Port GetServicePort();
(...skipping 12 matching lines...) Expand all
150 File(const File&); 152 File(const File&);
151 void operator=(const File&); 153 void operator=(const File&);
152 154
153 static dart::Mutex mutex_; 155 static dart::Mutex mutex_;
154 static int service_ports_size_; 156 static int service_ports_size_;
155 static Dart_Port* service_ports_; 157 static Dart_Port* service_ports_;
156 static int service_ports_index_; 158 static int service_ports_index_;
157 }; 159 };
158 160
159 #endif // BIN_FILE_H_ 161 #endif // BIN_FILE_H_
OLDNEW
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | runtime/bin/file.cc » ('j') | runtime/bin/file_impl.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698