Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

dsTranslation Class Reference

#include <dsTranslation.h>

Inheritance diagram for dsTranslation:

dsApprc Parser List of all members.

Public Methods

 dsTranslation (int table=none)
 dsTranslation (std::istream &is, int table=none)
 dsTranslation (char *fname, int table=none)
char * translate (char *key)
bool good ()
bool isTranslated (char *key)
void enableWarnings (std::ostream *os=&(std::cerr))
void load (const char *filename)
void load (std::istream &is)
void dump (std::ostream &os)
void set_delimiter (char delim)
void set_xlat (int table)
void add (const char *key, const char *val)
void add (const char *key, int val)
char * seek (const char *key)
char * seek (const char *key, int idx)
void push (const char *key)
void push (int array_key)
void pop ()
int getbool (const char *key)
int getbool (const char *key, int defval)
long getlong (const char *key)
long getlong (const char *key, long defval)
double getdouble (const char *key)
double getdouble (const char *key, double defval)
char * getstring (const char *key)
char * getstring (const char *key, int idx)
char * getstring (const char *key, char *defval)

Protected Methods

int expand_condition (char *cond)
char * expand_var (char *ptr, int *vlen=0)
void _add (char *line)
void _add2 (const char *key, const char *val)
char * trim (char *src)
void undefined_key_exception (const char *key)

Protected Attributes

dsHashTable * _h
int _recursion_cnt
char * _keyst
int _kslen
char _key_delim
int _xlat_table

Friends

class dsGetoptMore

Detailed Description

This class provide simple tool to create multilanguage program


Constructor & Destructor Documentation

dsTranslation::dsTranslation (  int    table = none ) 
 

dsTranslation::dsTranslation (  std::istream &    is,
int    table = none
) 
 

dsTranslation::dsTranslation (  char *    fname,
int    table = none
) 
 


Member Function Documentation

void dsApprc::_add (  char *    line )  [protected, inherited]
 

void dsApprc::_add2 (  const char *    key,
const char *    val
)  [protected, inherited]
 

void dsApprc::add (  const char *    key,
int    val
)  [inline, inherited]
 

Add key and value. Already defined keys will be redefined.

Parameters:
key key to add
value value to add

void dsApprc::add (  const char *    key,
const char *    val
)  [inherited]
 

Add key and value. Already defined keys will be redefined.

Parameters:
key key to add
value value to add

void dsApprc::dump (  std::ostream &    os )  [inherited]
 

Output existing keys to stream

Parameters:
os - output stream

void dsTranslation::enableWarnings (  std::ostream *    os = &(std::cerr) )  [inline]
 

int dsApprc::expand_condition (  char *    cond )  [protected, inherited]
 

char * dsApprc::expand_var (  char *    ptr,
int *    vlen = 0
)  [protected, inherited]
 

int dsApprc::getbool (  const char *    key,
int    defval
)  [inline, inherited]
 

Find a key, convert it's value to boolean. Recognised formats Yes/No, True/False,1/0 if key not defined return default value return getbool("Permit", getbool("Permit-default"));

Parameters:
key key to find
defval default value
Returns:
default value

int dsApprc::getbool (  const char *    key )  [inline, inherited]
 

Find a key, convert it's value to boolean. Recognised formats Yes/No, True/False,1/0 See Also: GETB()

Parameters:
key key to find
Exceptions:
INIException thrown if key not defined

double dsApprc::getdouble (  const char *    key,
double    defval
)  [inline, inherited]
 

Find a key, convert it's value to double. if key not defined return default value

Parameters:
key key to find
defval default value
Returns:
default value

double dsApprc::getdouble (  const char *    key )  [inline, inherited]
 

Find a key, convert it's value to double. See Also: GETD()

Parameters:
key key to find
Exceptions:
INIException thrown if key not defined

long dsApprc::getlong (  const char *    key,
long    defval
)  [inline, inherited]
 

Find a key, convert it's value to long. if key not defined return default value

Parameters:
key key to find
defval default value
Returns:
default value

long dsApprc::getlong (  const char *    key )  [inline, inherited]
 

Find a key, convert it's value to long. See Also: GETL()

Parameters:
key key to find
Exceptions:
INIException thrown if key not defined

char * dsApprc::getstring (  const char *    key,
char *    defval
)  [inline, inherited]
 

Find a key, return found value. if key not defined return default value

Parameters:
key key to find
defval default value
Returns:
default value

char * dsApprc::getstring (  const char *    key,
int    idx
)  [inline, inherited]
 

Find an array key, return found value See Also: GET()

Parameters:
key key to find
idx array index
Exceptions:
INIException thrown if key not defined

char * dsApprc::getstring (  const char *    key )  [inline, inherited]
 

Find a key, return found value See Also: GET()

Parameters:
key key to find
Exceptions:
INIException thrown if key not defined

bool dsTranslation::good (    )  [inline]
 

bool dsTranslation::isTranslated (  char *    key ) 
 

void dsApprc::load (  std::istream &    is )  [inherited]
 

Load and parse data from stream already loaded data will be overwritten

Parameters:
is stream to load
Exceptions:
INIException thrown if file contains reference to undefined key

void dsApprc::load (  const char *    filename )  [inherited]
 

Load and parse data from file already loaded data will be overwritten

Parameters:
filename name of file to load
Exceptions:
INIException thrown if file contains reference to undefined key

void dsApprc::pop (    )  [inherited]
 

Remove topmoust common prefix from stack

Exceptions:
keyException thrown if stack underflow

void dsApprc::push (  int    array_key )  [inherited]
 

Push array index into key stack to refer array item

Parameters:
array_key array index

void dsApprc::push (  const char *    key )  [inherited]
 

Push common prefix into key stack All keys begins from - will refer to stack

Parameters:
key common prefix to push

char * dsApprc::seek (  const char *    key,
int    idx
)  [inherited]
 

Find an element of array

Parameters:
key key to find
idx array index
Returns:
pointer to value or NULL if key not defined

char * dsApprc::seek (  const char *    key )  [inherited]
 

Find a key

Parameters:
key key to find
Returns:
pointer to value or NULL if key not defined

void dsApprc::set_delimiter (  char    delim )  [inline, inherited]
 

Set delemiter of key parts. Default is hiphen '-'

Parameters:
delim delimiter of key parts.

void dsApprc::set_xlat (  int    table )  [inline, inherited]
 

Set encoding translation, see xlat.h Default is none

Parameters:
xlate_table num of translation table from xlat.h

char * dsTranslation::translate (  char *    key ) 
 

char * dsApprc::trim (  char *    src )  [protected, inherited]
 

void dsApprc::undefined_key_exception (  const char *    key )  [inline, protected, inherited]
 


Friends And Related Function Documentation

friend class dsGetoptMore [friend, inherited]
 


Member Data Documentation

dsHashTable* dsApprc::_h [protected, inherited]
 

char dsApprc::_key_delim [protected, inherited]
 

char* dsApprc::_keyst [protected, inherited]
 

int dsApprc::_kslen [protected, inherited]
 

int dsApprc::_recursion_cnt [protected, inherited]
 

int dsApprc::_xlat_table [protected, inherited]
 


The documentation for this class was generated from the following files:
Generated on Mon May 16 18:27:01 2005 for libdms4 by doxygen1.3-rc2