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

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

Issue 8578003: Implement setPosition on File to seek to a byte position. (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
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 28 matching lines...) Expand all
39 return WriteFully(&byte, 1); 39 return WriteFully(&byte, 1);
40 } 40 }
41 41
42 // Get the length of the file. Returns a negative value if the length cannot 42 // Get the length of the file. Returns a negative value if the length cannot
43 // be determined (e.g. not seekable device). 43 // be determined (e.g. not seekable device).
44 off_t Length(); 44 off_t Length();
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 off_t SetPosition(int64_t position);
49 50
50 // Flush contents of file. 51 // Flush contents of file.
51 void Flush(); 52 void Flush();
52 53
53 const char* name() const { return name_; } 54 const char* name() const { return name_; }
54 55
55 static File* Open(const char* name, bool writable); 56 static File* Open(const char* name, bool writable);
56 static bool Exists(const char* name); 57 static bool Exists(const char* name);
57 static bool Create(const char* name); 58 static bool Create(const char* name);
58 static bool IsAbsolutePath(const char* pathname); 59 static bool IsAbsolutePath(const char* pathname);
(...skipping 11 matching lines...) Expand all
70 const char* name_; 71 const char* name_;
71 // FileHandle is an OS specific class which stores data about the file. 72 // FileHandle is an OS specific class which stores data about the file.
72 FileHandle* handle_; // OS specific handle for the file. 73 FileHandle* handle_; // OS specific handle for the file.
73 74
74 // DISALLOW_COPY_AND_ASSIGN(File). 75 // DISALLOW_COPY_AND_ASSIGN(File).
75 File(const File&); 76 File(const File&);
76 void operator=(const File&); 77 void operator=(const File&);
77 }; 78 };
78 79
79 #endif // BIN_FILE_H_ 80 #endif // BIN_FILE_H_
OLDNEW
« no previous file with comments | « runtime/bin/builtin_in.cc ('k') | runtime/bin/file.cc » ('j') | runtime/bin/file_impl.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698