![]() | Patrick's Programming Library Version 6.4.21 - Dokumentation |
Klasse zum Verarbeiten von Config-Files. Mehr ...
Öffentliche Methoden | |
CConfig () | |
CConfig (const char *filename) | |
CConfig (CFileObject *file) | |
~CConfig () | |
int | Add (const char *section, const char *key, const char *value) |
int | Add (const char *key, const char *value) |
int | Add (const char *key, int value) |
int | Add (const char *section, const char *key, int value) |
int | Add (const char *section, const char *key, bool value) |
int | CreateSection (const char *section) |
int | Delete (const char *key) |
int | Delete (const char *section, const char *key) |
int | DeleteSection (const char *section) |
int | FirstSection () |
const char * | Get (const char *key, const char *defaultvalue=NULL) |
const char * | Get (const char *section, const char *key, const char *defaultvalue=NULL) |
bool | GetBool (const char *section, const char *key, bool defaultvalue=false) |
bool | GetBool (const char *key, bool defaultvalue=false) |
int | GetFirst (char **key, char **value) |
int | GetFirst (CString *key, CString *value) |
int | GetInt (const char *section, const char *key, int defaultvalue=0) |
int | GetInt (const char *key, int defaultvalue=0) |
int | GetNext (char **key, char **value) |
int | GetNext (CString *key, CString *value) |
const char * | GetSection (const char *section) |
Inhalt einer Sektion als char* auslesen. Mehr ... | |
const char * | GetSectionName () |
int | IsTrue (const char *value) |
int | Load (const char *filename,...) |
Konfiguration aus einer Datei laden. Mehr ... | |
int | Load (CFileObject *file) |
Konfiguration aus einem CFileObject-Objekt laden. Mehr ... | |
int | LoadFromMemory (void *buffer, int bytes) |
Konfiguration aus dem Speicher laden. Mehr ... | |
int | LoadFromString (CString &string) |
Konfiguration aus einem String laden. Mehr ... | |
int | NextSection () |
void | Print () |
Konfiguration auf STDOUT ausgeben. Mehr ... | |
CAssocArray * | ReadSection (const char *section, CAssocArray *a=NULL) |
Inhalt einer Sektion ein einem Array speichern. Mehr ... | |
void | Reset () |
int | Save (const char *filename) |
int | Save (CFileObject *file) |
int | SelectSection (const char *section) |
void | SetSeparator (const char *string) |
int | String2Point (const char *string, POINT *p) |
void | String2Rect (const char *string, RECT *r) |
void | Unload () |
Private Methoden | |
void * | FindSection (const char *sectionname) |
void | Init () |
Private Attribute | |
char * | currentsection |
void * | first |
bool | isused |
void * | last |
void * | section |
CAssocArray | sections |
char * | separator |
size_t | separatorLength |
ppl6::CConfig::CConfig | ( | ) |
ppl6::CConfig::CConfig | ( | const char * | filename | ) |
ppl6::CConfig::CConfig | ( | CFileObject * | file | ) |
ppl6::CConfig::~CConfig | ( | ) |
int ppl6::CConfig::Add | ( | const char * | section, |
const char * | key, | ||
const char * | value | ||
) |
int ppl6::CConfig::Add | ( | const char * | key, |
const char * | value | ||
) |
int ppl6::CConfig::Add | ( | const char * | key, |
int | value | ||
) |
int ppl6::CConfig::Add | ( | const char * | section, |
const char * | key, | ||
int | value | ||
) |
int ppl6::CConfig::Add | ( | const char * | section, |
const char * | key, | ||
bool | value | ||
) |
int ppl6::CConfig::CreateSection | ( | const char * | section | ) |
int ppl6::CConfig::Delete | ( | const char * | key | ) |
int ppl6::CConfig::Delete | ( | const char * | section, |
const char * | key | ||
) |
int ppl6::CConfig::DeleteSection | ( | const char * | section | ) |
|
private |
int ppl6::CConfig::FirstSection | ( | ) |
const char * ppl6::CConfig::Get | ( | const char * | key, |
const char * | defaultvalue = NULL |
||
) |
const char * ppl6::CConfig::Get | ( | const char * | section, |
const char * | key, | ||
const char * | defaultvalue = NULL |
||
) |
bool ppl6::CConfig::GetBool | ( | const char * | section, |
const char * | key, | ||
bool | defaultvalue = false |
||
) |
bool ppl6::CConfig::GetBool | ( | const char * | key, |
bool | defaultvalue = false |
||
) |
int ppl6::CConfig::GetFirst | ( | char ** | key, |
char ** | value | ||
) |
int ppl6::CConfig::GetInt | ( | const char * | section, |
const char * | key, | ||
int | defaultvalue = 0 |
||
) |
int ppl6::CConfig::GetInt | ( | const char * | key, |
int | defaultvalue = 0 |
||
) |
int ppl6::CConfig::GetNext | ( | char ** | key, |
char ** | value | ||
) |
const char * ppl6::CConfig::GetSection | ( | const char * | section | ) |
section | Der Name der Sektion ohne Eckige Klammern |
const char * ppl6::CConfig::GetSectionName | ( | ) |
|
private |
int ppl6::CConfig::IsTrue | ( | const char * | value | ) |
int ppl6::CConfig::Load | ( | const char * | filename, |
... | |||
) |
filename | Ein Pointer auf dem Dateinamen oder einen Formatierungsstring |
... | Optionale Parameter für den Formatstring |
int ppl6::CConfig::Load | ( | CFileObject * | file | ) |
file | Ein Pointer auf eine CFileObject-Klasse |
int ppl6::CConfig::LoadFromMemory | ( | void * | buffer, |
int | bytes | ||
) |
buffer | Ein Pointer auf den Beginn des Speicherbereichs |
bytes | Die Größe des Speicherbereichs |
int ppl6::CConfig::LoadFromString | ( | CString & | string | ) |
string | Ein Pointer auf die CString-Klasse |
int ppl6::CConfig::NextSection | ( | ) |
void ppl6::CConfig::Print | ( | ) |
CAssocArray * ppl6::CConfig::ReadSection | ( | const char * | section, |
CAssocArray * | a = NULL |
||
) |
section | Der Name der Sektion ohne Eckige Klammern |
a | Ein Optionaler Pointer auf ein Assoziatives Array, in dem die Sektion gespeichert werden soll. |
a
angegeben, wird das Ergebnis darin gespeichert und der Return-Wert ist identisch mit a
. Ist das nicht der Fall, wird mit new
ein neues Array angelegt und der Benutzer muss dafür sorgen, dass dieses wieder gelöscht wird. Im Fehlerfall wird NULL zurückgegeben und der Fehlercode kann wie üblich mit den Fehlerfunktionen abgefragt werden. void ppl6::CConfig::Reset | ( | ) |
int ppl6::CConfig::Save | ( | const char * | filename | ) |
int ppl6::CConfig::Save | ( | CFileObject * | file | ) |
int ppl6::CConfig::SelectSection | ( | const char * | section | ) |
void ppl6::CConfig::SetSeparator | ( | const char * | string | ) |
int ppl6::CConfig::String2Point | ( | const char * | string, |
POINT * | p | ||
) |
void ppl6::CConfig::String2Rect | ( | const char * | string, |
RECT * | r | ||
) |
void ppl6::CConfig::Unload | ( | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |