INIFile
The INIFile class provides methods to access data stored in initialization file.
EX1
void INIFile_ex1() { INIFile ini1("Origin.ini", FALSE); //for program path INIFile ini2("Origin.ini"); //for INI path int nNumLevels1 = ini1.ReadInt("Config", "NumLevels", 0); int nNumLevels2 = ini2.ReadInt("Config", "NumLevels", 0); printf("NumLevels in Program folder ini = %d\n", nNumLevels1); printf("NumLevels in ini folder ini = %d\n", nNumLevels2); }
origin.h
Name | Brief | Example |
---|---|---|
GetFileName | Gets the name of the INI file. | Examples |
GetKeyNames | Get all the key names in a section into a string array. | Examples |
GetSectionNames | Get all the section names into a string array. | Examples |
INIFile | Constructor to determine what INI file to use | Examples |
ReadDouble | Retrieves an double value from the specified section in an initialization file | Examples |
ReadInt | Retrieves an integer value from the specified section in an initialization file | Examples |
ReadString | Reads the value of a key in a given section into a string. | Examples |
SetFileName | Sets the file name to the given string. | Examples |
WriteDouble | Writes double value into the specified section of an initialization file | Examples |
WriteInt | Writes integer value into the specified section of an initialization file | Examples |
WriteString | Writes a string value for a given keyname in a given section | Examples |