OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 | 4 |
5 // This file defines FileStream, a basic interface for reading and writing files | 5 // This file defines FileStream, a basic interface for reading and writing files |
6 // synchronously or asynchronously with support for seeking to an offset. | 6 // synchronously or asynchronously with support for seeking to an offset. |
7 // Note that even when used asynchronously, only one operation is supported at | 7 // Note that even when used asynchronously, only one operation is supported at |
8 // a time. | 8 // a time. |
9 | 9 |
10 #ifndef NET_BASE_FILE_STREAM_H_ | 10 #ifndef NET_BASE_FILE_STREAM_H_ |
11 #define NET_BASE_FILE_STREAM_H_ | 11 #define NET_BASE_FILE_STREAM_H_ |
12 | 12 |
13 #include "base/file_path.h" | |
14 #include "base/platform_file.h" | 13 #include "base/platform_file.h" |
15 #include "base/scoped_ptr.h" | 14 #include "base/scoped_ptr.h" |
16 #include "net/base/completion_callback.h" | 15 #include "net/base/completion_callback.h" |
17 | 16 |
| 17 class FilePath; |
| 18 |
18 namespace net { | 19 namespace net { |
19 | 20 |
20 // TODO(darin): Move this to a more generic location. | 21 // TODO(darin): Move this to a more generic location. |
21 // This explicit mapping matches both FILE_ on Windows and SEEK_ on Linux. | 22 // This explicit mapping matches both FILE_ on Windows and SEEK_ on Linux. |
22 enum Whence { | 23 enum Whence { |
23 FROM_BEGIN = 0, | 24 FROM_BEGIN = 0, |
24 FROM_CURRENT = 1, | 25 FROM_CURRENT = 1, |
25 FROM_END = 2 | 26 FROM_END = 2 |
26 }; | 27 }; |
27 | 28 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 128 |
128 base::PlatformFile file_; | 129 base::PlatformFile file_; |
129 int open_flags_; | 130 int open_flags_; |
130 | 131 |
131 DISALLOW_COPY_AND_ASSIGN(FileStream); | 132 DISALLOW_COPY_AND_ASSIGN(FileStream); |
132 }; | 133 }; |
133 | 134 |
134 } // namespace net | 135 } // namespace net |
135 | 136 |
136 #endif // NET_BASE_FILE_STREAM_H_ | 137 #endif // NET_BASE_FILE_STREAM_H_ |
OLD | NEW |