Index: webrtc/base/file.h |
diff --git a/webrtc/base/file.h b/webrtc/base/file.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..50071e9d64ba5648952543b21b83a66167dd1cab |
--- /dev/null |
+++ b/webrtc/base/file.h |
@@ -0,0 +1,47 @@ |
+/* |
+ * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
+ * |
+ * Use of this source code is governed by a BSD-style license |
+ * that can be found in the LICENSE file in the root of the source |
+ * tree. An additional intellectual property rights grant can be found |
+ * in the file PATENTS. All contributing project authors may |
+ * be found in the AUTHORS file in the root of the source tree. |
+ */ |
+ |
+#ifndef WEBRTC_BASE_FILE_H_ |
+#define WEBRTC_BASE_FILE_H_ |
+ |
+#include "webrtc/base/platform_file.h" |
+#include "webrtc/base/constructormagic.h" |
+ |
+namespace rtc { |
+ |
sprang_webrtc
2016/08/05 14:45:14
Could you add comments about the intended usage he
|
+class File { |
+ public: |
+ explicit File(rtc::PlatformFile); |
+ ~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.
|
+ |
+ 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.
|
+ size_t Read(char* buffer, size_t length); |
+ |
+ size_t WriteAt(const char* data, size_t length, size_t offset); |
+ size_t ReadAt(char* buffer, size_t length, size_t offset); |
+ |
+ size_t WriteNoBestEffort(const char* data, size_t length); |
+ size_t ReadNoBestEffort(char* buffer, size_t length); |
+ |
+ size_t WriteAtNoBestEffort(const char* data, size_t length, size_t offset); |
+ size_t ReadAtNoBestEffort(char* buffer, size_t length, size_t offset); |
+ |
+ bool Seek(size_t offset); |
+ |
+ bool Close(); |
+ |
+ private: |
+ rtc::PlatformFile file_; |
+ RTC_DISALLOW_COPY_AND_ASSIGN(File); |
+}; |
+ |
+} // namespace rtc |
+ |
+#endif // WEBRTC_BASE_FILE_H_ |