22 |
22 |
23 namespace relpipe { |
23 namespace relpipe { |
24 namespace tr { |
24 namespace tr { |
25 namespace awk { |
25 namespace awk { |
26 |
26 |
|
27 class DefinitionRecipe { |
|
28 public: |
|
29 |
|
30 virtual ~DefinitionRecipe() { |
|
31 } |
|
32 |
|
33 relpipe::writer::string_t name; |
|
34 relpipe::writer::string_t type; |
|
35 relpipe::writer::string_t value; |
|
36 }; |
|
37 |
|
38 class RelationConfiguration { |
|
39 public: |
|
40 |
|
41 virtual ~RelationConfiguration() { |
|
42 } |
|
43 |
|
44 relpipe::writer::string_t relation; |
|
45 relpipe::writer::string_t awkBeforeRecords; |
|
46 relpipe::writer::string_t awkAfterRecords; |
|
47 relpipe::writer::string_t awkForEach; |
|
48 |
|
49 /** |
|
50 * Variable definitions for this relation. |
|
51 * Can be used as a safe way for passing parameters from the outside environment. |
|
52 * See also Configuration::definitions (can be overridden by relation's definitions) |
|
53 */ |
|
54 std::vector<DefinitionRecipe> definitions; |
|
55 |
|
56 /** |
|
57 * If empty, output relation will have same metadata as the input relation. |
|
58 */ |
|
59 std::vector<relpipe::writer::AttributeMetadata> writerMetadata; |
|
60 |
|
61 /** |
|
62 * Whether original attributes should be appended to those specified using --output-attribute |
|
63 */ |
|
64 bool inputAttributesAppend = false; |
|
65 |
|
66 /** |
|
67 * Whether original attributes should be prepended to those specified using --output-attribute |
|
68 */ |
|
69 bool inputAttributesPrepend = false; |
|
70 }; |
|
71 |
27 class Configuration { |
72 class Configuration { |
28 public: |
73 public: |
29 |
74 |
30 relpipe::writer::string_t awkExpression; |
75 vector<RelationConfiguration> relationConfigurations; |
|
76 |
|
77 /** |
|
78 * Global definitions for all relations. |
|
79 * Can be used as a safe way for passing parameters from the outside environment. |
|
80 * See also RelationConfiguration::definitions |
|
81 */ |
|
82 std::vector<DefinitionRecipe> definitions; |
31 |
83 |
32 virtual ~Configuration() { |
84 virtual ~Configuration() { |
33 } |
85 } |
34 }; |
86 }; |
35 |
87 |