From 2eae362fd3f50325067fa3d7e13db6882df80e76 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Fri, 27 Sep 2019 18:09:07 +0300 Subject: Texo initial. --- src/texo.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/texo.cpp (limited to 'src/texo.cpp') diff --git a/src/texo.cpp b/src/texo.cpp new file mode 100644 index 0000000..1a2974a --- /dev/null +++ b/src/texo.cpp @@ -0,0 +1,44 @@ +#include "texo.hpp" + + +Texo::Texo(Type type): type(type), c(0) {} + +Texo::Texo(const char c): type(character), c(c) {} + + +void TexoExporter::PutStr(const char *str) +{ + if (str) { + while (*str) { + Put(*str); + ++str; + } + } +} + + +TexoProducer::TexoProducer(TexoExporter &exporter): exporter(exporter) {} + + +TexoImporter::TexoImporter(TexoProducer &producer): producer(producer) {} + +void TexoImporter::PutStr(const char *str) +{ + if (str) { + while (*str) { + Put(*str); + ++str; + } + Put(0); + } +} + +void TexoImporter::PutFile(FILE *file) +{ + if (file) { + for (int c = fgetc(file); c != EOF; c = fgetc(file)) { + Put(c); + } + Put(0); + } +} -- cgit v1.2.3