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) 74 kvl.
add_item(
"street",
"South Bbridge");
76 kvl.
add_item(
"post code",
"EH1 1HN");
77 kvl.
add_item(
"country",
"United Kingdom");
85 kvl.
add_item(
"country",
"Scotland", 1);
103 cout << kvl.
val(
"country") << endl;
106 cout << kvl.
val(
"state") << endl;
111 cout << kvl.
val(
"state", 0) << endl;
116 cout << kvl.
val_def(
"state",
"unknown") << endl;
120 cout << kvl.
val(
"state") << endl;;
128 for (p=kvl.
head(); p != 0; p=p->next())
129 cout << kvl.
val(p) <<
" " << kvl.
key(p) << endl;
159 op.
load(DATA
"/options.file");
165 cout << op.
val(
"Street") << endl;
167 cout << op.
ival(
"Number") << endl;
169 cout << op.
fval(
"Height") << endl;
178 op.add_fitem(
"length", 39.78);
183 op.add_fitem(
"length", 39.78);
int change_key(EST_Litem *ptr, const K &rkey)
change name of key pair.
int override_fval(const EST_String rkey, const float rval)
add to end of list or overwrite. If rval is empty, do nothing
int change_val(const K &rkey, const V &rval)
EST_read_status load(const EST_String &filename, const EST_String &comment=";")
float fval(const EST_String &rkey, int m=1) const
const int present(const K &rkey) const
Returns true if key is present.
int add_item(const K &rkey, const V &rval, int no_search=0)
add key-val pair to list
int ival(const EST_String &rkey, int m=1) const
const V & val_def(const K &rkey, const V &def) const
value or default
const V & val(const K &rkey, bool m=0) const
return value according to key (const)
const K & key(EST_Litem *ptr, int m=1) const
find key, reference by ptr
EST_Litem * head() const
Return First key value pair in list.