diff -r 46db0e6e548b -r 513ea30d2fa3 src/Configuration.h --- a/src/Configuration.h Sun May 05 23:09:20 2019 +0200 +++ b/src/Configuration.h Mon May 06 16:00:20 2019 +0200 @@ -24,10 +24,62 @@ namespace tr { namespace awk { +class DefinitionRecipe { +public: + + virtual ~DefinitionRecipe() { + } + + relpipe::writer::string_t name; + relpipe::writer::string_t type; + relpipe::writer::string_t value; +}; + +class RelationConfiguration { +public: + + virtual ~RelationConfiguration() { + } + + relpipe::writer::string_t relation; + relpipe::writer::string_t awkBeforeRecords; + relpipe::writer::string_t awkAfterRecords; + relpipe::writer::string_t awkForEach; + + /** + * Variable definitions for this relation. + * Can be used as a safe way for passing parameters from the outside environment. + * See also Configuration::definitions (can be overridden by relation's definitions) + */ + std::vector definitions; + + /** + * If empty, output relation will have same metadata as the input relation. + */ + std::vector writerMetadata; + + /** + * Whether original attributes should be appended to those specified using --output-attribute + */ + bool inputAttributesAppend = false; + + /** + * Whether original attributes should be prepended to those specified using --output-attribute + */ + bool inputAttributesPrepend = false; +}; + class Configuration { public: - relpipe::writer::string_t awkExpression; + vector relationConfigurations; + + /** + * Global definitions for all relations. + * Can be used as a safe way for passing parameters from the outside environment. + * See also RelationConfiguration::definitions + */ + std::vector definitions; virtual ~Configuration() { }