equal
deleted
inserted
replaced
26 |
26 |
27 #include <relpipe/cli/CLI.h> |
27 #include <relpipe/cli/CLI.h> |
28 |
28 |
29 #include "INICommand.h" |
29 #include "INICommand.h" |
30 #include "lib/INIReader.h" |
30 #include "lib/INIReader.h" |
|
31 #include "lib/BasicUnescapingINIHandler.h" |
31 |
32 |
32 using namespace std; |
33 using namespace std; |
33 using namespace relpipe::writer; |
34 using namespace relpipe::writer; |
|
35 using namespace relpipe::in::ini::lib; |
34 |
36 |
35 namespace relpipe { |
37 namespace relpipe { |
36 namespace in { |
38 namespace in { |
37 namespace ini { |
39 namespace ini { |
38 |
40 |
47 std::string getCurrentSectionFullName() { |
49 std::string getCurrentSectionFullName() { |
48 std::stringstream result; |
50 std::stringstream result; |
49 |
51 |
50 // TODO: configurable hierarchy delimiter |
52 // TODO: configurable hierarchy delimiter |
51 // TODO: escape delimiter characters that are part of the section names |
53 // TODO: escape delimiter characters that are part of the section names |
|
54 // TODO: hierarchical sections should be returned as an array/sequence when such data type is supported in the Relational pipes format and API |
52 for (int i = 0; i < currentSection.size(); i++) { |
55 for (int i = 0; i < currentSection.size(); i++) { |
53 if (i > 0)result << "/"; |
56 if (i > 0)result << "/"; |
54 result << currentSection[i]; |
57 result << currentSection[i]; |
55 } |
58 } |
56 |
59 |
164 }; |
167 }; |
165 |
168 |
166 void INICommand::process(std::istream& input, std::shared_ptr<writer::RelationalWriter> writer, Configuration& configuration) { |
169 void INICommand::process(std::istream& input, std::shared_ptr<writer::RelationalWriter> writer, Configuration& configuration) { |
167 FlatINIContentHandler handler(writer, configuration); |
170 FlatINIContentHandler handler(writer, configuration); |
168 std::shared_ptr<INIReader> reader(INIReader::create(input)); |
171 std::shared_ptr<INIReader> reader(INIReader::create(input)); |
169 reader->addHandler(&handler); |
172 // TODO: configure the INIReader (features/properties) according to our Configuration (sub-keys etc.) |
|
173 BasicUnescapingINIContentHandler unescapingHandler(handler, true); |
|
174 reader->addHandler(&unescapingHandler); |
170 reader->process(); |
175 reader->process(); |
171 |
176 |
172 } |
177 } |
173 |
178 |
174 } |
179 } |