42 #include "EST_Option.h"
43 #include "EST_util_class.h"
44 #include "EST_types.h"
47 # define __STRINGIZE(X) #X
48 # define DATA __STRINGIZE(DATAC)
62 kvl.
add_item(
"street",
"South Bbridge");
64 kvl.
add_item(
"post code",
"EH1 1HN");
65 kvl.
add_item(
"country",
"United Kingdom");
78 kvl.
add_item(
"country",
"Scotland", 1);
97 cout << kvl.
val(
"country") << endl;
102 cout << kvl.
val(
"state") << endl;
109 cout << kvl.
val(
"state", 0) << endl;
116 cout << kvl.
val_def(
"state",
"unknown") << endl;
122 cout << kvl.
val(
"state") << endl;;
132 for (p=kvl.
head(); p != 0; p=p->next())
133 cout << kvl.
val(p) <<
" " << kvl.
key(p) << endl;
161 op.
load(DATA
"/options.file");
169 cout << op.
val(
"Street") << endl;
174 cout << op.
ival(
"Number") << endl;
179 cout << op.
fval(
"Height") << endl;
189 op.add_fitem(
"length", 39.78);
196 op.add_fitem(
"length", 39.78);
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 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 int present(const K &rkey) const
Returns true if key is present.
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