In file ../include/EST_Option.h:

class EST_Option

Provide a high level interface for String String key value lists

Inheritance:


Public Methods

[more]void add_prefix (EST_String prefix)
add prefix to every key
[more]void remove_prefix (EST_String prefix)
remove prefix from every key
[more]EST_read_status load (const EST_String &filename, const EST_String &comment = ";")
read keyval list from file.
[more]int override_val (const EST_String rkey, const EST_String rval)
add to end of list or overwrite.
[more]int override_fval (const EST_String rkey, const float rval)
add to end of list or overwrite.
[more]int override_ival (const EST_String rkey, const int rval)
add to end of list or overwrite.
[more]int ival (const EST_String &rkey, int m=1) const
return value of type int relating to key.
[more]double dval (const EST_String &rkey, int m=1) const
return value of type float relating to key.
[more]float fval (const EST_String &rkey, int m=1) const
return value of type float relating to key.
[more]const EST_String& sval (const EST_String &rkey, int m=1) const
return value of type String relating to key.
[more]int add_iitem (const EST_String &rkey, const int &rval)
return value of type String relating to key.


Inherited from EST_TKVL:

Public Fields

ostatic V* default_val
ostatic K* default_key

Public Methods

Constructor functions

[more] EST_TKVL()
default constructor
[more] EST_TKVL(const EST_TKVL<K, V> &kv)
copy constructor

oconst int length() const
oEST_Litem* head() const
ovoid clear()

Access functions.

[more]const V& val(const K &rkey, bool m=0) const
return value according to key (const)
[more]V& val(const K &rkey, bool m=0)
return value according to key (non-const)
[more]const V& val(EST_Litem* ptr, bool m=0) const
return value according to ptr
[more]V& val(EST_Litem* ptr, bool m=0)
return value according to ptr
[more]const V& val_def(const K &rkey, const V &def) const
value or default
[more]const K& key(EST_Litem* ptr, int m=1) const
find key, reference by ptr
[more]K& key(EST_Litem* ptr, int m=1)
find key, reference by ptr
[more]const K& key(const V &v, int m=1) const
return first matching key, referenced by val
[more]int change_val(const K &rkey, const V &rval)
change key-val pair.
[more]int change_val(EST_Litem* ptr, const V &rval)
change key-val pair.
[more]int change_key(EST_Litem* ptr, const K &rkey)
change name of key pair
[more]int add_item(const K &rkey, const V &rval, int no_search = 0)
add key-val pair to list
[more]int remove_item(const K &rkey, int quiet = 0)
remove key and val pair from list

oconst int present(const K &rkey) const
ovoid map(void (*func)(K&, V&))
oEST_TKVL<K, V> & operator = (const EST_TKVL<K, V> &kv)
oEST_TKVL<K, V> & operator += (const EST_TKVL<K, V> &kv)
oEST_TKVL<K, V> operator + (const EST_TKVL<K, V> &kv)

Public

o Linked list of key-val pairs.


Documentation

Provide a high level interface for String String key value lists
ovoid add_prefix(EST_String prefix)
add prefix to every key

ovoid remove_prefix(EST_String prefix)
remove prefix from every key

oEST_read_status load(const EST_String &filename, const EST_String &comment = ";")
read keyval list from file. The file type is an ascii file with each line representing one key value pair. The first entry in the line defines the key, and the rest, which may contain whitespaces, defins the value. Lines starting with the comment character are ignored.
Returns:
returns EST_read_status errors, @see

oint override_val(const EST_String rkey, const EST_String rval)
add to end of list or overwrite. If rval is empty, do nothing

oint override_fval(const EST_String rkey, const float rval)
add to end of list or overwrite. If rval is empty, do nothing

oint override_ival(const EST_String rkey, const int rval)
add to end of list or overwrite. If rval is empty, do nothing

oint ival(const EST_String &rkey, int m=1) const
return value of type int relating to key. By default, an error occurs if the key is not present. Use m=0 if to get a dummy value returned if key is not present

odouble dval(const EST_String &rkey, int m=1) const
return value of type float relating to key. By default, an error occurs if the key is not present. Use m=0 if to get a dummy value returned if key is not present

ofloat fval(const EST_String &rkey, int m=1) const
return value of type float relating to key. By default, an error occurs if the key is not present. Use m=0 if to get a dummy value returned if key is not present

oconst EST_String& sval(const EST_String &rkey, int m=1) const
return value of type String relating to key. By default, an error occurs if the key is not present. Use m=0 if to get a dummy value returned if key is not present

oint add_iitem(const EST_String &rkey, const int &rval)
return value of type String relating to key. By default, an error occurs if the key is not present. Use m=0 if to get a dummy value returned if key is not present


This class has no child classes.
Friends:
ostream& operator << (ostream& s, const EST_Option &kv)

Alphabetic index HTML hierarchy of classes or Java


This page is part of the Edinburgh Speech Tools Library documentation
Copyright University of Edinburgh 1997
Contact: speech_tools@cstr.ed.ac.uk