Made on Kubuntu
Handles reading of data from a single INI section. More...
#include <inisection.h>
Public Member Functions | |
const char * | GetName () const |
Gets name of this section. | |
std::string | GetNameSTL () const |
Gets name of this section (STL version). | |
unsigned | GetLength () const |
Gets number of tags in the section. | |
void | Reset () |
Resets iteration. | |
bool | Next () |
Advance iteration to the next tag. | |
const char * | CurrentTag () const |
Get name of the current tag. | |
std::string | CurrentTagSTL () const |
Get name of the current tag (STL version). | |
bool | ReadString (const char *const name, const char *&out) const |
Read a string from a tag. | |
bool | ReadString (const std::string &name, std::string &out) const |
Read a string from a tag (STL version). | |
bool | ReadInt (const char *const name, int &out) const |
Read an int from a tag. | |
bool | ReadInt (const std::string &name, int &out) const |
Read an int from a tag (STL version). | |
bool | ReadFloat (const char *const name, float &out) const |
Read a float from a tag. | |
bool | ReadFloat (const std::string &name, float &out) const |
Read a float from a tag (STL version). | |
bool | ReadBool (const char *const name, bool &out) const |
Read a bool from a tag. | |
bool | ReadBool (const std::string &name, bool &out) const |
Read a bool from a tag (STL version). | |
unsigned | MultiValSize (const char *const name) const |
Determine number of values in a tag. | |
unsigned | ReadMultiString (const char *const name, const char **out, const unsigned cap) const |
Read an array of strings from a multi value tag. | |
unsigned | ReadMultiString (const std::string &name, std::vector< std::string > &out) const |
Read an array of strings from a multi value tag (STL version). | |
unsigned | ReadMultiInt (const char *const name, int *out, const unsigned cap) const |
Read an array of ints from a multi value tag. | |
unsigned | ReadMultiInt (const std::string &name, std::vector< int > &out) const |
Read an array of ints from a multi value tag (STL version). | |
unsigned | ReadMultiFloat (const char *const name, float *out, const unsigned cap) const |
Read an array of floats from a multi value tag. | |
unsigned | ReadMultiFloat (const std::string &name, std::vector< float > &out) const |
Read an array of floats from a multi value tag (STL version). | |
unsigned | ReadMultiBool (const char *const name, bool *out, const unsigned cap) const |
Read an array of bools from a multi value tag. | |
unsigned | ReadMultiBool (const std::string &name, std::vector< bool > &out) const |
Read an array of bools from a multi value tag (STL version). | |
unsigned | ArraySize (const char *const name) const |
Determine size of a sequence of tags with given base name. | |
unsigned | ReadStrings (const char *const name, const char **out, const unsigned cap) const |
Read an array of strings from a sequence of tags with given base name. | |
unsigned | ReadStrings (const std::string &name, std::vector< std::string > &out) const |
Read an array of strings from a sequence of tags with given base name (STL version). | |
unsigned | ReadInts (const char *const name, int *out, const unsigned cap) const |
Read an array of ints from a sequence of tags with given base name. | |
unsigned | ReadInts (const std::string &name, std::vector< int > &out) const |
Read an array of ints from a sequence of tags with given base name (STL version). | |
unsigned | ReadFloats (const char *const name, float *out, const unsigned cap) const |
Read an array of floats from a sequence of tags with given base name. | |
unsigned | ReadFloats (const std::string &name, std::vector< float > &out) const |
Read an array of floats from a sequence of tags with given base name (STL version). | |
unsigned | ReadBools (const char *const name, bool *out, const unsigned cap) const |
Read an array of bools from a sequence of tags with given base name. | |
unsigned | ReadBools (const std::string &name, std::vector< bool > &out) const |
Read an array of bools from a sequence of tags with given base name (STL version). |
Handles reading of data from a single INI section.
Definition at line 24 of file inisection.h.
unsigned INISection::ArraySize | ( | const char *const | name | ) | const |
Determine size of a sequence 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. Must be a zero terminated string. |
Definition at line 498 of file inisection.cpp.
const char* INISection::CurrentTag | ( | ) | const [inline] |
Get name of the current tag.
Definition at line 105 of file inisection.h.
std::string INISection::CurrentTagSTL | ( | ) | const [inline] |
Get name of the current tag (STL version).
Definition at line 118 of file inisection.h.
unsigned INISection::GetLength | ( | ) | const [inline] |
Gets number of tags in the section.
Definition at line 78 of file inisection.h.
const char* INISection::GetName | ( | ) | const [inline] |
Gets name of this section.
Definition at line 60 of file inisection.h.
std::string INISection::GetNameSTL | ( | ) | const [inline] |
Gets name of this section (STL version).
Definition at line 69 of file inisection.h.
unsigned INISection::MultiValSize | ( | const char *const | name | ) | const |
Determine number of values in a tag.
name | Name of tag. Must be a zero terminated string. |
Definition at line 264 of file inisection.cpp.
bool INISection::Next | ( | ) | [inline] |
Advance iteration to the next tag.
Definition at line 93 of file inisection.h.
bool INISection::ReadBool | ( | const std::string & | name, | |
bool & | out | |||
) | const [inline] |
Read a bool from a tag (STL version).
name | Name of the tag to read. | |
out | Reference to variable to read to. If tag is not found, out won't be changed. |
Definition at line 223 of file inisection.h.
bool INISection::ReadBool | ( | const char *const | name, | |
bool & | out | |||
) | const |
Read a bool from a tag.
name | Name of the tag to read. Must be a zero terminated string. | |
out | Reference to variable to read to. If tag is not found, out won't be changed. |
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 from a sequence of tags with given base name (STL version).
Reads values from tags named name1=, name2=, etc. where name is the given base name for the tags.
name | Base name of tags to read. | |
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 from a sequence of tags with given base name.
Reads values from tags named name1=, name2=, etc. where name is the given base name for the tags.
name | Base name of tags to read. Must be a zero terminated string. | |
out | Pointer to buffer to read to. | |
cap | Maximum number of values the buffer can hold. |
Definition at line 671 of file inisection.cpp.
bool INISection::ReadFloat | ( | const std::string & | name, | |
float & | out | |||
) | const [inline] |
Read a float from a tag (STL version).
name | Name of the tag to read. | |
out | Reference to variable to read to. If tag is not found, out won't be changed. |
Definition at line 200 of file inisection.h.
bool INISection::ReadFloat | ( | const char *const | name, | |
float & | out | |||
) | const |
Read a float from a tag.
name | Name of the tag to read. Must be a zero terminated string. | |
out | Reference to variable to read to. If tag is not found, out won't be changed. |
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 from a sequence of tags with given base name (STL version).
Reads values from tags named name1=, name2=, etc. where name is the given base name for the tags.
name | Base name of tags to read. | |
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 from a sequence of tags with given base name.
Reads values from tags named name1=, name2=, etc. where name is the given base name for the tags.
name | Base name of tags to read. Must be a zero terminated string. | |
out | Pointer to buffer to read to. | |
cap | Maximum number of values the buffer can hold. |
Definition at line 655 of file inisection.cpp.
bool INISection::ReadInt | ( | const std::string & | name, | |
int & | out | |||
) | const [inline] |
Read an int from a tag (STL version).
name | Name of the tag to read. | |
out | Reference to variable to read to. If tag is not found, out won't be changed. |
Definition at line 177 of file inisection.h.
bool INISection::ReadInt | ( | const char *const | name, | |
int & | out | |||
) | const |
Read an int from a tag.
name | Name of the tag to read. Must be a zero terminated string. | |
out | Reference to variable to read to. If tag is not found, out won't be changed. |
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 from a sequence of tags with given base name (STL version).
Reads values from tags named name1=, name2=, etc. where name is the given base name for the tags.
name | Base name of tags to read. | |
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 from a sequence of tags with given base name.
Reads values from tags named name1=, name2=, etc. where name is the given base name for the tags.
name | Base name of tags to read. Must be a zero terminated string. | |
out | Pointer to buffer to read to. | |
cap | Maximum number of values the buffer can hold. |
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 (STL version).
Reads bools from comma separated values in a tag.
name | Name of the tag to read. | |
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.
Reads bools from comma separated values in a tag.
name | Name of the tag to read. Must be a zero terminated string. | |
out | Pointer to buffer to read to. | |
cap | Maximum number of values the buffer can hold. |
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 (STL version).
Reads floats from comma separated values in a tag.
name | Name of the tag to read. | |
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.
Reads floats from comma separated values in a tag.
name | Name of the tag to read. Must be a zero terminated string. | |
out | Pointer to buffer to read to. | |
cap | Maximum number of values the buffer can hold. |
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 (STL version).
Reads ints from comma separated values in a tag.
name | Name of the tag to read. | |
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.
Reads ints from comma separated values in a tag.
name | Name of the tag to read. Must be a zero terminated string. | |
out | Pointer to buffer to read to. | |
cap | Maximum number of values the buffer can hold. |
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 (STL version).
Reads strings from comma separated values in a tag.
name | Name of the tag to read. | |
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.
Reads strings from comma separated values in a tag.
name | Name of the tag to read. Must be a zero terminated string. | |
out | Pointer to buffer to read to. | |
cap | Maximum number of values the buffer can hold. |
Definition at line 311 of file inisection.cpp.
bool INISection::ReadString | ( | const std::string & | name, | |
std::string & | out | |||
) | const [inline] |
Read a string from a tag (STL version).
name | Name of the tag to read. | |
out | Reference to variable to read to. If tag is not found, out won't be changed. |
Definition at line 148 of file inisection.h.
bool INISection::ReadString | ( | const char *const | name, | |
const char *& | out | |||
) | const [inline] |
Read a string from a tag.
name | Name of the tag to read. Must be a zero terminated string. | |
out | Reference to variable to read to. If tag is not found, out won't be changed. |
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 from a sequence of tags with given base name (STL version).
Reads values from tags named name1=, name2=, etc. where name is the given base name for the tags.
name | Base name of tags to read. | |
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 from a sequence of tags with given base name.
Reads values from tags named name1=, name2=, etc. where name is the given base name for the tags.
name | Base name of tags to read. Must be a zero terminated string. | |
out | Pointer to buffer to read to. | |
cap | Maximum number of values the buffer can hold. |
Definition at line 569 of file inisection.cpp.
void INISection::Reset | ( | ) | [inline] |
Resets iteration.
Definition at line 84 of file inisection.h.