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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#ifndef TEXO_INCLUDED_TEXO
#define TEXO_INCLUDED_TEXO
#include <stdio.h>
class Texo {
public:
enum Type {
character = 0,
link_begin,
link_end,
image,
bold_begin,
bold_end,
italic_begin,
italic_end,
strike_begin,
strike_end,
underline_begin,
underline_end,
paragraph_begin,
paragraph_end,
newline
} type;
Texo(Type type);
Texo(const char c);
const char c;
const char *link_url;
const char *image_src;
const char *image_alt;
};
class TexoExporter {
public:
virtual void Put(const char c) = 0;
virtual void PutStr(const char *str);
};
class TexoProducer {
public:
TexoProducer(TexoExporter &exporter);
virtual void Put(const Texo &piece) = 0;
virtual void PutStr(const char *str);
protected:
TexoExporter &exporter;
};
class TexoImporter {
public:
TexoImporter(TexoProducer &producer);
virtual void Put(const char c) = 0;
virtual void PutStr(const char *str);
virtual void PutFile(FILE *file);
protected:
TexoProducer &producer;
};
#endif
|