Crashpad
|
A file writer backed by a standard input/output FILE*
.
More...
#include "util/file/file_writer.h"
Public Member Functions | |
WeakStdioFileWriter (FILE *file) | |
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... | |
![]() | |
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... | |
A file writer backed by a standard input/output FILE*
.
This class accepts an already-open FILE*
. It is not responsible for opening or closing this FILE*
. Users of this class must ensure that the FILE*
is closed appropriately elsewhere. Objects of this class may be used to write to FILE*
objects not associated with filesystem-based files, although special attention should be paid to the Seek() method, which may not function on FILE*
objects that do not refer to disk-based files.
This class is expected to be used when other code is responsible for opening FILE*
objects and already provides FILE*
objects. A good use would be a WeakStdioFileWriter for stdout
.
|
overridevirtual |
Wraps LoggingSeekFile() or provides an alternate implementation with identical semantics.
-1
on failure, with an error message logged.FILE*
objects referring to disk-based files. 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.