54 |
54 |
55 public: |
55 public: |
56 |
56 |
57 static const string_t OPTION_NAMESPACE; |
57 static const string_t OPTION_NAMESPACE; |
58 static const string_t OPTION_RELATION; |
58 static const string_t OPTION_RELATION; |
|
59 static const string_t OPTION_NAME_IS_XPATH; |
59 static const string_t OPTION_RECORDS; |
60 static const string_t OPTION_RECORDS; |
60 static const string_t OPTION_ATTRIBUTE; |
61 static const string_t OPTION_ATTRIBUTE; |
61 |
62 |
62 Configuration parse(const std::vector<string_t>& arguments) { |
63 Configuration parse(const std::vector<string_t>& arguments) { |
63 Configuration c; |
64 Configuration c; |
70 c.namespaceMappings.push_back(readNext(arguments, i)); |
71 c.namespaceMappings.push_back(readNext(arguments, i)); |
71 c.namespaceMappings.push_back(readNext(arguments, i)); |
72 c.namespaceMappings.push_back(readNext(arguments, i)); |
72 } else if (option == OPTION_RELATION) { |
73 } else if (option == OPTION_RELATION) { |
73 addRelation(c, currentRelation); // previous relation |
74 addRelation(c, currentRelation); // previous relation |
74 currentRelation.relation = readNext(arguments, i); |
75 currentRelation.relation = readNext(arguments, i); |
|
76 } else if (option == OPTION_NAME_IS_XPATH) { |
|
77 currentRelation.nameIsXPath = true; |
75 } else if (option == OPTION_RECORDS) { |
78 } else if (option == OPTION_RECORDS) { |
76 currentRelation.xpath = readNext(arguments, i); |
79 currentRelation.xpath = readNext(arguments, i); |
77 } else if (option == OPTION_ATTRIBUTE) { |
80 } else if (option == OPTION_ATTRIBUTE) { |
78 AttributeRecipe attribute; |
81 AttributeRecipe attribute; |
79 attribute.name = readNext(arguments, i); |
82 attribute.name = readNext(arguments, i); |
91 } |
94 } |
92 }; |
95 }; |
93 |
96 |
94 const string_t CLIParser::OPTION_NAMESPACE = L"--namespace"; |
97 const string_t CLIParser::OPTION_NAMESPACE = L"--namespace"; |
95 const string_t CLIParser::OPTION_RELATION = L"--relation"; |
98 const string_t CLIParser::OPTION_RELATION = L"--relation"; |
|
99 const string_t CLIParser::OPTION_NAME_IS_XPATH = L"--name-is-xpath"; |
96 const string_t CLIParser::OPTION_RECORDS = L"--records"; |
100 const string_t CLIParser::OPTION_RECORDS = L"--records"; |
97 const string_t CLIParser::OPTION_ATTRIBUTE = L"--attribute"; |
101 const string_t CLIParser::OPTION_ATTRIBUTE = L"--attribute"; |
98 |
102 |
99 } |
103 } |
100 } |
104 } |