OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license | |
5 * that can be found in the LICENSE file in the root of the source | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 #ifndef WEBRTC_BASE_FILE_H_ | |
12 #define WEBRTC_BASE_FILE_H_ | |
13 | |
14 #include "webrtc/base/platform_file.h" | |
15 #include "webrtc/base/constructormagic.h" | |
16 | |
17 namespace rtc { | |
18 | |
sprang_webrtc
2016/08/05 14:45:14
Could you add comments about the intended usage he
| |
19 class File { | |
20 public: | |
21 explicit File(rtc::PlatformFile); | |
22 ~File(); | |
sprang_webrtc
2016/08/05 14:45:14
Does the destructor implicitly close the file? Mig
palmkvist
2016/08/08 11:15:35
Done.
| |
23 | |
24 size_t Write(const char* data, size_t length); | |
sprang_webrtc
2016/08/05 14:45:14
uint8_t* instead of char* here and elsewhere
palmkvist
2016/08/08 11:15:35
Done.
| |
25 size_t Read(char* buffer, size_t length); | |
26 | |
27 size_t WriteAt(const char* data, size_t length, size_t offset); | |
28 size_t ReadAt(char* buffer, size_t length, size_t offset); | |
29 | |
30 size_t WriteNoBestEffort(const char* data, size_t length); | |
31 size_t ReadNoBestEffort(char* buffer, size_t length); | |
32 | |
33 size_t WriteAtNoBestEffort(const char* data, size_t length, size_t offset); | |
34 size_t ReadAtNoBestEffort(char* buffer, size_t length, size_t offset); | |
35 | |
36 bool Seek(size_t offset); | |
37 | |
38 bool Close(); | |
39 | |
40 private: | |
41 rtc::PlatformFile file_; | |
42 RTC_DISALLOW_COPY_AND_ASSIGN(File); | |
43 }; | |
44 | |
45 } // namespace rtc | |
46 | |
47 #endif // WEBRTC_BASE_FILE_H_ | |
OLD | NEW |