Made on Kubuntu
Section of ini file. More...
#include <inisection.h>
Public Member Functions | |
const char * | GetName () const |
std::string | GetNameSTL () const |
unsigned | GetLength () const |
void | Reset () |
Resets iteration. | |
bool | Next () |
Advance iteration to the next tag. | |
const char * | CurrentTag () const |
std::string | CurrentTagSTL () const |
bool | ReadString (const char *const name, const char *&out) const |
Read a string value from given tag. | |
bool | ReadString (const std::string &name, std::string &out) const |
Read a string value from given tag. (STL version). | |
bool | ReadInt (const char *const name, int &out) const |
Read an int value from given tag. | |
bool | ReadInt (const std::string &name, int &out) const |
Read an int value from given tag. (STL version). | |
bool | ReadFloat (const char *const name, float &out) const |
Read a float value from given tag. | |
bool | ReadFloat (const std::string &name, float &out) const |
Read a float value from given tag. (STL version). | |
bool | ReadBool (const char *const name, bool &out) const |
Read a bool value from given tag. | |
bool | ReadBool (const std::string &name, bool &out) const |
Read a bool value from given tag. (STL version). | |
unsigned | MultiValSize (const char *const name) const |
Determine number of values in given tag. | |
unsigned | ReadMultiString (const char *const name, const char **out, const unsigned cap) const |
Read an array of strings from a multi value tag with given name. | |
unsigned | ReadMultiString (const std::string &name, std::vector< std::string > &out) const |
Read an array of strings from a multi value tag with given name. (STL version). | |
unsigned | ReadMultiInt (const char *const name, int *out, const unsigned cap) const |
Read an array of ints from a multi value tag with given name. | |
unsigned | ReadMultiInt (const std::string &name, std::vector< int > &out) const |
Read an array of ints from a multi value tag with given name. (STL version). | |
unsigned | ReadMultiFloat (const char *const name, float *out, const unsigned cap) const |
Read an array of floats from a multi value tag with given name. | |
unsigned | ReadMultiFloat (const std::string &name, std::vector< float > &out) const |
Read an array of floats from a multi value tag with given name. (STL version). | |
unsigned | ReadMultiBool (const char *const name, bool *out, const unsigned cap) const |
Read an array of bools from a multi value tag with given name. | |
unsigned | ReadMultiBool (const std::string &name, std::vector< bool > &out) const |
Read an array of bools from a multi value tag with given name. (STL version). | |
unsigned | ArraySize (const char *const name) const |
Determine size of array of tags with given base name. | |
unsigned | ReadStrings (const char *const name, const char **out, const unsigned cap) const |
Read an array of strings with given base name. | |
unsigned | ReadStrings (const std::string &name, std::vector< std::string > &out) const |
Read an array of strings with given base name. (STL version). | |
unsigned | ReadInts (const char *const name, int *out, const unsigned cap) const |
Read an array of ints with given base name. | |
unsigned | ReadInts (const std::string &name, std::vector< int > &out) const |
Read an array of ints with given base name. (STL version). | |
unsigned | ReadFloats (const char *const name, float *out, const unsigned cap) const |
Read an array of floats with given base name. | |
unsigned | ReadFloats (const std::string &name, std::vector< float > &out) const |
Read an array of floats with given base name. (STL version). | |
unsigned | ReadBools (const char *const name, bool *out, const unsigned cap) const |
Read an array of bools with given base name. | |
unsigned | ReadBools (const std::string &name, std::vector< bool > &out) const |
Read an array of bools with given base name. (STL version). |
Section of ini file.
Stores tags of an ini file section.
Definition at line 25 of file inisection.h.
unsigned INISection::ArraySize | ( | const char *const | name | ) | const |
Determine size of array of tags with given base name.
Counts tags named name1=, name2=, etc. where name is the given base name for the tags.
name | Base name of tags in the array. Must be a valid zero terminated string. |
Definition at line 498 of file inisection.cpp.
const char* INISection::CurrentTag | ( | ) | const [inline] |
Definition at line 100 of file inisection.h.
std::string INISection::CurrentTagSTL | ( | ) | const [inline] |
Definition at line 111 of file inisection.h.
unsigned INISection::GetLength | ( | ) | const [inline] |
Definition at line 73 of file inisection.h.
const char* INISection::GetName | ( | ) | const [inline] |
Definition at line 59 of file inisection.h.
std::string INISection::GetNameSTL | ( | ) | const [inline] |
Definition at line 66 of file inisection.h.
unsigned INISection::MultiValSize | ( | const char *const | name | ) | const |
Determine number of values in given tag.
name | Name of tag. Must be a valid zero terminated string. |
Definition at line 264 of file inisection.cpp.
bool INISection::Next | ( | ) | [inline] |
Advance iteration to the next tag.
Definition at line 89 of file inisection.h.
bool INISection::ReadBool | ( | const std::string & | name, | |
bool & | out | |||
) | const [inline] |
Read a bool value from given tag. (STL version).
If the tag has multiple values, the first value is read.
name | Name of the tag to read from. | |
out | Reference to variable to read to. If tag not found, out won't be chaged. |
Definition at line 227 of file inisection.h.
bool INISection::ReadBool | ( | const char *const | name, | |
bool & | out | |||
) | const |
Read a bool value from given tag.
If the tag has multiple values, the first value is read.
name | Name of the tag to read from. Must be a valid zero terminated string. | |
out | Reference to variable to read to. If tag not found, out won't be chaged. |
Definition at line 228 of file inisection.cpp.
unsigned INISection::ReadBools | ( | const std::string & | name, | |
std::vector< bool > & | out | |||
) | const |
Read an array of bools with given base name. (STL version).
Reads values from tags named name1=, name2=, etc. where name is the given base name for the tags. This version of ReadBools will read as many elements as there are in the ini file to given vector. If any array tag has multiple values, the first value is read.
name | Base name of the tags to read from. | |
out | Reference to the vector to read to. |
Definition at line 742 of file inisection.cpp.
unsigned INISection::ReadBools | ( | const char *const | name, | |
bool * | out, | |||
const unsigned | cap | |||
) | const |
Read an array of bools with given base name.
Reads values from tags named name1=, name2=, etc. where name is the given base name for the tags. If any array tag has multiple values, the first value is read.
name | Base name of the tags to read from. Must be a valid zero terminated string. | |
out | Pointer to buffer to read to. | |
cap | Capacity of the buffer. |
Definition at line 671 of file inisection.cpp.
bool INISection::ReadFloat | ( | const std::string & | name, | |
float & | out | |||
) | const [inline] |
Read a float value from given tag. (STL version).
If the tag has multiple values, the first value is read.
name | Name of the tag to read from. | |
out | Reference to variable to read to. If tag not found, out won't be chaged. |
Definition at line 202 of file inisection.h.
bool INISection::ReadFloat | ( | const char *const | name, | |
float & | out | |||
) | const |
Read a float value from given tag.
If the tag has multiple values, the first value is read.
name | Name of the tag to read from. Must be a valid zero terminated string. | |
out | Reference to variable to read to. If tag not found, out won't be chaged. |
Definition at line 189 of file inisection.cpp.
unsigned INISection::ReadFloats | ( | const std::string & | name, | |
std::vector< float > & | out | |||
) | const |
Read an array of floats with given base name. (STL version).
Reads values from tags named name1=, name2=, etc. where name is the given base name for the tags. This version of ReadFloats will read as many elements as there are in the ini file to given vector. If any array tag has multiple values, the first value is read.
name | Base name of the tags to read from. | |
out | Reference to the vector to read to. |
Definition at line 724 of file inisection.cpp.
unsigned INISection::ReadFloats | ( | const char *const | name, | |
float * | out, | |||
const unsigned | cap | |||
) | const |
Read an array of floats with given base name.
Reads values from tags named name1=, name2=, etc. where name is the given base name for the tags. in wrong order, e.g. name4= after name2= . If any array tag has multiple values, the first value is read.
name | Base name of the tags to read from. Must be a valid zero terminated string. | |
out | Pointer to buffer to read to. | |
cap | Capacity of the buffer. |
Definition at line 655 of file inisection.cpp.
bool INISection::ReadInt | ( | const std::string & | name, | |
int & | out | |||
) | const [inline] |
Read an int value from given tag. (STL version).
If the tag has multiple values, the first value is read.
name | Name of the tag to read from. | |
out | Reference to variable to read to. If tag not found, out won't be chaged. |
Definition at line 177 of file inisection.h.
bool INISection::ReadInt | ( | const char *const | name, | |
int & | out | |||
) | const |
Read an int value from given tag.
If the tag has multiple values, the first value is read.
name | Name of the tag to read from. Must be a valid zero terminated string. | |
out | Reference to variable to read to. If tag not found, out won't be chaged. |
Definition at line 151 of file inisection.cpp.
unsigned INISection::ReadInts | ( | const std::string & | name, | |
std::vector< int > & | out | |||
) | const |
Read an array of ints with given base name. (STL version).
Reads values from tags named name1=, name2=, etc. where name is the given base name for the tags. This version of ReadInts will read as many elements as there are in the ini file to given vector. If any array tag has multiple values, the first value is read.
name | Base name of the tags to read from. | |
out | Reference to the vector to read to. |
Definition at line 706 of file inisection.cpp.
unsigned INISection::ReadInts | ( | const char *const | name, | |
int * | out, | |||
const unsigned | cap | |||
) | const |
Read an array of ints with given base name.
Reads values from tags named name1=, name2=, etc. where name is the given base name for the tags. If any array tag has multiple values, the first value is read.
name | Base name of the tags to read from. Must be a valid zero terminated string. | |
out | Pointer to buffer to read to. | |
cap | Capacity of the buffer. |
Definition at line 639 of file inisection.cpp.
unsigned INISection::ReadMultiBool | ( | const std::string & | name, | |
std::vector< bool > & | out | |||
) | const |
Read an array of bools from a multi value tag with given name. (STL version).
Reads bools from comma separated values in the tag.
name | Name of the tag to read from. | |
out | Reference to the vector to read to. |
Definition at line 479 of file inisection.cpp.
unsigned INISection::ReadMultiBool | ( | const char *const | name, | |
bool * | out, | |||
const unsigned | cap | |||
) | const |
Read an array of bools from a multi value tag with given name.
Reads bools from comma separated values in the tag.
name | Name of the tag to read from. Must be a valid zero terminated string. | |
out | Pointer to buffer to read to. | |
cap | Capacity of the buffer. |
Definition at line 408 of file inisection.cpp.
unsigned INISection::ReadMultiFloat | ( | const std::string & | name, | |
std::vector< float > & | out | |||
) | const |
Read an array of floats from a multi value tag with given name. (STL version).
Reads floats from comma separated values in the tag.
name | Name of the tag to read from. | |
out | Reference to the vector to read to. |
Definition at line 461 of file inisection.cpp.
unsigned INISection::ReadMultiFloat | ( | const char *const | name, | |
float * | out, | |||
const unsigned | cap | |||
) | const |
Read an array of floats from a multi value tag with given name.
Reads floats from comma separated values in the tag.
name | Name of the tag to read from. Must be a valid zero terminated string. | |
out | Pointer to buffer to read to. | |
cap | Capacity of the buffer. |
Definition at line 392 of file inisection.cpp.
unsigned INISection::ReadMultiInt | ( | const std::string & | name, | |
std::vector< int > & | out | |||
) | const |
Read an array of ints from a multi value tag with given name. (STL version).
Reads ints from comma separated values in the tag.
name | Name of the tag to read from. | |
out | Reference to the vector to read to. |
Definition at line 443 of file inisection.cpp.
unsigned INISection::ReadMultiInt | ( | const char *const | name, | |
int * | out, | |||
const unsigned | cap | |||
) | const |
Read an array of ints from a multi value tag with given name.
Reads ints from comma separated values in the tag.
name | Name of the tag to read from. Must be a valid zero terminated string. | |
out | Pointer to buffer to read to. | |
cap | Capacity of the buffer. |
Definition at line 376 of file inisection.cpp.
unsigned INISection::ReadMultiString | ( | const std::string & | name, | |
std::vector< std::string > & | out | |||
) | const |
Read an array of strings from a multi value tag with given name. (STL version).
Reads strings from comma separated values in the tag.
name | Name of the tag to read from. | |
out | Reference to the vector to read to. |
Definition at line 425 of file inisection.cpp.
unsigned INISection::ReadMultiString | ( | const char *const | name, | |
const char ** | out, | |||
const unsigned | cap | |||
) | const |
Read an array of strings from a multi value tag with given name.
Reads strings from comma separated values in the tag.
name | Name of the tag to read from. Must be a valid zero terminated string. | |
out | Pointer to buffer to read to. | |
cap | Capacity of the buffer. |
Definition at line 311 of file inisection.cpp.
bool INISection::ReadString | ( | const std::string & | name, | |
std::string & | out | |||
) | const [inline] |
Read a string value from given tag. (STL version).
Unlike non-STL ReadString, string data does get copied here (using std::string constructor) so there is no need to copy it manually. If the tag has multiple values, the first value is read.
name | Name of the tag to read from. | |
out | Reference to variable to read to. If tag not found, out won't be chaged. |
Definition at line 146 of file inisection.h.
bool INISection::ReadString | ( | const char *const | name, | |
const char *& | out | |||
) | const [inline] |
Read a string value from given tag.
name | Name of the tag to read from. Must be a valid zero terminated string. | |
out | Reference to variable to read to. If tag not found, out won't be chaged. |
Definition at line 125 of file inisection.cpp.
unsigned INISection::ReadStrings | ( | const std::string & | name, | |
std::vector< std::string > & | out | |||
) | const |
Read an array of strings with given base name. (STL version).
Reads values from tags named name1=, name2=, etc. where name is the given base name for the tags. This version of ReadStrings will read as many elements as there are in the ini file to given vector. If any array tag has multiple values, the first value is read.
name | Base name of the tags to read from. | |
out | Reference to the vector to read to. |
Definition at line 688 of file inisection.cpp.
unsigned INISection::ReadStrings | ( | const char *const | name, | |
const char ** | out, | |||
const unsigned | cap | |||
) | const |
Read an array of strings with given base name.
Reads values from tags named name1=, name2=, etc. where name is the given base name for the tags. If any array tag has multiple values, the first value is read.
name | Base name of the tags to read from. Must be a valid zero terminated string. | |
out | Pointer to buffer to read to. | |
cap | Capacity of the buffer. |
Definition at line 569 of file inisection.cpp.
void INISection::Reset | ( | ) | [inline] |
Resets iteration.
Definition at line 79 of file inisection.h.