Translate< T > Class Template Reference
[Lexical analysis]

#include <Translate.hh>

List of all members.

Public Member Functions

 Translate (void)
 Translate (T init)
 ~Translate (void)
void char_type (const char *, T val)
operator[] (char c) const
 Translate a character.
T & operator[] (char c)
 Translate a character.
void reset (void)
 Clear the translation table.
void set_alpha (T alfval)
 Set alphabet translation.
void set_numer (T numval)
 Set number translation.
void set_type (const char *x, T val)
 Reset the list of characters with the specified value.
void unset (T val)
 Remove all entries that translate to val.


Detailed Description

template<class T>
class Translate< T >

Translate is a template class that maps the character set to a set of enumerated values. brief Translate character code to another data value.
Author:
J. Zweizig
Version:
1.1; Last Modified August 5, 2004

Constructor & Destructor Documentation

template<class T>
Translate< T >::Translate ( void   )  [inline]

Construct an empty translate table.

template<class T>
Translate< T >::Translate ( init  )  [inline]

Construct a translate table and initialize all characters to the specified value.

template<class T>
Translate< T >::~Translate ( void   )  [inline]

Destry the translate table.


Member Function Documentation

template<class T>
void Translate< T >::char_type ( const char *  ccc,
val 
) [inline]

Set the table to translate the specified characters to listed value.

template<class T>
T Translate< T >::operator[] ( char  c  )  const [inline]

Translate a character.

Get the traslation of the specified character.

Parameters:
c Character to be translated.
Returns:
Translated value.

template<class T>
T & Translate< T >::operator[] ( char  c  )  [inline]

Translate a character.

Get get a reference to the traslation table entry for the specified character.

Parameters:
c Character to be translated.
Returns:
Reference to translation table entry.

template<class T>
void Translate< T >::reset ( void   )  [inline]

Clear the translation table.

Reset all entries of the table to the initial value specified in the constructor.

template<class T>
void Translate< T >::set_alpha ( alfval  )  [inline]

Set alphabet translation.

Set the translation of all alphabetic characters (a-z and A-Z) to the specified value.

Parameters:
alfval New alphabet translation value.

template<class T>
void Translate< T >::set_numer ( numval  )  [inline]

Set number translation.

Set the translation of all numeric characters (0-9) to the specified value.

Parameters:
numval New number translation value.

template<class T>
void Translate< T >::set_type ( const char *  x,
val 
) [inline]

Reset the list of characters with the specified value.

Unset all translation table entries with the specified value. Then set the translation of all characters in the null-terminated string to the specified value.

Parameters:
x Null-terminated string with characters to be translated to val.
val Translation value to be reset.

template<class T>
void Translate< T >::unset ( val  )  [inline]

Remove all entries that translate to val.

Reset all the table entries that translate to val to the initialization value.

Parameters:
val Value to be unset.


The documentation for this class was generated from the following file:
Generated on Sun Mar 8 19:21:13 2009 for dmt by  doxygen 1.5.4