Hopefully create a branch and not destroy the svn repository.
[reactos.git] / base / applications / network / telnet / src / tparser.h
1 // A TParser is a class for parsing input and formatting it (presumabyl for
2 // display on the screen). All parsers are derived from the TParser class,
3 // in order to facilitate extending telnet to include other kinds of
4 // output. Currently, only one parser is implemented, the ANSI parser.
5 // A TParser includes:
6 // - A ParseBuffer function, which takes as parameters start and end
7 // pointers. It returns a pointer to the last character parsed plus 1.
8 // The start pointer is the beginning of the buffer, and the end
9 // pointer is one character after the end of the buffer.
10 // - An Init() function, which will re-initialize the parser when
11 // necessary.
12
13 #ifndef __TPARSER_H
14 #define __TPARSER_H
15
16 #include "tconsole.h"
17 #include "keytrans.h"
18 #include "tscroll.h"
19 #include "tnetwork.h"
20 #include "tcharmap.h"
21
22 class TParser {
23 public:
24 TParser(TConsole &RefConsole, KeyTranslator &RefKeyTrans,
25 TScroller &RefScroller, TNetwork &RefNetwork, TCharmap &RefCharmap) :
26 Console(RefConsole), KeyTrans(RefKeyTrans), Scroller (RefScroller),
27 Network(RefNetwork), Charmap(RefCharmap) {}
28 virtual ~TParser() {}
29
30 /* TParser& operator= (const TParser &p) {
31 Console = p.Console;
32 KeyTrans = p.KeyTrans;
33 Scroller = p.Scroller;
34 Network = p.Network;
35 return *this;
36 }*/
37
38 virtual char *ParseBuffer(char *pszBuffer, char *pszBufferEnd) = 0;
39 virtual void Init() = 0;
40
41 protected:
42 TConsole &Console;
43 KeyTranslator &KeyTrans;
44 TScroller &Scroller;
45 TNetwork &Network;
46 TCharmap &Charmap;
47 };
48
49 #endif