 |
Edinburgh Speech Tools
2.4-release
|
|
41 #include "EST_Option.h"
42 #include "EST_io_aux.h"
43 #include "EST_Token.h"
60 sprintf(ctmp,
"%f", rval);
70 sprintf(ctmp,
"%d", rval);
83 cerr <<
"EST_Option: No value set for " << rkey << endl;
90 if (tval != Empty_String)
94 cerr <<
"EST_Option: No value set for " << rkey << endl;
101 if (tval != Empty_String)
105 cerr <<
"EST_Option: No value set for " << rkey << endl;
112 if (tval != Empty_String)
116 cerr <<
"EST_Option: No value set for " << rkey << endl;
123 sprintf(tmp,
"%d", rval);
127 int EST_Option::add_fitem(
const EST_String &rkey,
const float &rval)
130 sprintf(tmp,
"%f", rval);
144 if (((filename ==
"-") ? ts.
open(cin) : ts.
open(filename)) != 0)
146 cerr <<
"can't open EST_Option input file " << filename << endl;
147 return misc_read_error;
153 k = ts.
get().string();
156 v = v.
after(RXwhite);
160 cout <<
"Include directive\n";
174 for (ptr =
list.head(); ptr; ptr = ptr->next())
187 for (ptr = kv.
list.head(); ptr; ptr = ptr->next())
EST_TList< EST_TKVI< K, V > > list
Linked list of key-val pairs. Don't use this as it will be made private in the future.
int override_ival(const EST_String rkey, const int rval)
add to end of list or overwrite. If rval is empty, do nothing
const EST_String & val_def(const EST_String &rkey, const EST_String &def) const
value or default
void remove_prefix(EST_String prefix)
remove prefix from every key
int add_iitem(const EST_String &rkey, const int &rval)
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 override_fval(const EST_String rkey, const float rval)
add to end of list or overwrite. If rval is empty, do nothing
int contains(const char *s, int pos=-1) const
Does it contain this substring?
void add_prefix(EST_String prefix)
add prefix to every key
float fval(const EST_String &rkey, int m=1) const
const EST_String & key(EST_Litem *ptr, int m=1) const
find key, reference by ptr
EST_read_status load(const EST_String &filename, const EST_String &comment=";")
EST_Token get_upto_eoln(void)
get up to {\tt s} in end of line as a single token.
int open(const EST_String &filename)
open a \Ref{EST_TokenStream} for a file.
EST_TokenStream & get(EST_Token &t)
get next token in stream
int ival(const EST_String &rkey, int m=1) const
double dval(const EST_String &rkey, int m=1) const
int add_item(const EST_String &rkey, const EST_String &rval, int no_search=0)
add key-val pair to list
EST_String after(int pos, int len=1) const
Part after pos+len.
const EST_String & sval(const EST_String &rkey, int m=1) const
int change_key(EST_Litem *ptr, const EST_String &rkey)
change name of key pair.
const V & val(const K &rkey, bool m=0) const
return value according to key (const)