forked from chronoxor/FastBinaryEncoding
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerator.h
More file actions
51 lines (38 loc) · 1 KB
/
generator.h
File metadata and controls
51 lines (38 loc) · 1 KB
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
/*!
\file generator.h
\brief Fast binary encoding generator definition
\author Ivan Shynkarenka
\date 20.04.2018
\copyright MIT License
*/
#ifndef GENERATOR_H
#define GENERATOR_H
#include "fbe.h"
namespace FBE {
class Generator
{
public:
Generator(const std::string& input, const std::string& output, int indent, char space);
virtual void Generate(const std::shared_ptr<Package>& package) = 0;
protected:
std::string _buffer;
std::string _input;
std::string _output;
int _cursor{0};
int _indent;
char _space;
void Indent(int count);
void WriteBegin();
void Write(const std::string& str);
void WriteIndent();
void WriteIndent(const std::string& str);
void WriteLine();
void WriteLine(const std::string& str);
void WriteLineIndent(const std::string& str);
void WriteEnd();
void Store(const CppCommon::Path& filename);
static std::string EndLine();
};
} // namespace FBE
#include "generator.inl"
#endif // GENERATOR_H