#include <CNCL/IniFile.h>
CN_INIFILE
CNNamed
None
None
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);
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);
name
parameter is chosen.
The whole file is stored as a double linked list.
int write();
int write(CNStringR name);
CNStringR get_entry(CNStringR section, CNStringR name, bool first=TRUE);
CNStringR get_entry(CNStringR name, bool first=TRUE);
name
as a string.
double get_double(CNStringR section, CNStringR name, bool first=TRUE);
double get_double(CNStringR name, bool first=TRUE);
name
as a double.
int get_int(CNStringR section, CNStringR name, bool first=TRUE);
int get_int(CNStringR name, bool first=TRUE);
name
as an integer.
bool test_entry(CNStringR section, CNStringR name);
bool test_entry(CNStringR name, bool first=TRUE);
CNStringR get_section();
void set_section(CNStringR section);
CNDLIterator
ini_sec
to the begining of
the section called name
Go to the first, previous, next, last section, table of contents.