DSConfigFile |
public:
DSConfigFile (void);
Create an empty ConfigFile.
close |
public:
void close (void);
Purge all the data from the ConfigFile, but keep the ConfigFile itself available for subsequent uses.
delValue |
public:
void delValue ( const char * section, const char * key );
Delete a value from the ConfigFile
- section
- Specify the section the value is located in.
- key
- Specify the key corresponding to the value.
forEach |
public:
void forEach ( char * section, void (*callback ) ( char *, char *, void *), void * extra );
Iterate through a section on the ConfigFile, and call a function for each entry found.
- section
- Specifies the section to be iterated through. This can be NULL, in which case the sections themselves are iterated through.
- callback
- Specifies the function to be called when an entry is found. This function will be passed the key and value, plus any extra data, described below
- extra
- A pointer to additional data which will be passed to the function specified above for each time an item is found.
getValue |
public:
char * getValue ( const char * section, const char * key, char * def=NULL );
Retrieve a pointer to the data inside the ConfigFile.
- section
- Specifies the section that the data is located in.
- key
- Specifies the key that is being searched for.
- def
- Specifies the default value to return, if no match is found.
getValueInt |
public:
unsigned int getValueInt ( const char * section, const char * key, unsigned int def=0 );
Retrieve the data inside the ConfigFile.
- section
- Specifies the section that the data is located in.
- key
- Specifies the key that is being searched for.
- def
- Specifies the default value to return, if no match is found.
isValue |
public:
int isValue ( const char * section, const char * key );
Determine if a value is in the ConfigFile.
- section
- Specify the section the value is located in.
- key
- Specify the key corresponding to the value.
loadFile |
public:
int loadFile ( const char * filename );
Load data from a file into this ConfigFile.
- filename
- Path to a file in which the data is located.
saveFile |
public:
int saveFile ( const char * filename );
Save data from this ConfigFile into a file.
- filename
- Path to a file in which the data is to be stored.
setValue |
public:
void setValue ( const char * section, char * key, char * value );
Set a value in the ConfigFile.
- section
- Specify the section the value is located in.
- key
- Specify the key corresponding to the value. This parameter is used directly in the ConfigFile, not copied. It will be deleted when the ConfigFile is closed or destroyed. You should copy the data yourself prior to calling this function.
- value
- Specify the new value. This parameter is used directly in the ConfigFile, not copied. It will be deleted when the ConfigFile is closed or destroyed. You should copy the data yourself prior to calling this function.
~DSConfigFile |
public:
~DSConfigFile (void);
Destroy a ConfigFile.
(Last Updated 9/24/2004)