summaryrefslogtreecommitdiff
path: root/src/plain.hpp
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2019-10-18 17:33:06 +0300
committerAleksey Veresov <aleksey@veresov.pro>2019-10-18 17:33:06 +0300
commit2c12c0652d2b8c8440e1e908f004826840ed14ab (patch)
tree881dd649f2b15ba5a8cd3aa285d073eee7c73386 /src/plain.hpp
parent9a23fd146be4ba64b0cb720993bdc73a514fecf2 (diff)
downloadtexo-2c12c0652d2b8c8440e1e908f004826840ed14ab.tar
texo-2c12c0652d2b8c8440e1e908f004826840ed14ab.tar.xz
texo-2c12c0652d2b8c8440e1e908f004826840ed14ab.zip
[texo] Semi-working.
Diffstat (limited to 'src/plain.hpp')
-rw-r--r--src/plain.hpp36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/plain.hpp b/src/plain.hpp
index d1a9efb..6fa086f 100644
--- a/src/plain.hpp
+++ b/src/plain.hpp
@@ -4,18 +4,52 @@
#include "exporter.hpp"
#include "producer.hpp"
#include "importer.hpp"
-#include "texo.hpp"
class TexoProducerPlain: public TexoProducer {
public:
TexoProducerPlain(TexoExporter &exporter);
+
+ void Put(const Texo &piece);
+
+ void Put(const TexoHeader &piece);
+ void Put(const TexoParagraph &piece);
+ void Put(const TexoQuote &piece);
+
+ void Put(const TexoLineBreak &piece);
+ void Put(const TexoHorizontalRule &piece);
+
+private:
+ bool quoted;
};
class TexoImporterPlain: public TexoImporter {
public:
TexoImporterPlain(TexoProducer &producer);
+ ~TexoImporterPlain();
+
+ void Put(char c);
+ void Put(const ScriptVariable &str);
+
+private:
+ enum State {
+ text,
+ space,
+ newline,
+ paragraph,
+ quote,
+ quote_newline,
+ header
+ } state;
+
+ void Text(char c);
+ void Space(char c);
+ void Newline(char c);
+ void Paragraph(char c);
+ void Quote(char c);
+ void QuoteNewline(char c);
+ void Header(char c);
};