66 sprintf(ctmp,
"%f", rval);
76 sprintf(ctmp,
"%d", rval);
89 cerr <<
"EST_Option: No value set for " << rkey << endl;
96 if (tval != Empty_String)
100 cerr <<
"EST_Option: No value set for " << rkey << endl;
107 if (tval != Empty_String)
111 cerr <<
"EST_Option: No value set for " << rkey << endl;
118 if (tval != Empty_String)
122 cerr <<
"EST_Option: No value set for " << rkey << endl;
129 sprintf(tmp,
"%d", rval);
136 sprintf(tmp,
"%f", rval);
150 if (((filename ==
"-") ? ts.
open(cin) : ts.
open(filename)) != 0)
152 cerr <<
"can't open EST_Option input file " << filename << endl;
159 k = ts.
get().string();
166 cout <<
"Include directive\n";
void remove_prefix(EST_String prefix)
remove prefix from every key
friend ostream & operator<<(ostream &s, const EST_Option &kv)
print options
EST_TokenStream & get(EST_Token &t)
get next token in stream
const EST_String & key(EST_Litem *ptr, int m=1) const
find key, reference by ptr
int contains(const char *s, ssize_t pos=-1) const
Does it contain this substring?
Utility IO Function header file.
int change_key(EST_Litem *ptr, const EST_String &rkey)
change name of key pair.
int add_iitem(const EST_String &rkey, const int &rval)
int override_ival(const EST_String rkey, const int rval)
add to end of list or overwrite. If rval is empty, do nothing
int override_val(const EST_String rkey, const EST_String rval)
add to end of list or overwrite. If rval is empty, do nothing
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
double dval(const EST_String &rkey, int m=1) const
float fval(const EST_String &rkey, int m=1) const
int add_fitem(const EST_String &rkey, const float &rval)
int open(const EST_String &filename)
open a EST_TokenStream for a file.
const EST_String & val_def(const EST_String &rkey, const EST_String &def) const
value or default
const EST_String & sval(const EST_String &rkey, int m=1) const
EST_read_status load(const EST_String &filename, const EST_String &comment=";")
EST_Regex RXwhite("[ \n\t\r]+")
White space.
EST_TList< EST_TKVI< EST_String, EST_String > > list
Linked list of key-val pairs. Don't use this as it will be made private in the future.
void add_prefix(EST_String prefix)
add prefix to every key
const V & val(const K &rkey, bool m=0) const
return value according to key (const)
int add_item(const EST_String &rkey, const EST_String &rval, int no_search=0)
add key-val pair to list
const EST_String & string() const
EST_Token get_upto_eoln(void)
get up to s in end of line as a single token.
EST_String after(int pos, int len=1) const
Part after pos+len.