Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

BasicEngine Class Reference

This class provides the basics for a finite-state machine to transliterate, but does NOT contain any language-specific information. More...

#include <BasicEngine.h>

Inheritance diagram for BasicEngine:

AmharicEngine List of all members.

Public Methods

 BasicEngine ()
PWCHAR to_send ()
 returns a pointer to the ToSend buffer.

bool InANumber () const
 Since numbers are handled differently than other characters (i.e., they're converted as a group), we need to know if we're in a number state.

void resetNumState ()
 we are no longer in a number state.

void setExcelMode (bool wh)
 sets the protected member isExcel to remember whether we are in Excel.

bool inExcelMode ()
 While in Excel, we have to always repaste the contents of the entire cell as new characters are typed, so remember whether or not we are in Excel.

void reset ()
 resets character buffer, number buffer, and 2 boolean states.

void clearToSend ()
 empties the ToSend buffer.

void shift_left ()
 removes the last value from the ToSend buffer & places it in the previous position.

void backspace ()
 used to effectively backspace in Excel.

bool bufferEmpty () const
 returns true if the ToSend buffer is empty.


Protected Types

typedef int StateType
enum  {
  BIG_NUMBER = 524
}

Protected Methods

bool stateSomething ()
 are we in Excel? returns true if we have a State other than Nothing for our state diagram.

void complete_syllable (const int& syllable)
 we have a syllable that is ready for output -- add it to ToSend & call reset.

void develop_state (const StateType& new_state)
 set the new state and append the last incoming character to Buffer.

void make_syllable (const StateType& new_state, const int& syllable)
 adds a new syllable to the ToSend buffer and places the state diagram in a new state.

void append (PWCHAR str, const WCHAR& ch)
 adds a character to the end of a buffer.


Protected Attributes

WCHAR Buffer [BIG_NUMBER]
StateType State
 all chars read in so far.

WCHAR ToSend [BIG_NUMBER]
 Classification of buffer pattern.

WCHAR ActualChar
 What should be printed next.

WCHAR numberBuffer [BIG_NUMBER]
 Last thing read in, not yet processed.

bool numberState
 buffer just for numbers.

bool isExcel
 Are we in the midst of a #?


Member Typedef Documentation

typedef int StateType [protected]
 


Member Enumeration Documentation

anonymous enum [protected]
 

Enumeration values:
BIG_NUMBER  


Constructor & Destructor Documentation

BasicEngine ( ) [inline]
 


Member Function Documentation

bool InANumber ( ) const [inline]
 

void append ( PWCHAR str,
const WCHAR & ch ) [protected]
 

void backspace ( )
 

bool bufferEmpty ( ) const [inline]
 

void clearToSend ( ) [inline]
 

void complete_syllable ( const int & syllable ) [inline, protected]
 

void develop_state ( const StateType & new_state ) [inline, protected]
 

bool inExcelMode ( ) [inline]
 

void make_syllable ( const StateType & new_state,
const int & syllable ) [inline, protected]
 

void reset ( ) [inline]
 

void resetNumState ( ) [inline]
 

void setExcelMode ( bool wh ) [inline]
 

void shift_left ( )
 

bool stateSomething ( ) [inline, protected]
 

PWCHAR to_send ( ) [inline]
 


Member Data Documentation

WCHAR ActualChar [protected]
 

WCHAR Buffer[BIG_NUMBER] [protected]
 

StateType State [protected]
 

WCHAR ToSend[BIG_NUMBER] [protected]
 

bool isExcel [protected]
 

WCHAR numberBuffer[BIG_NUMBER] [protected]
 

bool numberState [protected]
 


The documentation for this class was generated from the following files:
Generated at Tue Jan 30 17:03:28 2001 for UniGeez by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000