Go to the first, previous, next, last section, table of contents.


CNIniFile -- .ini-style config file

SYNOPSIS

#include <CNCL/IniFile.h>

TYPE

CN_INIFILE

BASE CLASSES

CNNamed

DERIVED CLASSES

None

RELATED CLASSES

None

DESCRIPTION

The class CNIniFile reads/writes MSDOS-style .INI files.
Example of a .INI file:


# This is a comment

[Test]
display = 1
string  = Hallo!
abc

In this example the variables display, string and abc of section Test are declared. At this class each single line is handled as a node of a double linked list. Each node has a left entry (variable), a right one (value) and a type entry (COMM, EMPTY, SECTION, ENTRY, ENTRYNOEQ). Depending on the different types, left and/or right entry can be empty.


Attention : This class is still under construction ! !

Constructors:

CNIniFile();
CNIniFile(CNParam *);
CNIniFile(CNStringR name);
Initializes the CNIniFile. The name parameter will automatically read the file name.INI into double linked list.

In addition to the member functions required by CNCL, CNIniFile provides:

int read()
int read(CNStringR name);
Reads the specified .ini file. Either the object's name or the name parameter is chosen. The whole file is stored as a double linked list.
int write();
int write(CNStringR name);
Writes the current list into a .ini file.
CNStringR get_entry(CNStringR section, CNStringR name, bool first=TRUE);
NOT IMPLEMENTED YET.
CNStringR get_entry(CNStringR name, bool first=TRUE);
Returns the entry for name as a string.
double get_double(CNStringR section, CNStringR name, bool first=TRUE);
NOT IMPLEMENTED YET.
double get_double(CNStringR name, bool first=TRUE);
Returns the entry for name as a double.
int get_int(CNStringR section, CNStringR name, bool first=TRUE);
NOT IMPLEMENTED YET.
int get_int(CNStringR name, bool first=TRUE);
Returns the entry for name as an integer.
bool test_entry(CNStringR section, CNStringR name);
NOT IMPLEMENTED YET.
bool test_entry(CNStringR name, bool first=TRUE);
NOT IMPLEMENTED YET.
CNStringR get_section();
Returns the sections's name.
void set_section(CNStringR section);
Sets the internal CNDLIterator ini_sec to the begining of the section called name


Go to the first, previous, next, last section, table of contents.