36 IniEntry(
const string & i_section,
const string & i_key,
const string & i_value);
42 bool equalTo(
const char * i_section,
const char * i_key)
const;
46 void setKey(
const string & i_key);
49 void setValue(
const string & i_value);
56 typedef vector<IniEntry> IniEntryVec;
64 IniFileReader(
const char * i_filePath,
const char * i_codePageName =
nullptr);
67 bool isLoaded(
void)
const noexcept {
return is_loaded; }
70 bool isExist(
const char * i_section,
const char * i_key)
const noexcept;
73 bool isExist(
const char * i_sectionKey)
const noexcept;
76 const string strValue(
const char * i_section,
const char * i_key,
const string & i_default =
"") const noexcept;
79 const
string strValue(const
char * i_sectionKey, const
string & i_default = "") const noexcept;
82 const IniEntryVec &
rowsCRef(
void)
const {
return entryVec; }
91 static void loadMessages(
const char * i_iniMsgPath,
const string & i_language =
"",
const char * i_codePageName =
nullptr) noexcept;
97 static list<pair<
string, unordered_map<
string,
string>>>
loadAllMessages(const
char * i_iniMsgPath, const
char * i_codePageName =
nullptr) noexcept;
101 IniEntryVec entryVec;
109 static const IniEntryVec load(const
char * i_filePath,
bool is_noCase, const
char * i_codePageName);
112 ptrdiff_t findIndex(const
char * i_section, const
char * i_key) const;
115 ptrdiff_t findIndex(const
char * i_sectionKey) const;
120 static
bool addIniEntry(
121 bool is_noCase, const
string & i_src,
int i_nLine, const
string & i_section, const
string & i_key, const
string & i_value, IniEntryVec & o_entryVec
ini-file reader: load all entries in memory and provide search methods.
Definition: iniReader.h:54
const IniEntryVec & rowsCRef(void) const
return const reference to ini-file entries.
Definition: iniReader.h:82
bool isLoaded(void) const noexcept
return true if ini-file loaded correctly or false on error
Definition: iniReader.h:67
const NoCaseMap getSection(const char *i_section) const noexcept
return section by name as case-neutral map of (key,value).
Definition: iniReader.cpp:411
IniFileReader(const char *i_filePath, const char *i_codePageName=nullptr)
load all ini-file entries in memory and convert into UTF-8.
Definition: iniReader.cpp:57
static list< pair< string, unordered_map< string, string > > > loadAllMessages(const char *i_iniMsgPath, const char *i_codePageName=nullptr) noexcept
read language specific messages from path/to/theExe.message.ini for all languages
Definition: iniReader.cpp:516
bool isExist(const char *i_section, const char *i_key) const noexcept
return true if section and key found in ini-file using case-neutral search.
Definition: iniReader.cpp:344
const NoCaseSet sectionSet(void) const noexcept
return names of ini-file sections as case-neutral set of strings.
Definition: iniReader.cpp:396
const string strValue(const char *i_section, const char *i_key, const string &i_default="") const noexcept
return string value by section and key using case-neutral search, or default value if not found.
Definition: iniReader.cpp:366
static void loadMessages(const char *i_iniMsgPath, const string &i_language="", const char *i_codePageName=nullptr) noexcept
read language specific messages from path/to/theExe.message.ini and pass it to the log
Definition: iniReader.cpp:470
openM++ namespace
Definition: log.h:32
std::map< std::string, std::string, LessNoCase > NoCaseMap
map of key-value strings with case neutral key search
Definition: omHelper.h:224
std::set< std::string, LessNoCase > NoCaseSet
set of strings with case neutral key search
Definition: omHelper.h:227
OpenM++ common file utilities.
Ini-file entry: setcion, key and value.
Definition: iniReader.h:19
IniEntry(const string &i_section, const string &i_key, const string &i_value)
initialize ini-file entry.
Definition: iniReader.cpp:429
bool equalTo(const char *i_section, const char *i_key) const
ini-file entry section and key using case neutral equal comparison.
Definition: iniReader.cpp:464
bool bySectionKey(const char *i_sectionKey) const
ini-file entry section.key using case neutral equal comparison.
Definition: iniReader.cpp:458
string section
section: in lower case, without [], space trimed
Definition: iniReader.h:21
string key
key: in lower case, without =, space trimed
Definition: iniReader.h:24
string val
value: space trimed and unquoted ("quotes" or 'apostrophes' removed)
Definition: iniReader.h:27