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

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

Issue 15018011: dart:io | Add FileSystemEntity.stat() and FileStat class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix Windows failures. Created 7 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) 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>
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 kFlushRequest = 13, 78 kFlushRequest = 13,
79 kReadByteRequest = 14, 79 kReadByteRequest = 14,
80 kWriteByteRequest = 15, 80 kWriteByteRequest = 15,
81 kReadRequest = 16, 81 kReadRequest = 16,
82 kReadIntoRequest = 17, 82 kReadIntoRequest = 17,
83 kWriteFromRequest = 18, 83 kWriteFromRequest = 18,
84 kCreateLinkRequest = 19, 84 kCreateLinkRequest = 19,
85 kDeleteLinkRequest = 20, 85 kDeleteLinkRequest = 20,
86 kLinkTargetRequest = 21, 86 kLinkTargetRequest = 21,
87 kTypeRequest = 22, 87 kTypeRequest = 22,
88 kIdenticalRequest = 23 88 kIdenticalRequest = 23,
89 kStatRequest = 24
90 };
91
92 enum FileStat {
93 // These match the constants in FileStat in file_system_entity.dart.
94 kType = 0,
95 kCreatedTime = 1,
96 kModifiedTime = 2,
97 kAccessedTime = 3,
98 kMode = 4,
99 kSize = 5,
100 kStatSize = 6
89 }; 101 };
90 102
91 ~File(); 103 ~File();
92 104
93 // Read/Write attempt to transfer num_bytes to/from buffer. It returns 105 // Read/Write attempt to transfer num_bytes to/from buffer. It returns
94 // the number of bytes read/written. 106 // the number of bytes read/written.
95 int64_t Read(void* buffer, int64_t num_bytes); 107 int64_t Read(void* buffer, int64_t num_bytes);
96 int64_t Write(const void* buffer, int64_t num_bytes); 108 int64_t Write(const void* buffer, int64_t num_bytes);
97 109
98 // ReadFully and WriteFully do attempt to transfer num_bytes to/from 110 // ReadFully and WriteFully do attempt to transfer num_bytes to/from
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // Create a file object for the specified stdio file descriptor 147 // Create a file object for the specified stdio file descriptor
136 // (stdin, stout or stderr). 148 // (stdin, stout or stderr).
137 static File* OpenStdio(int fd); 149 static File* OpenStdio(int fd);
138 150
139 static bool Exists(const char* path); 151 static bool Exists(const char* path);
140 static bool Create(const char* path); 152 static bool Create(const char* path);
141 static bool CreateLink(const char* path, const char* target); 153 static bool CreateLink(const char* path, const char* target);
142 static bool Delete(const char* path); 154 static bool Delete(const char* path);
143 static bool DeleteLink(const char* path); 155 static bool DeleteLink(const char* path);
144 static off_t LengthFromPath(const char* path); 156 static off_t LengthFromPath(const char* path);
157 static void Stat(const char* path, int64_t* data);
145 static time_t LastModified(const char* path); 158 static time_t LastModified(const char* path);
146 static char* LinkTarget(const char* pathname); 159 static char* LinkTarget(const char* pathname);
147 static bool IsAbsolutePath(const char* path); 160 static bool IsAbsolutePath(const char* path);
148 static char* GetCanonicalPath(const char* path); 161 static char* GetCanonicalPath(const char* path);
149 static char* GetContainingDirectory(char* path); 162 static char* GetContainingDirectory(char* path);
150 static const char* PathSeparator(); 163 static const char* PathSeparator();
151 static const char* StringEscapedPathSeparator(); 164 static const char* StringEscapedPathSeparator();
152 static Type GetType(const char* path, bool follow_links); 165 static Type GetType(const char* path, bool follow_links);
153 static Identical AreIdentical(const char* file_1, const char* file_2); 166 static Identical AreIdentical(const char* file_1, const char* file_2);
154 static StdioHandleType GetStdioHandleType(int fd); 167 static StdioHandleType GetStdioHandleType(int fd);
(...skipping 13 matching lines...) Expand all
168 181
169 static NativeService file_service_; 182 static NativeService file_service_;
170 183
171 DISALLOW_COPY_AND_ASSIGN(File); 184 DISALLOW_COPY_AND_ASSIGN(File);
172 }; 185 };
173 186
174 } // namespace bin 187 } // namespace bin
175 } // namespace dart 188 } // namespace dart
176 189
177 #endif // BIN_FILE_H_ 190 #endif // BIN_FILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698