Class inih::INIReader¶
Public Functions¶
Type | Name |
---|---|
const std::unordered_map< std::string, std::string > | Get (std::string section) const |
T | Get (const std::string & section, const std::string & name) Return the value of the given key in the given section. |
T | Get (const std::string & section, const std::string & name, T & default_v) Return the value of the given key in the given section, return default if not found. |
std::vector< T > | GetVector (const std::string & section, const std::string & name) Return the value array of the given key in the given section. |
std::vector< T > | GetVector (const std::string & section, const std::string & name, const std::vector< T > & default_v) Return the value array of the given key in the given section, return default if not found. |
INIReader () | |
INIReader (std::string filename) | |
INIReader (FILE * file) | |
void | InsertEntry (const std::string & section, const std::string & name, const T & v) |
void | InsertEntry (const std::string & section, const std::string & name, const std::vector< T > & vs) |
const std::set< std::string > | Keys (std::string section) const Return the list of keys in the given section. |
int | ParseError () const |
const std::set< std::string > | Sections () const Return the list of sections found in ini file. |
void | UpdateEntry (const std::string & section, const std::string & name, const T & v) |
void | UpdateEntry (const std::string & section, const std::string & name, const std::vector< T > & vs) |
Protected Attributes¶
Type | Name |
---|---|
int | _error |
std::unordered_map< std::string, std::unordered_map< std::string, std::string > > | _values |
Protected Functions¶
Type | Name |
---|---|
const bool | BoolConverter (std::string s) const |
T | Converter (const std::string & s) const |
std::string | V2String (const T & v) const |
std::string | Vec2String (const std::vector< T > & v) const |
Protected Static Functions¶
Type | Name |
---|---|
int | ValueHandler (void * user, const char * section, const char * name, const char * value) |
Public Functions Documentation¶
function Get [⅓]¶
inline const std::unordered_map< std::string, std::string > inih::INIReader::Get (
std::string section
) const
function Get [⅔]¶
Return the value of the given key in the given section.
template<typename T>
inline T inih::INIReader::Get (
const std::string & section,
const std::string & name
)
Parameters:
section
The section namename
The key name
Returns:
The value of the given key in the given section
function Get [3/3]¶
Return the value of the given key in the given section, return default if not found.
template<typename T>
inline T inih::INIReader::Get (
const std::string & section,
const std::string & name,
T & default_v
)
Parameters:
section
The section namename
The key namedefault_v
The default value
Returns:
The value of the given key in the given section, return default if not found
function GetVector [½]¶
Return the value array of the given key in the given section.
template<typename T>
inline std::vector< T > inih::INIReader::GetVector (
const std::string & section,
const std::string & name
)
Parameters:
section
The section namename
The key name
Returns:
The value array of the given key in the given section.
For example:
function GetVector [2/2]¶
Return the value array of the given key in the given section, return default if not found.
template<typename T>
inline std::vector< T > inih::INIReader::GetVector (
const std::string & section,
const std::string & name,
const std::vector< T > & default_v
)
Parameters:
section
The section namename
The key namedefault_v
The default value
Returns:
The value array of the given key in the given section, return default if not found
See also: INIReader::GetVector
function INIReader [⅓]¶
function INIReader [⅔]¶
function INIReader [3/3]¶
function InsertEntry [½]¶
template<typename T>
inline void inih::INIReader::InsertEntry (
const std::string & section,
const std::string & name,
const T & v
)
function InsertEntry [2/2]¶
template<typename T>
inline void inih::INIReader::InsertEntry (
const std::string & section,
const std::string & name,
const std::vector< T > & vs
)
function Keys¶
Return the list of keys in the given section.
Parameters:
section
The section name
Returns:
The list of keys in the given section
function ParseError¶
function Sections¶
Return the list of sections found in ini file.
Returns:
The list of sections found in ini file
function UpdateEntry [½]¶
template<typename T>
inline void inih::INIReader::UpdateEntry (
const std::string & section,
const std::string & name,
const T & v
)
function UpdateEntry [2/2]¶
template<typename T>
inline void inih::INIReader::UpdateEntry (
const std::string & section,
const std::string & name,
const std::vector< T > & vs
)
Protected Attributes Documentation¶
variable _error¶
variable _values¶
std::unordered_map<std::string, std::unordered_map<std::string, std::string> > inih::INIReader::_values;
Protected Functions Documentation¶
function BoolConverter¶
function Converter¶
function V2String¶
function Vec2String¶
template<typename T>
inline std::string inih::INIReader::Vec2String (
const std::vector< T > & v
) const
Protected Static Functions Documentation¶
function ValueHandler¶
static inline int inih::INIReader::ValueHandler (
void * user,
const char * section,
const char * name,
const char * value
)
The documentation for this class was generated from the following file src/utils/Ini.h