#include <basestrm.h>
Public Types | |
| enum | SearchPosition { DefaultDir, CurrentDir, PrimaryDir, AllDirs } |
| enum | SearchTypes { InsideContainer, OutsideContainer, All } |
Public Member Functions | |
| tfindfile (ASCString name, SearchPosition searchPosition=DefaultDir, SearchTypes searchTypes=All) | |
| Searches for files matching the wildcard name in all search paths specified for ASC and inside the ASC archive files. | |
| ASCString | getnextname (int *loc=NULL, bool *inContainer=NULL, ASCString *location=NULL) |
| Returns the next entry of the internal file list. | |
| bool | getnextname (FileInfo &fi) |
| int | getFoundFileNum () |
Classes | |
| struct | FileInfo |
Definition at line 484 of file basestrm.h.
| tfindfile::tfindfile | ( | ASCString | name, | |
| SearchPosition | searchPosition = DefaultDir, |
|||
| SearchTypes | searchTypes = All | |||
| ) |
Searches for files matching the wildcard name in all search paths specified for ASC and inside the ASC archive files.
If name contains a relative directory entry ( like music / *.mp3 ), searchPosition specifies, which directories will be searched for the file. Note that "Current" may be problematic in Unix environments, because the program may be started from any directory.
Definition at line 2016 of file basestrm.cpp.
References All, AllDirs, ASC_direct, ascDirectory, closedir(), constructFileName(), ContainerCollector::FileIndex::container, containercollector, convertPathDelimitters(), CurrentDir, tfindfile::FileInfo::date, DefaultDir, ContainerCollector::FileIndex::directoryLevel, tfindfile::FileInfo::directoryLevel, tn_file_buf_stream::get_time(), tnstream::getDeviceName(), ContainerCollector::getfirstname(), ContainerCollector::getnextname(), tn_file_buf_stream::getstreamsize(), has_drive_letters, InsideContainer, tfindfile::FileInfo::isInContainer, tfindfile::FileInfo::location, maxSearchDirNum, ContainerCollector::FileIndex::name, tfindfile::FileInfo::name, opendir(), OutsideContainer, pathdelimitter, pathdelimitterstring, patimat(), readdir(), searchDirNum, tfindfile::FileInfo::size, strcmpi, and stricmp.
| ASCString tfindfile::getnextname | ( | int * | loc = NULL, |
|
| bool * | inContainer = NULL, |
|||
| ASCString * | location = NULL | |||
| ) |
Returns the next entry of the internal file list.
Optionally, some additional information about the file can be returned:
| loc | contains the number of the directory. ASC can search several directories for files. These directories are specified in the ASC configuration file and CGameOptions | |
| inContainer | returns whether the file is inside a ASC archive file ( like main.con ) | |
| location | contains the directory this file resides in |
Definition at line 2197 of file basestrm.cpp.
Referenced by StartMultiplayerGame::Apply(), continueNetworkGame(), exist(), FileCache::FileCache(), FileSelectionItemFactory::FileSelectionItemFactory(), findNextCampaignMap(), Locale::getLocalizedFile(), getnextfilenumname(), loadalltextfiles(), GraphicSetManager_Base::loadData(), loadGame(), loadmessages(), loadStartupMap(), loadUnitSets(), process_ASC_map(), process_BI_map(), readtextmessage(), SaveGameBaseDialog::SaveGameBaseDialog(), SavegameSelectionItemFactory::SavegameSelectionItemFactory(), and FileTransfer::send().
| bool tfindfile::getnextname | ( | FileInfo & | fi | ) |
Definition at line 2225 of file basestrm.cpp.
| int tfindfile::getFoundFileNum | ( | ) | [inline] |
Definition at line 546 of file basestrm.h.
Referenced by StartMultiplayerGame::Apply(), and Locale::getLocalizedFile().
1.5.1