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

Side by Side Diff: net/base/file_stream.h

Issue 6969077: net: Add NET_API to net/base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the 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 #pragma once 12 #pragma once
13 13
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/platform_file.h" 15 #include "base/platform_file.h"
16 #include "net/base/completion_callback.h" 16 #include "net/base/completion_callback.h"
17 #include "net/base/net_api.h"
17 18
18 class FilePath; 19 class FilePath;
19 20
20 namespace net { 21 namespace net {
21 22
22 // TODO(darin): Move this to a more generic location. 23 // TODO(darin): Move this to a more generic location.
23 // This explicit mapping matches both FILE_ on Windows and SEEK_ on Linux. 24 // This explicit mapping matches both FILE_ on Windows and SEEK_ on Linux.
24 enum Whence { 25 enum Whence {
25 FROM_BEGIN = 0, 26 FROM_BEGIN = 0,
26 FROM_CURRENT = 1, 27 FROM_CURRENT = 1,
27 FROM_END = 2 28 FROM_END = 2
28 }; 29 };
29 30
30 class FileStream { 31 class NET_API FileStream {
31 public: 32 public:
32 FileStream(); 33 FileStream();
33 34
34 // Construct a FileStream with an existing file handle and opening flags. 35 // Construct a FileStream with an existing file handle and opening flags.
35 // |file| is valid file handle. 36 // |file| is valid file handle.
36 // |flags| is a bitfield of base::PlatformFileFlags when the file handle was 37 // |flags| is a bitfield of base::PlatformFileFlags when the file handle was
37 // opened. 38 // opened.
38 // The already opened file will not be automatically closed when FileStream 39 // The already opened file will not be automatically closed when FileStream
39 // is destructed. 40 // is destructed.
40 FileStream(base::PlatformFile file, int flags); 41 FileStream(base::PlatformFile file, int flags);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 base::PlatformFile file_; 143 base::PlatformFile file_;
143 int open_flags_; 144 int open_flags_;
144 bool auto_closed_; 145 bool auto_closed_;
145 146
146 DISALLOW_COPY_AND_ASSIGN(FileStream); 147 DISALLOW_COPY_AND_ASSIGN(FileStream);
147 }; 148 };
148 149
149 } // namespace net 150 } // namespace net
150 151
151 #endif // NET_BASE_FILE_STREAM_H_ 152 #endif // NET_BASE_FILE_STREAM_H_
OLDNEW
« base/compiler_specific.h ('K') | « net/base/escape.h ('k') | net/base/filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698