libthinkpad  2.6
https://github.com/libthinkpad
Public Member Functions | Public Attributes | List of all members
ThinkPad::Utilities::Ini::IniSection Class Reference
Collaboration diagram for ThinkPad::Utilities::Ini::IniSection:
Collaboration graph
[legend]

Public Member Functions

 IniSection ()
 construct a new ini section
 
 IniSection (const char *name)
 construct a new ini section with the name pre-defined More...
 
const char * getString (const char *key) const
 get a string from the section More...
 
const void setString (const char *key, const char *value)
 set a string in the section with the key More...
 
const int getInt (const char *key) const
 get an int from the section More...
 
const void setInt (const char *key, const int value)
 set a int in the section with the key More...
 
const vector< int > getIntArray (const char *key) const
 Get an array (vector) of ints from the section. More...
 
const void setIntArray (const char *key, vector< int > *values)
 Set an array (vector) of ints into the section. More...
 
const void setStringArray (const char *key, const vector< const char * > *strings)
 Get an array (vector) of strings from the section. More...
 
const vector< const char * > getStringArray (const char *key)
 Get an array (vector) of strings from the section. More...
 

Public Attributes

char name [128]
 
vector< IniKeypair * > * keypairs = nullptr
 

Constructor & Destructor Documentation

ThinkPad::Utilities::Ini::IniSection::IniSection ( const char *  name)

construct a new ini section with the name pre-defined

Parameters
name

Member Function Documentation

const int ThinkPad::Utilities::Ini::IniSection::getInt ( const char *  key) const

get an int from the section

WARNING: this uses atoi() so be careful

Parameters
keythe key of the int
Returns
the int itself
const vector< int > ThinkPad::Utilities::Ini::IniSection::getIntArray ( const char *  key) const

Get an array (vector) of ints from the section.

Parameters
keythe key of the array
Returns
the vector with the values or an empty vector if no keys are present
const char * ThinkPad::Utilities::Ini::IniSection::getString ( const char *  key) const

get a string from the section

Parameters
keythe key of the string
Returns
the string or nullptr
const vector< const char * > ThinkPad::Utilities::Ini::IniSection::getStringArray ( const char *  key)

Get an array (vector) of strings from the section.

Parameters
keythe key of the array
Returns
the vector with the values or an empty vector if no keys are present
const void ThinkPad::Utilities::Ini::IniSection::setInt ( const char *  key,
const int  value 
)

set a int in the section with the key

Parameters
keythe key to set
valuethe value to set
const void ThinkPad::Utilities::Ini::IniSection::setIntArray ( const char *  key,
vector< int > *  values 
)

Set an array (vector) of ints into the section.

Parameters
keythe key of the array to set
valuesthe vector with the values
const void ThinkPad::Utilities::Ini::IniSection::setString ( const char *  key,
const char *  value 
)

set a string in the section with the key

Parameters
keythe key to set
valuethe value to set
const void ThinkPad::Utilities::Ini::IniSection::setStringArray ( const char *  key,
const vector< const char * > *  strings 
)

Get an array (vector) of strings from the section.

Parameters
keythe key of the array
Returns
the vector with the values

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