Crashpad
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Loading...
Searching...
No Matches
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:
[legend]

Public Member Functions

virtual FileOffset Seek (FileOffset offset, int whence)=0
 Wraps LoggingSeekFile() or provides an alternate implementation with identical semantics.
 
FileOffset SeekGet ()
 Wraps Seek(), using SEEK_CUR to obtain the file’s current position.
 
bool SeekSet (FileOffset offset)
 Wraps Seek(), using SEEK_SET, ensuring that the seek succeeded and the file is positioned as desired.
 

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::FileReader, crashpad::FileWriter, crashpad::StringFile, crashpad::WeakFileHandleFileReader, and crashpad::WeakFileHandleFileWriter.

◆ 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: