OpenXcom  1.0
Open-source clone of the original X-Com
Functions
OpenXcom::FileMap Namespace Reference

Maps canonical names to file paths and maintains the virtual file system for resource files. More...

Functions

const std::string & getFilePath (const std::string &relativeFilePath)
 Gets the real filesystem path for a data file when given a relative (case insensitive) path, like "units/zombie.pck". If the file has not been mapped via the load() function, the input path is returned verbatim (for use in error messages when the file is ultimately not found).
 
const std::set< std::string > & getVFolderContents (const std::string &relativePath)
 Returns the set of files in a virtual folder. The virtual folder contains files from all active mods that are in similarly-named subdirectories. The returned file names can then be translated to real filesystem paths via getFilePath()
 
std::set< std::string > filterFiles (const std::vector< std::string > &files, const std::string &ext)
 Returns the subset of the given files that matches the given extension.
 
const std::vector< std::pair< std::string, std::vector< std::string > > > & getRulesets ()
 Returns the ruleset files found, grouped by mod, while mapping resources. The highest-priority mod will be last in the returned vector.
 
void clear ()
 clears FileMap state
 
void load (const std::string &modId, const std::string &path, bool ignoreMods)
 Scans a directory tree rooted at the specified filesystem path. Any files it encounters that have already been mapped will be ignored. Therefore, load files from mods with the highest priority first. If ignoreMods is false, it will add any rulesets it finds to the front of the vector returned by getMods().
 
bool isResourcesEmpty (void)
 Determines if _resources set is empty.
 

Detailed Description

Maps canonical names to file paths and maintains the virtual file system for resource files.