In file ../include/EST_Option.h:

## class EST_Option

> Provide a high level interface for String String key value lists

## Inheritance:

### Public Methods

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

### Inherited from EST_TKVL:

### Public Fields

static V* default_val
static K* default_key

### Public Methods

Constructor functions

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

const int length() const
EST_Litem* head() const
void clear()

Access functions.

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

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

### Public

Linked list of key-val pairs.

## Documentation

> Provide a high level interface for String String key value lists

`void add_prefix(EST_String prefix)`
  add prefix to every key

`void remove_prefix(EST_String prefix)`
  remove prefix from every key

`EST_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

`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 override_ival(const EST_String rkey, const int rval)`
  add to end of list or overwrite. If rval is empty, do nothing

`int 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

`double 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

`float 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

`const 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

`int 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