forked from ElektraInitiative/libelektra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhighlevel.hpp
62 lines (55 loc) · 2.08 KB
/
highlevel.hpp
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
62
/**
* @file
*
* @brief
*
* @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
*/
#ifndef ELEKTRA_KDB_GEN_HIGHLEVEL_HPP
#define ELEKTRA_KDB_GEN_HIGHLEVEL_HPP
#include <gen/template.hpp>
class HighlevelGenTemplate : public GenTemplate
{
struct Params
{
static const char * const InitFunctionName;
static const char * const HelpFunctionName;
static const char * const SpecloadFunctionName;
static const char * const RunCommandsFunctionName;
static const char * const TagPrefix;
static const char * const EnumConversion;
static const char * const AdditionalHeaders;
static const char * const GenerateSetters;
static const char * const EmbeddedSpec;
static const char * const InstallPrefix;
static const char * const EmbedHelpFallback;
static const char * const UseCommands;
static const char * const InitWithPointers;
};
public:
HighlevelGenTemplate ()
: GenTemplate ("highlevel", { ".c", ".h", ".spec.eqd", ".mount.sh", ".commands.h" },
{ "enum.c", "union.c", "struct.c", "struct.alloc.fields.c", "enum.decl.h", "struct.decl.h", "union.decl.h",
"keys.fun.h", "keys.fun.struct.h", "keys.fun.structref.h", "keys.tags.h", "context.fun.h", "context.tags.h" },
{ { Params::InitFunctionName, false },
{ Params::HelpFunctionName, false },
{ Params::SpecloadFunctionName, false },
{ Params::RunCommandsFunctionName, false },
{ Params::TagPrefix, false },
{ Params::EnumConversion, false },
{ Params::AdditionalHeaders, false },
{ Params::GenerateSetters, false },
{ Params::EmbeddedSpec, false },
{ Params::InstallPrefix, false },
{ Params::EmbedHelpFallback, false },
{ Params::UseCommands, false },
{ Params::InitWithPointers, false } })
{
}
protected:
kainjow::mustache::data getTemplateData (const std::string & outputName, const std::string & part, const kdb::KeySet & ks,
const std::string & parentKey) const override;
std::string escapeFunction (const std::string & str) const override;
std::vector<std::string> getActualParts () const override;
};
#endif // ELEKTRA_KDB_GEN_HIGHLEVEL_HPP