summaryrefslogtreecommitdiff
path: root/src/smlrenderervt100.h
blob: ed5dd4225bd4d731066f4247f21bf22e5ffad48f (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
#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
	{
		stRed		= 0x010001,
		stGreen		= 0x010002,

		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 );
};

#endif