Crashpad
Public Member Functions | List of all members
crashpad::FileSeekerInterface Class Referenceabstract

An interface to seek in files and other file-like objects with semantics matching the underlying platform (POSIX or Windows). More...

#include "util/file/file_seeker.h"

Inheritance diagram for crashpad::FileSeekerInterface:
crashpad::FileReaderInterface crashpad::FileWriterInterface crashpad::FileReader crashpad::StringFile crashpad::WeakFileHandleFileReader crashpad::FileWriter crashpad::StringFile crashpad::WeakFileHandleFileWriter

Public Member Functions

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...
 

Detailed Description

An interface to seek in files and other file-like objects with semantics matching the underlying platform (POSIX or Windows).

Member Function Documentation

◆ Seek()

virtual FileOffset crashpad::FileSeekerInterface::Seek ( FileOffset  offset,
int  whence 
)
pure virtual

Wraps LoggingSeekFile() or provides an alternate implementation with identical semantics.

Returns
The return value of LoggingSeekFile(). -1 on failure, with an error message logged.

Implemented in crashpad::FileWriter, crashpad::FileReader, crashpad::WeakFileHandleFileWriter, crashpad::WeakFileHandleFileReader, and crashpad::StringFile.

◆ SeekGet()

FileOffset crashpad::FileSeekerInterface::SeekGet ( )

Wraps Seek(), using SEEK_CUR to obtain the file’s current position.

Returns
The file’s current position on success. -1 on failure, with an error message logged.

◆ SeekSet()

bool crashpad::FileSeekerInterface::SeekSet ( FileOffset  offset)

Wraps Seek(), using SEEK_SET, ensuring that the seek succeeded and the file is positioned as desired.

Returns
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.

The documentation for this class was generated from the following files: