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

Unified Diff: webrtc/base/file.h

Issue 2214763002: Initial version of new file wrapper (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Testing + fixing windows specific code Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
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_
« no previous file with comments | « webrtc/base/base.gyp ('k') | webrtc/base/file.cc » ('j') | webrtc/base/file.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698