OpenTTD Source: FiosFileScanner Class Reference

OpenTTD Source 1.11.0-RC1

Public Member Functions | Private Attributes
FiosFileScanner Class Reference

Scanner to scan for a particular type of FIOS file. More...

Inheritance diagram for FiosFileScanner:

## Public Member Functions
| FiosFileScanner (SaveLoadOperation fop, fios_getlist_callback_proc *callback_proc, FileList &file_list)
| Create the scanner. More...
bool | AddFile (const std::string &filename, size_t basepath_length, const std::string &tar_filename) override
| Try to add a fios item set with the given filename. More...
Public Member Functions inherited from FileScanner
virtual | ~FileScanner ()
| Destruct the proper one...
uint | Scan (const char *extension, Subdirectory sd, bool tars=true, bool recursive=true)
| Scan for files with the given extension in the given search path. More...
uint | Scan (const char *extension, const char *directory, bool recursive=true)
| Scan for files with the given extension in the given search path. More...

## Private Attributes
SaveLoadOperation | fop
| The kind of file we are looking for.
fios_getlist_callback_proc * | callback_proc
| Callback to check whether the file may be added.
FileList & | file_list
| Destination of the found files.

## Additional Inherited Members
Protected Attributes inherited from FileScanner
Subdirectory | subdir
| The current sub directory we are searching through.

## Detailed Description

Scanner to scan for a particular type of FIOS file.

Definition at line 269 of file fios.cpp.

## Constructor & Destructor Documentation

## ◆ FiosFileScanner()

FiosFileScanner::FiosFileScanner | ( | SaveLoadOperation | fop,
|  | fios_getlist_callback_proc * | callback_proc,
|  | FileList & | file_list
| ) |  |
| inline

Create the scanner.

Parameters

  fop | Purpose of collecting the list.
  callback_proc | The function that is called where you need to do the filtering.
  file_list | Destination of the found files.

Definition at line 280 of file fios.cpp.

## Member Function Documentation

## ◆ AddFile()

bool FiosFileScanner::AddFile | ( | const std::string & | filename,
|  | size_t | basepath_length,
|  | const std::string & | tar_filename
| ) |  |
| overridevirtual

Try to add a fios item set with the given filename.

Parameters

  filename | the full path to the file to read
  basepath_length | amount of characters to chop of before to get a relative filename

Returns
  true if the file is added.

Implements FileScanner.

Definition at line 293 of file fios.cpp.

References callback_proc, fop, and lastof.

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

- src/fios.cpp