ScummVM API documentation
Ultima::Ultima8::ConfigFileManager Class Reference

Classes

struct  ConfigFile
 

Public Member Functions

bool readConfigFile (const Common::Path &fname, const Std::string &category)
 
void clear ()
 clear everything
 
void clearRoot (const Std::string &category)
 clear everything in a root
 
bool get (const Std::string &category, const Std::string &section, const Std::string &key, Std::string &ret) const
 get value
 
bool get (const Std::string &category, const Std::string &section, const Std::string &key, int &ret) const
 get value
 
bool get (const Std::string &category, const Std::string &section, const Std::string &key, bool &ret) const
 get value
 
Std::vector< Std::stringlistSections (const Std::string &category) const
 
KeyMap listKeyValues (const Std::string &category, const Std::string &section) const
 

Static Public Member Functions

static ConfigFileManagerget_instance ()
 

Member Function Documentation

◆ readConfigFile()

bool Ultima::Ultima8::ConfigFileManager::readConfigFile ( const Common::Path fname,
const Std::string category 
)

read a config file. Multiple files may be read. Order is important.

Parameters
fnameThe file to read
rootThe name of the root node in the file
readonlyIf true, don't write to this file's tree (or the file)
Returns
true if successful

◆ listSections()

Std::vector<Std::string> Ultima::Ultima8::ConfigFileManager::listSections ( const Std::string category) const

list all sections

Parameters
categoryThe config category to list all sections in
Returns
the sections. They have no guaranteed order.

◆ listKeyValues()

KeyMap Ultima::Ultima8::ConfigFileManager::listKeyValues ( const Std::string category,
const Std::string section 
) const

list all key-value pairs in the given section.

Parameters
categoryThe config category for the section to list
sectionThe section to list
Returns
the key-value pairs. They have no guaranteed order.

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