50 # define __STRINGIZE(X) #X 51 # define DATA __STRINGIZE(DATAC) 65 kvl.
add_item(
"street",
"South Bbridge");
67 kvl.
add_item(
"post code",
"EH1 1HN");
68 kvl.
add_item(
"country",
"United Kingdom");
81 kvl.
add_item(
"country",
"Scotland", 1);
100 cout << kvl.
val(
"country") << endl;
105 cout << kvl.
val(
"state") << endl;
112 cout << kvl.
val(
"state", 0) << endl;
119 cout << kvl.
val_def(
"state",
"unknown") << endl;
125 cout << kvl.
val(
"state") << endl;;
135 for (p=kvl.
head(); p != 0; p=p->
next())
136 cout << kvl.
val(p) <<
" " << kvl.
key(p) << endl;
164 op.
load(DATA
"/options.file");
172 cout << op.
val(
"Street") << endl;
177 cout << op.
ival(
"Number") << endl;
182 cout << op.
fval(
"Height") << endl;
const K & key(EST_Litem *ptr, int m=1) const
find key, reference by ptr
int change_key(EST_Litem *ptr, const K &rkey)
change name of key pair.
int ival(const EST_String &rkey, int m=1) const
int override_fval(const EST_String rkey, const float rval)
add to end of list or overwrite. If rval is empty, do nothing
float fval(const EST_String &rkey, int m=1) const
int add_fitem(const EST_String &rkey, const float &rval)
int change_val(const K &rkey, const V &rval)
const V & val_def(const K &rkey, const V &def) const
value or default
EST_read_status load(const EST_String &filename, const EST_String &comment=";")
EST_Litem * head() const
Return First key value pair in list.
const V & val(const K &rkey, bool m=0) const
return value according to key (const)
int add_item(const K &rkey, const V &rval, int no_search=0)
add key-val pair to list
int present(const K &rkey) const
Returns true if key is present.