diff options
Diffstat (limited to 'examples/lines.cpp')
-rw-r--r-- | examples/lines.cpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/examples/lines.cpp b/examples/lines.cpp new file mode 100644 index 0000000..5c24444 --- /dev/null +++ b/examples/lines.cpp @@ -0,0 +1,61 @@ +#include <stdio.h> +#include <html.hpp> +#include <plain.hpp> +#include <lines.hpp> +#include <markdown.hpp> +#include <file.hpp> + + +void plain() +{ + fputs(" ---- Lines to Plain ----\n\n", stdout); + TexoExporterFile exporter(stdout); + TexoProducerPlain producer(exporter); + TexoImporterLines importer(producer); + FILE *file = fopen("lines.txt", "r"); + importer.Put(file); + fclose(file); +} + +void html() +{ + fputs("\n\n ---- Lines to HTML ----\n\n", stdout); + TexoExporterFile exporter(stdout); + TexoProducerHTML producer(exporter); + TexoImporterLines importer(producer); + FILE *file = fopen("lines.txt", "r"); + importer.Put(file); + fclose(file); +} + +void markdown() +{ + fputs("\n\n ---- Lines to Markdown ----\n\n", stdout); + TexoExporterFile exporter(stdout); + TexoProducerMarkdown producer(exporter); + TexoImporterLines importer(producer); + FILE *file = fopen("lines.txt", "r"); + importer.Put(file); + fclose(file); +} + +void lines() +{ + fputs("\n\n ---- Lines to Lines ----\n\n", stdout); + TexoExporterFile exporter(stdout); + TexoProducerLines producer(exporter); + TexoImporterLines importer(producer); + FILE *file = fopen("lines.txt", "r"); + importer.Put(file); + fclose(file); +} + +int main() +{ + plain(); + html(); + markdown(); + lines(); + + return 0; +} |