Section of ini file. More...
#include <inisection.h>
Public Member Functions | |
const char * | GetName () const |
bool | ReadString (const char *const name, const char *&out) const |
Read a string value from given tag. | |
bool | ReadInt (const char *const name, int &out) const |
Read an int value from given tag. | |
bool | ReadFloat (const char *const name, float &out) const |
Read a float value from given tag. | |
bool | ReadBool (const char *const name, bool &out) const |
Read a bool value from given tag. | |
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 | 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 | 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 | 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 | GetLength () const |
Section of ini file.
Definition at line 14 of file inisection.h.
unsigned INISection::GetLength | ( | ) | const |
Definition at line 604 of file inisection.cpp.
const char * INISection::GetName | ( | ) | const |
Definition at line 227 of file inisection.cpp.
bool INISection::ReadBool | ( | const char *const | name, | |
bool & | out | |||
) | const |
Read a bool 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. |
Definition at line 361 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. Continues to read successive elements until it either reads as many elements as given capacity, there are no more elements left in section, or it encounters an element in wrong order, e.g. name4= after name2= .
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 563 of file inisection.cpp.
bool INISection::ReadFloat | ( | const char *const | name, | |
float & | out | |||
) | const |
Read a float 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. |
Definition at line 324 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. Continues to read successive elements until it either reads as many elements as given capacity, there are no more elements left in section, or it encounters an element in wrong order, e.g. name4= after name2= .
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 511 of file inisection.cpp.
bool INISection::ReadInt | ( | const char *const | name, | |
int & | out | |||
) | const |
Read an int 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. |
Definition at line 286 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. Continues to read successive elements until it either reads as many elements as given capacity, there are no more elements left in section, or it encounters an element in wrong order, e.g. name4= after name2= .
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 458 of file inisection.cpp.
bool INISection::ReadString | ( | const char *const | name, | |
const char *& | out | |||
) | const |
Read a string value from given tag.
Note that unlike other ReadXXX methods, ReadString only gives a pointer to data inside the INISection. If you want to use this data after INIFile is destroyed, you have to copy it.
name | Name of the tag to read from. Must be a valid zero terminated string. | |
out | Reference to variable to read to. |
Definition at line 232 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. Continues to read successive elements until it either reads as many elements as given capacity, there are no more elements left in section, or it encounters an element in wrong order, e.g. name4= after name2= . Note that unlike other ReadXXXs methods, ReadStrings only gives a pointer to data inside the INISection. If you want to use this data after INIFile is destroyed, you have to copy it.
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 386 of file inisection.cpp.