summaryrefslogtreecommitdiff
path: root/src/smlrenderervt100.h
blob: 0f82ca9f2a6cfea399814ef1f74ece7d5ec34a91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef SML_RENDERER_VT100_H
#define SML_RENDERER_VT100_H

#include "smlrenderer.h"

class SmlRendererVt100 : public SmlRenderer
{
public:
	SmlRendererVt100();
	virtual ~SmlRendererVt100();

	virtual void render( Bu::Formatter &f, const SmlNode *pRoot );

private:
	enum Style
	{
		stNone		= 0x000000,

		stRed		= 0x010001,
		stGreen		= 0x010002,
		stYellow	= 0x010003,
		stBlue		= 0x010004,
		stMagenta	= 0x010005,
		stCyan		= 0x010006,
		stWhite		= 0x010007,

		stColor		= 0x01000f,

		stTypeMask	= 0xff0000,
	};

	typedef Bu::List<Style> StyleStack;

	void appendToken( Bu::Formatter &f, Bu::String &sCurLine,
		Bu::String &sNextToken, int &iLineLen, int &iNextLen );
	Bu::String getStyle( const StyleStack &sStyle );
	Style strToStyle( const Bu::String &sStyle );
};

#endif