0
|
1 |
/**
|
|
2 |
* Relational pipes
|
|
3 |
* Copyright © 2020 František Kučera (Frantovo.cz, GlobalCode.info)
|
|
4 |
*
|
|
5 |
* This program is free software: you can redistribute it and/or modify
|
|
6 |
* it under the terms of the GNU General Public License as published by
|
|
7 |
* the Free Software Foundation, version 3 of the License.
|
|
8 |
*
|
|
9 |
* This program is distributed in the hope that it will be useful,
|
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12 |
* GNU General Public License for more details.
|
|
13 |
*
|
|
14 |
* You should have received a copy of the GNU General Public License
|
|
15 |
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16 |
*/
|
|
17 |
#pragma once
|
|
18 |
|
|
19 |
#include <vector>
|
|
20 |
|
|
21 |
#include <relpipe/common/type/typedefs.h>
|
|
22 |
|
|
23 |
|
|
24 |
namespace relpipe {
|
|
25 |
namespace tr {
|
|
26 |
namespace xpath {
|
|
27 |
|
|
28 |
enum class InputAttributePolicy {
|
|
29 |
Prepend,
|
|
30 |
Append,
|
|
31 |
Auto
|
|
32 |
};
|
|
33 |
|
|
34 |
class AttributeRecipe {
|
|
35 |
public:
|
|
36 |
|
|
37 |
virtual ~AttributeRecipe() {
|
|
38 |
}
|
|
39 |
|
|
40 |
relpipe::common::type::StringX name;
|
|
41 |
relpipe::writer::TypeId type;
|
|
42 |
relpipe::common::type::StringX xpath;
|
|
43 |
};
|
|
44 |
|
|
45 |
class RelationConfiguration {
|
|
46 |
public:
|
|
47 |
|
|
48 |
virtual ~RelationConfiguration() {
|
|
49 |
}
|
|
50 |
|
|
51 |
relpipe::common::type::StringX relation;
|
|
52 |
relpipe::common::type::StringX where;
|
|
53 |
InputAttributePolicy inputAttributePolicy = InputAttributePolicy::Auto;
|
|
54 |
std::vector<AttributeRecipe> outputAttributes;
|
|
55 |
std::vector<relpipe::common::type::StringX> xmlAttributes;
|
|
56 |
};
|
|
57 |
|
|
58 |
class Configuration {
|
|
59 |
public:
|
|
60 |
std::vector<RelationConfiguration> relationConfigurations;
|
|
61 |
std::vector<relpipe::common::type::StringX> namespaceMappings;
|
|
62 |
|
|
63 |
virtual ~Configuration() {
|
|
64 |
}
|
|
65 |
};
|
|
66 |
|
|
67 |
}
|
|
68 |
}
|
|
69 |
} |