Advanced Strategic Command
Classes | Public Types | Public Member Functions | List of all members
tfindfile Class Reference

Searching for files. More...

#include <basestrm.h>

Classes

struct  FileInfo
 

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. More...
 
ASCString getnextname (int *loc=NULL, bool *inContainer=NULL, ASCString *location=NULL)
 Returns the next entry of the internal file list. More...
 
bool getnextname (FileInfo &fi)
 
int getFoundFileNum ()
 

Detailed Description

Searching for files.

Definition at line 484 of file basestrm.h.

Member Enumeration Documentation

Enumerator
DefaultDir 
CurrentDir 
PrimaryDir 
AllDirs 

Definition at line 527 of file basestrm.h.

Enumerator
InsideContainer 
OutsideContainer 
All 

Definition at line 528 of file basestrm.h.

Constructor & Destructor Documentation

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 2030 of file basestrm.cpp.

References All, AllDirs, ASC_direct, ascDirectory, closedir(), constructFileName(), ContainerCollector::FileIndex::container, convertPathDelimitters(), CurrentDir, tfindfile::FileInfo::date, DefaultDir, tfindfile::FileInfo::directoryLevel, ContainerCollector::FileIndex::directoryLevel, ContainerCollector::getfirstname(), ContainerCollector::getnextname(), has_drive_letters, InsideContainer, tfindfile::FileInfo::isInContainer, tfindfile::FileInfo::location, maxSearchDirNum, tfindfile::FileInfo::name, ContainerCollector::FileIndex::name, opendir(), OutsideContainer, pathdelimitter, pathdelimitterstring, patimat(), readdir(), searchDirNum, tfindfile::FileInfo::size, strcmpi, and stricmp.

Member Function Documentation

int tfindfile::getFoundFileNum ( )
inline

Definition at line 546 of file basestrm.h.

Referenced by StartMultiplayerGame::Apply(), and Locale::getLocalizedFile().

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:

Parameters
loccontains the number of the directory. ASC can search several directories for files. These directories are specified in the ASC configuration file and CGameOptions
inContainerreturns whether the file is inside a ASC archive file ( like main.con )
locationcontains the directory this file resides in

Definition at line 2211 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(), MusicPlayList::reset(), SaveGameBaseDialog::SaveGameBaseDialog(), SavegameSelectionItemFactory::SavegameSelectionItemFactory(), and FileTransfer::send().

bool tfindfile::getnextname ( FileInfo fi)

Definition at line 2239 of file basestrm.cpp.


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