Crashpad
|
A file writer backed by a FileHandle. More...
#include "util/file/file_writer.h"
Public Member Functions | |
WeakFileHandleFileWriter (FileHandle file_handle) | |
bool | Write (const void *data, size_t size) override |
Wraps LoggingWriteFile(), or provides an implementation with identical semantics. More... | |
bool | WriteIoVec (std::vector< WritableIoVec > *iovecs) override |
Wraps writev() on POSIX or provides an alternate implementation with identical semantics. This method will write entire buffers, continuing after a short write or after being interrupted. On non-POSIX this is a simple wrapper around Write(). More... | |
FileOffset | Seek (FileOffset offset, int whence) override |
Wraps LoggingSeekFile() or provides an alternate implementation with identical semantics. More... | |
Public Member Functions inherited from crashpad::FileSeekerInterface | |
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... | |
Friends | |
class | FileWriter |
A file writer backed by a FileHandle.
FileWriter requires users to provide a FilePath to open, but this class accepts an already-open FileHandle instead. Like FileWriter, this class may write to a filesystem-based file, but unlike FileWriter, this class is not responsible for creating or closing the file. Users of this class must ensure that the file handle is closed appropriately elsewhere. Objects of this class may be used to write to file handles not associated with filesystem-based files, although special attention should be paid to the Seek() method, which may not function on file handles that do not refer to disk-based files.
This class is expected to be used when other code is responsible for creating files and already provides file handles.
|
overridevirtual |
Wraps LoggingSeekFile() or provides an alternate implementation with identical semantics.
-1
on failure, with an error message logged.Implements crashpad::FileSeekerInterface.
|
overridevirtual |
Wraps LoggingWriteFile(), or provides an implementation with identical semantics.
true
if the operation succeeded, false
if it failed, with an error message logged. Implements crashpad::FileWriterInterface.
|
overridevirtual |
Wraps writev()
on POSIX or provides an alternate implementation with identical semantics. This method will write entire buffers, continuing after a short write or after being interrupted. On non-POSIX this is a simple wrapper around Write().
true
if the operation succeeded, false
if it failed, with an error message logged.Implements crashpad::FileWriterInterface.