Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

CIniFile Class Reference
[Files]

Handling of INI-files. More...

#include <gmlinifile.h>

List of all members.

Public Member Functions

bool IsSuchKeyInFile (const char *key)
bool IsSuchNameInThisKey (const char *key, const char *name)
 CIniFile ()
 Default constructor.

 CIniFile (const char *inipath)
 Constructor, can specify pathname here instead of using SetPath later.

virtual ~CIniFile ()
 Default destructor.

void SetPath (const char *newpath)
 Sets path of ini file to read and write from.

bool ReadFile ()
 Reads ini file specified using CIniFile::SetPath().

void WriteFile ()
 Writes data stored in class to ini file.

void Reset ()
 Deletes all stored ini data.

int GetNumKeys ()
 number of keys currently in the ini

int GetNumValues (const char *keyname)
 number of values stored for specified key

std::string GetValue (const char *keyname, const char *valuename)
 gets value of [keyname] valuename =

void GetValue (const char *keyname, const char *valuename, char *out_pcBuf, int in_iMaxChar)
 gets value of [keyname] valuename =

int GetValueI (const char *keyname, const char *valuename)
 gets value of [keyname] valuename =

double GetValueF (const char *keyname, const char *valuename)
 gets value of [keyname] valuename =

bool SetValue (const char *key, const char *valuename, const char *value, bool create=1)
 sets value of [keyname] valuename =.

bool SetValueI (const char *key, const char *valuename, int value, bool create=1)
 sets value of [keyname] valuename =.

bool SetValueF (const char *key, const char *valuename, double value, bool create=1)
 sets value of [keyname] valuename =.

bool DeleteValue (const char *keyname, const char *valuename)
 deletes specified value

bool DeleteKey (const char *keyname)
 deletes specified key and all values contained within


Public Attributes

std::string error
 will contain error info if one occurs ended up not using much, just in ReadFile and GetValue


Detailed Description

Handling of INI-files.


Member Function Documentation

bool ReadFile  ) 
 

Reads ini file specified using CIniFile::SetPath().

Returns:
true if successful, false otherwise

std::string GetValue const char *  keyname,
const char *  valuename
 

gets value of [keyname] valuename =

Returns:
"", or 0 if key/value not found. Sets error member to show problem

void GetValue const char *  keyname,
const char *  valuename,
char *  out_pcBuf,
int  in_iMaxChar
 

gets value of [keyname] valuename =

Returns:
"", or 0 if key/value not found. Sets error member to show problem

int GetValueI const char *  keyname,
const char *  valuename
 

gets value of [keyname] valuename =

Returns:
"", or 0 if key/value not found. Sets error member to show problem

double GetValueF const char *  keyname,
const char *  valuename
 

gets value of [keyname] valuename =

Returns:
"", or 0 if key/value not found. Sets error member to show problem

bool SetValue const char *  key,
const char *  valuename,
const char *  value,
bool  create = 1
 

sets value of [keyname] valuename =.

specify the optional paramter as false (0) if you do not want it to create the key if it doesn't exist.

Returns:
true if data entered, false otherwise

bool SetValueI const char *  key,
const char *  valuename,
int  value,
bool  create = 1
 

sets value of [keyname] valuename =.

specify the optional paramter as false (0) if you do not want it to create the key if it doesn't exist.

Returns:
true if data entered, false otherwise

bool SetValueF const char *  key,
const char *  valuename,
double  value,
bool  create = 1
 

sets value of [keyname] valuename =.

specify the optional paramter as false (0) if you do not want it to create the key if it doesn't exist.

Returns:
true if data entered, false otherwise

bool DeleteValue const char *  keyname,
const char *  valuename
 

deletes specified value

Returns:
true if value existed and deleted, false otherwise

bool DeleteKey const char *  keyname  ) 
 

deletes specified key and all values contained within

Returns:
returns true if key existed and deleted, false otherwise


The documentation for this class was generated from the following files:
Generated on Tue Jan 13 21:12:03 2004 for Graphics and Media Lab CSL by doxygen 1.3.4