TelnetBuffer Class Reference

#include <TelnetBuffer.h>

List of all members.


Public Member Functions

 TelnetBuffer ()
 Public constructor.
virtual ~TelnetBuffer ()
 Vitual destructor.
common::ErrorCodeType Receive (TcpSocket &rSocket)
 Recieves data.
const std::string & GetBuffer () const
 Gets buffer.

Private Types

enum  EscapeState {
  ESCAPE_STATE_IDLE, ESCAPE_STATE_CSI, ESCAPE_STATE_CMD, ESCAPE_STATE_STR,
  ESCAPE_STATE_INT
}
 Enumeration of ANSI escape states. More...

Private Member Functions

void ProcessCharacter (char ch, TcpSocket &rSocket)
 Processes character.
void ProcessControlCharacter (char ch, TcpSocket &rSocket)
 Processes control character.
void ProcessEscapeSequence (char ch, TcpSocket &rSocket)
 Processes escape sequence.

Private Attributes

std::string m_Buffer
 Buffered data.
TcpSocketm_pSocket
 Pointer to socket.
bool m_Receiving
 Receiving data.
EscapeState m_EscapeState
 ANSI escape state.

Detailed Description

TelnetBuffer class.
Full Description
This class provides basic telnet buffer functionality, including simple line editing and ansi escape sequence handling.

Member Enumeration Documentation

enum EscapeState [private]

Enumeration of ANSI escape states.

Enumerator:
ESCAPE_STATE_IDLE  Waiting for escape character.
ESCAPE_STATE_CSI  Waiting for left bracket.
ESCAPE_STATE_CMD  Waiting for command letter.
ESCAPE_STATE_STR  Processing string argument.
ESCAPE_STATE_INT  Intermediate characters.


Constructor & Destructor Documentation

TelnetBuffer (  ) 

Public constructor.

Full Description
This method creates a new instance of the class.
Returns:
New instance of the class.

~TelnetBuffer (  )  [virtual]

Vitual destructor.

Full Description
This method destroys an existing instance of the class.
Returns:
None.


Member Function Documentation

common::ErrorCodeType Receive ( TcpSocket rSocket  ) 

Recieves data.

Full Description
This method receives telnet data.
Returns:
Success if successful.

Failure otherwise.

Parameters:
rSocket  TCP socket.

const std::string& GetBuffer (  )  const [inline]

Gets buffer.

void ProcessCharacter ( char  ch,
TcpSocket rSocket 
) [private]

Processes character.

Parameters:
ch  Character to be processed.
rSocket  Socket reference.

void ProcessControlCharacter ( char  ch,
TcpSocket rSocket 
) [private]

Processes control character.

Parameters:
ch  Character to be processed.
rSocket  Socket reference.

void ProcessEscapeSequence ( char  ch,
TcpSocket rSocket 
) [private]

Processes escape sequence.

Parameters:
ch  Character to be processed.
rSocket  Socket reference.


Member Data Documentation

std::string m_Buffer [private]

Buffered data.

TcpSocket* m_pSocket [private]

Pointer to socket.

bool m_Receiving [private]

Receiving data.

ANSI escape state.


The documentation for this class was generated from the following files: