OpenTTD Source  20241121-master-g67a0fccfad
FileReader Struct Reference

Yes, simply reading from a file. More...

Inheritance diagram for FileReader:
LoadFilter

Public Member Functions

 FileReader (FileHandle &&file)
 Create the file reader, so it reads from a specific file. More...
 
 ~FileReader ()
 Make sure everything is cleaned up.
 
size_t Read (uint8_t *buf, size_t size) override
 Read a given number of bytes from the savegame. More...
 
void Reset () override
 Reset this filter to read from the beginning of the file.
 
- Public Member Functions inherited from LoadFilter
 LoadFilter (std::shared_ptr< LoadFilter > chain)
 Initialise this filter. More...
 
virtual ~LoadFilter ()
 Make sure the writers are properly closed.
 

Data Fields

std::optional< FileHandlefile
 The file to read from.
 
long begin
 The begin of the file.
 
- Data Fields inherited from LoadFilter
std::shared_ptr< LoadFilterchain
 Chained to the (savegame) filters.
 

Detailed Description

Yes, simply reading from a file.

Definition at line 2211 of file saveload.cpp.

Constructor & Destructor Documentation

◆ FileReader()

FileReader::FileReader ( FileHandle &&  file)
inline

Create the file reader, so it reads from a specific file.

Parameters
fileThe file to read from.

Definition at line 2219 of file saveload.cpp.

Member Function Documentation

◆ Read()

size_t FileReader::Read ( uint8_t *  buf,
size_t  len 
)
inlineoverridevirtual

Read a given number of bytes from the savegame.

Parameters
bufThe bytes to read.
lenThe number of bytes to read.
Returns
The number of actually read bytes.

Implements LoadFilter.

Definition at line 2231 of file saveload.cpp.


The documentation for this struct was generated from the following file: