aboutsummaryrefslogtreecommitdiff
path: root/test.cc
diff options
context:
space:
mode:
authorAdrian Kummerländer2014-05-19 22:14:31 +0200
committerAdrian Kummerländer2014-05-19 22:14:31 +0200
commit426265b91d4533b7aa16d53124ad9b5d0a6862d6 (patch)
tree8d42a9e3b27229bad9a194191ca42f32f9717972 /test.cc
parentd19a195985b96701b2ab302538fe24e87e76decf (diff)
downloadInputXSLT-426265b91d4533b7aa16d53124ad9b5d0a6862d6.tar
InputXSLT-426265b91d4533b7aa16d53124ad9b5d0a6862d6.tar.gz
InputXSLT-426265b91d4533b7aa16d53124ad9b5d0a6862d6.tar.bz2
InputXSLT-426265b91d4533b7aa16d53124ad9b5d0a6862d6.tar.lz
InputXSLT-426265b91d4533b7aa16d53124ad9b5d0a6862d6.tar.xz
InputXSLT-426265b91d4533b7aa16d53124ad9b5d0a6862d6.tar.zst
InputXSLT-426265b91d4533b7aa16d53124ad9b5d0a6862d6.zip
Implemented external "resolve-include" function
* resolves paths provided as strings against include paths provided through the newly created "--include" argument of the test executable * this was implemented to enable central collections of XSLT libraries simmilar to how there are C headers in "/usr/include"
Diffstat (limited to 'test.cc')
-rw-r--r--test.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/test.cc b/test.cc
index 1262520..a21f25a 100644
--- a/test.cc
+++ b/test.cc
@@ -3,6 +3,8 @@
#include "boost/program_options.hpp"
+#include <string>
+#include <vector>
#include <iostream>
int main(int ac, char** av) {
@@ -11,8 +13,9 @@ int main(int ac, char** av) {
);
optionDescription.add_options()
- ("transformation", boost::program_options::value<std::string>()->required(), "transformation file")
- ("target", boost::program_options::value<std::string>(), "target file")
+ ("transformation", boost::program_options::value<std::string>()->required(), "transformation file")
+ ("target", boost::program_options::value<std::string>(), "target file")
+ ("include", boost::program_options::value<std::vector<std::string>>(), "include paths")
;
boost::program_options::variables_map variables;
@@ -32,7 +35,13 @@ int main(int ac, char** av) {
}
if ( variables.count("transformation") ) {
- InputXSLT::PlattformGuard plattform;
+ std::vector<std::string> includePath;
+
+ if ( variables.count("include") ) {
+ includePath = variables["include"].as<std::vector<std::string>>();
+ };
+
+ InputXSLT::PlattformGuard plattform(includePath);
InputXSLT::TransformationFacade transformation(
variables["transformation"].as<std::string>()