tparser.h

来自「winNT技术操作系统,国外开放的原代码和LIUX一样」· C头文件 代码 · 共 50 行

H
50
字号
// A TParser is a class for parsing input and formatting it (presumabyl for
// display on the screen).  All parsers are derived from the TParser class,
// in order to facilitate extending telnet to include other kinds of
// output.  Currently, only one parser is implemented, the ANSI parser.
// A TParser includes:
//   - A ParseBuffer function, which takes as parameters start and end
//     pointers.  It returns a pointer to the last character parsed plus 1.
//     The start pointer is the beginning of the buffer, and the end
//     pointer is one character after the end of the buffer.
//   - An Init() function, which will re-initialize the parser when
//     necessary.

#ifndef __TPARSER_H
#define __TPARSER_H

#include "tconsole.h"
#include "keytrans.h"
#include "tscroll.h"
#include "tnetwork.h"
#include "tcharmap.h"

class TParser {
public:
	TParser(TConsole &RefConsole, KeyTranslator &RefKeyTrans,
		TScroller &RefScroller, TNetwork &RefNetwork, TCharmap &RefCharmap) :
	Console(RefConsole), KeyTrans(RefKeyTrans), Scroller (RefScroller),
	Network(RefNetwork), Charmap(RefCharmap) {}
	virtual ~TParser() {}

/*	TParser& operator= (const TParser &p) {
		Console = p.Console;
		KeyTrans = p.KeyTrans;
		Scroller = p.Scroller;
		Network = p.Network;
		return *this;
	}*/

	virtual char *ParseBuffer(char *pszBuffer, char *pszBufferEnd) = 0;
	virtual void Init() = 0;

protected:
	TConsole &Console;
	KeyTranslator &KeyTrans;
	TScroller &Scroller;
	TNetwork &Network;
	TCharmap &Charmap;
};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?