OpenM++ runtime library (libopenm)
openm::IniFileReader Class Reference

ini-file reader: load all entries in memory and provide search methods. More...

Public Member Functions

 IniFileReader (const char *i_filePath, const char *i_codePageName=nullptr)
 load all ini-file entries in memory and convert into UTF-8. More...
 
bool isLoaded (void) const noexcept
 return true if ini-file loaded correctly or false on error
 
bool isExist (const char *i_section, const char *i_key) const noexcept
 return true if section and key exist in ini-file. More...
 
bool isExist (const char *i_sectionKey) const noexcept
 return true if section.key exist in ini-file. More...
 
const string strValue (const char *i_section, const char *i_key, const string &i_default="") const noexcept
 return string value by section and key or deafult value if not found. More...
 
const string strValue (const char *i_sectionKey, const string &i_default="") const noexcept
 return string value by section.key or deafult value if not found. More...
 
const NoCaseSet sectionSet (void) const noexcept
 return names of ini-file sections as case-neutral set of strings. More...
 
const NoCaseMap getSection (const char *i_section) const noexcept
 return section by name as case-neutral map of (key,value). More...
 

Static Public Member Functions

static void loadMessages (const char *i_iniMsgPath, const string &i_language="") noexcept
 read language specific messages from path/to/theExe.message.ini and pass it to the log
 

Detailed Description

ini-file reader: load all entries in memory and provide search methods.

Constructor & Destructor Documentation

◆ IniFileReader()

IniFileReader::IniFileReader ( const char *  i_filePath,
const char *  i_codePageName = nullptr 
)

load all ini-file entries in memory and convert into UTF-8.

Parameters
[in]i_filePathpath to ini-file.
[in]i_codePageName(optional) name of encoding or Windows code page, ie: English_US.1252

Member Function Documentation

◆ getSection()

const NoCaseMap IniFileReader::getSection ( const char *  i_section) const
noexcept

return section by name as case-neutral map of (key,value).

◆ isExist() [1/2]

bool IniFileReader::isExist ( const char *  i_section,
const char *  i_key 
) const
noexcept

return true if section and key exist in ini-file.

◆ isExist() [2/2]

bool IniFileReader::isExist ( const char *  i_sectionKey) const
noexcept

return true if section.key exist in ini-file.

◆ sectionSet()

const NoCaseSet IniFileReader::sectionSet ( void  ) const
noexcept

return names of ini-file sections as case-neutral set of strings.

◆ strValue() [1/2]

const string IniFileReader::strValue ( const char *  i_section,
const char *  i_key,
const string &  i_default = "" 
) const
noexcept

return string value by section and key or deafult value if not found.

◆ strValue() [2/2]

const string IniFileReader::strValue ( const char *  i_sectionKey,
const string &  i_default = "" 
) const
noexcept

return string value by section.key or deafult value if not found.


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