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

wvprotostream.h

Go to the documentation of this file.
00001 /*
00002  * Worldvisions Weaver Software:
00003  *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
00004  */
00005 #ifndef __WVPROTOSTREAM_H
00006 #define __WVPROTOSTREAM_H
00007 
00008 #include "wvstreamclone.h"
00009 
00010 class WvLog;
00011 
00018 class WvProtoStream : public WvStreamClone
00019 {
00020 public:
00021     WvProtoStream(WvStream **_cloned, WvLog *_debuglog = NULL);
00022     virtual ~WvProtoStream();
00023     
00024     class Token;
00025     class TokenList;
00026     
00030     virtual size_t uwrite(const void *buffer, size_t size);
00031 
00032     // Routines to convert an input line into a set of Tokens.
00033     virtual Token *next_token();
00034     WvString next_token_str();
00035     WvString token_remaining();
00036     virtual TokenList *tokenize();
00037     size_t list_to_array(TokenList *tl, Token **array);
00038     Token *tokline(const char *line);
00039     
00043     int tokanal(const Token &t, char **lookup,
00044                 bool case_sensitive = false);
00045     
00046     // finite state machine
00047     int state;
00048     virtual void do_state(Token &t1);
00049     virtual void switch_state(int newstate);
00050     
00054     virtual void execute();
00055     
00056 protected:
00057     WvLog *logp;
00058     
00059 public:
00060     class Token
00061     {
00062     public:
00063         WvString data;
00064         size_t length;
00065         
00066         Token();
00067         Token(const unsigned char *_data, size_t _length);
00068         void fill(const unsigned char *_data, size_t _length);
00069         ~Token();
00070     };
00071     
00072     DeclareWvList(Token);
00073 
00074     WvBuffer tokbuf;
00075     bool log_enable;
00076 };
00077 
00078 
00079 #endif // __WVPROTOSTREAM_H

Generated on Sun Mar 16 01:01:11 2003 for WvStreams by doxygen1.3-rc3