summaryrefslogtreecommitdiff
path: root/examples/lines.cpp
blob: 5c244447d72a8f5d5236c5d64f6117f7eef4aa61 (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
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
#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;
}