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

WvProtoStream Class Reference

#include <wvprotostream.h>

Inheritance diagram for WvProtoStream:

WvStreamClone WvStreamClone WvStream WvStream WvStream WvStream List of all members.

Public Methods

 WvProtoStream (WvStream **_cloned, WvLog *_debuglog=NULL)
virtual ~WvProtoStream ()
virtual size_t uwrite (const void *buffer, size_t size)
virtual Tokennext_token ()
WvString next_token_str ()
WvString token_remaining ()
virtual TokenListtokenize ()
size_t list_to_array (TokenList *tl, Token **array)
Tokentokline (const char *line)
int tokanal (const Token &t, char **lookup, bool case_sensitive=false)
virtual void do_state (Token &t1)
virtual void switch_state (int newstate)
virtual void execute ()
 WvProtoStream (WvStream **_cloned, WvLog *_debuglog=NULL)
virtual ~WvProtoStream ()
virtual size_t uwrite (const void *buffer, size_t size)
virtual Tokennext_token ()
WvString next_token_str ()
WvString token_remaining ()
virtual TokenListtokenize ()
size_t list_to_array (TokenList *tl, Token **array)
Tokentokline (const char *line)
int tokanal (const Token &t, char **lookup, bool case_sensitive=false)
virtual void do_state (Token &t1)
virtual void switch_state (int newstate)
virtual void execute ()
 DeclareWvList (Token)

Public Attributes

int state
WvBuffer tokbuf
bool log_enable

Protected Attributes

WvLoglogp
WvLoglogp

Detailed Description

WvProtoStream is a framework that makes it easy to communicate using common command-response driven protocols. This is supposed to be flexible enough to handle FTP, HTTP, SMTP, tunnelv, Weaver rcmd, and many others.

Definition at line 18 of file include/wvprotostream.h.


Constructor & Destructor Documentation

WvProtoStream::WvProtoStream WvStream **    _cloned,
WvLog   _debuglog = NULL
 

Definition at line 16 of file wvprotostream.cc.

References WvLog::Debug3, log_enable, logp, and state.

WvProtoStream::~WvProtoStream   [virtual]
 

Definition at line 29 of file wvprotostream.cc.

References logp.

WvProtoStream::WvProtoStream WvStream **    _cloned,
WvLog   _debuglog = NULL
 

virtual WvProtoStream::~WvProtoStream   [virtual]
 


Member Function Documentation

WvProtoStream::DeclareWvList Token   
 

virtual void WvProtoStream::do_state Token   t1 [virtual]
 

void WvProtoStream::do_state Token   t1 [virtual]
 

Definition at line 175 of file wvprotostream.cc.

Referenced by execute().

virtual void WvProtoStream::execute   [virtual]
 

pass input through to the state machine, one line at a time

Reimplemented from WvStreamClone.

void WvProtoStream::execute   [virtual]
 

pass input through to the state machine, one line at a time

Reimplemented from WvStreamClone.

Definition at line 189 of file wvprotostream.cc.

References do_state(), WvStreamClone::execute(), WvStream::getline(), and tokline().

size_t WvProtoStream::list_to_array TokenList   tl,
Token **    array
 

size_t WvProtoStream::list_to_array TokenList   tl,
Token **    array
 

Definition at line 111 of file wvprotostream.cc.

References WvListBase::count(), WvProtoStream::Token::data, and WvProtoStream::Token::length.

virtual Token* WvProtoStream::next_token   [virtual]
 

WvProtoStream::Token * WvProtoStream::next_token   [virtual]
 

Definition at line 51 of file wvprotostream.cc.

References WvBuffer::get(), WvBuffer::match(), and tokbuf.

Referenced by next_token_str(), tokenize(), and tokline().

WvString WvProtoStream::next_token_str  
 

WvString WvProtoStream::next_token_str  
 

Definition at line 65 of file wvprotostream.cc.

References WvProtoStream::Token::data, next_token(), and WvStreamClone::s().

virtual void WvProtoStream::switch_state int    newstate [virtual]
 

void WvProtoStream::switch_state int    newstate [virtual]
 

Definition at line 180 of file wvprotostream.cc.

References state.

int WvProtoStream::tokanal const Token   t,
char **    lookup,
bool    case_sensitive = false
 

Convert token strings to enum values

int WvProtoStream::tokanal const Token   t,
char **    lookup,
bool    case_sensitive = false
 

Convert token strings to enum values

Definition at line 157 of file wvprotostream.cc.

References WvProtoStream::Token::data.

WvString WvProtoStream::token_remaining  
 

WvString WvProtoStream::token_remaining  
 

Definition at line 76 of file wvprotostream.cc.

References WvBuffer::get(), WvBuffer::put(), tokbuf, trim_string(), and WvBuffer::used().

virtual TokenList* WvProtoStream::tokenize   [virtual]
 

WvProtoStream::TokenList * WvProtoStream::tokenize   [virtual]
 

Definition at line 86 of file wvprotostream.cc.

References WvList< Token >::append(), WvListBase::count(), log_enable, logp, and next_token().

Token* WvProtoStream::tokline const char *    line
 

WvProtoStream::Token * WvProtoStream::tokline const char *    line
 

Definition at line 136 of file wvprotostream.cc.

References next_token(), WvBuffer::put(), tokbuf, trim_string(), and WvBuffer::zap().

Referenced by execute().

virtual size_t WvProtoStream::uwrite const void *    buffer,
size_t    size
[virtual]
 

override uwrite() so we can log all output

Reimplemented from WvStreamClone.

size_t WvProtoStream::uwrite const void *    buffer,
size_t    size
[virtual]
 

override uwrite() so we can log all output

Reimplemented from WvStreamClone.

Definition at line 38 of file wvprotostream.cc.

References log_enable, logp, size, WvStreamClone::uwrite(), and WvStream::write().


Member Data Documentation

bool WvProtoStream::log_enable
 

Definition at line 75 of file streams/wvprotostream.h.

Referenced by tokenize(), uwrite(), WvProtoStream(), and WvProtoStream::TokenList::~TokenList().

WvLog* WvProtoStream::logp [protected]
 

Definition at line 57 of file streams/wvprotostream.h.

WvLog* WvProtoStream::logp [protected]
 

Definition at line 57 of file include/wvprotostream.h.

Referenced by tokenize(), uwrite(), WvProtoStream(), and ~WvProtoStream().

int WvProtoStream::state
 

Definition at line 47 of file streams/wvprotostream.h.

Referenced by switch_state(), and WvProtoStream().

WvBuffer WvProtoStream::tokbuf
 

Definition at line 74 of file streams/wvprotostream.h.

Referenced by next_token(), token_remaining(), tokline(), and WvProtoStream::TokenList::~TokenList().


The documentation for this class was generated from the following files:
Generated on Sat Aug 24 23:08:04 2002 for WvStreams by doxygen1.2.15