Crashpad
|
An interface to read to files and other file-like objects with semantics matching the underlying platform (POSIX or Windows). More...
#include "util/file/file_reader.h"
Public Member Functions | |
virtual FileOperationResult | Read (void *data, size_t size)=0 |
Wraps ReadFile(), or provides an implementation with identical semantics. More... | |
bool | ReadExactly (void *data, size_t size) |
Wraps Read(), ensuring that the read succeeded and exactly size bytes were read. More... | |
Public Member Functions inherited from crashpad::FileSeekerInterface | |
virtual FileOffset | Seek (FileOffset offset, int whence)=0 |
Wraps LoggingSeekFile() or provides an alternate implementation with identical semantics. More... | |
FileOffset | SeekGet () |
Wraps Seek(), using SEEK_CUR to obtain the file’s current position. More... | |
bool | SeekSet (FileOffset offset) |
Wraps Seek(), using SEEK_SET , ensuring that the seek succeeded and the file is positioned as desired. More... | |
An interface to read to files and other file-like objects with semantics matching the underlying platform (POSIX or Windows).
|
pure virtual |
Wraps ReadFile(), or provides an implementation with identical semantics.
0
or any positive value less than or equal to size. -1
if the operation failed, with an error message logged. Implemented in crashpad::FileReader, crashpad::WeakFileHandleFileReader, and crashpad::StringFile.
bool crashpad::FileReaderInterface::ReadExactly | ( | void * | data, |
size_t | size | ||
) |
Wraps Read(), ensuring that the read succeeded and exactly size bytes were read.
Semantically, this behaves as LoggingReadFileExactly().
true
if the operation succeeded, false
if it failed, with an error message logged. Short reads are treated as failures.