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

Unified Diff: util/file/file_seeker.h

Issue 913223008: Add FileReaderInterface::ReadExactly() and FileSeekerInterface::SeekSet() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « util/file/file_reader.cc ('k') | util/file/file_seeker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/file/file_seeker.h
diff --git a/util/file/file_seeker.h b/util/file/file_seeker.h
index f6d8b46461f0bbbd0c2fcb9ae2bfbf1e544f7cd9..1b32e104588b1bdbe1987fa3da10a24686d08944 100644
--- a/util/file/file_seeker.h
+++ b/util/file/file_seeker.h
@@ -30,6 +30,21 @@ class FileSeekerInterface {
//! with an error message logged.
virtual FileOffset Seek(FileOffset offset, int whence) = 0;
+ //! \brief Wraps Seek(), using `SEEK_CUR` to obtain the file’s current
+ //! position.
+ //!
+ //! \return The file’s current position on success. `-1` on failure, with an
+ //! error message logged.
+ FileOffset SeekGet();
+
+ //! \brief Wraps Seek(), using `SEEK_SET`, ensuring that the seek succeeded
+ //! and the file is positioned as desired.
+ //!
+ //! \return `true` if the operation succeeded, `false` if it failed, with an
+ //! error message logged. A failure to reposition the file as desired is
+ //! treated as a failure.
+ bool SeekSet(FileOffset offset);
+
protected:
~FileSeekerInterface() {}
};
« no previous file with comments | « util/file/file_reader.cc ('k') | util/file/file_seeker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698