OpenTTD: FiosFileScanner Class Reference

OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

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 (SaveLoadDialogMode mode, fios_getlist_callback_proc *callback_proc)
| Create the scanner.
bool | AddFile (const char *filename, size_t basepath_length, const char *tar_filename)
| Try to add a fios item set with the given filename.
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.
uint | Scan (const char *extension, const char *directory, bool recursive=true)
| Scan for files with the given extension in the given search path.

## Private Attributes
SaveLoadDialogMode | mode
| The mode we want to search for.
fios_getlist_callback_proc * | callback_proc
| Callback to check whether the file may be added.

## 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 223 of file fios.cpp.

## Constructor & Destructor Documentation

FiosFileScanner::FiosFileScanner | ( | SaveLoadDialogMode | mode,
|  | fios_getlist_callback_proc * | callback_proc
| ) |  |
| inline

Create the scanner.

Parameters

  mode | The mode we are in. Some modes don't allow 'parent'.
  callback_proc | The function that is called where you need to do the filtering.

Definition at line 232 of file fios.cpp.

## Member Function Documentation

bool FiosFileScanner::AddFile | ( | const char * | filename,
|  | size_t | basepath_length,
|  | const char * | tar_filename
| ) |  |
| virtual

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 246 of file fios.cpp.

References SmallVector< T, S >::Append(), SmallVector< T, S >::Begin(), callback_proc, SmallVector< T, S >::End(), lastof, mode, OTTD2FS(), str_validate(), strecpy(), and StrEmpty().

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

- src/fios.cpp