aboutsummaryrefslogtreecommitdiff
path: root/ixslt.cc
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-07-01 20:54:02 +0200
committerAdrian Kummerlaender2014-07-01 20:54:02 +0200
commit784ac42a0f05608e3d9c5e15246dbf76ce9e3d51 (patch)
treed06531455b788c5e04551bd28800d5c3971c2b1d /ixslt.cc
parent2becbedf4cb779b56578e495293b850ff05b738f (diff)
downloadInputXSLT-784ac42a0f05608e3d9c5e15246dbf76ce9e3d51.tar
InputXSLT-784ac42a0f05608e3d9c5e15246dbf76ce9e3d51.tar.gz
InputXSLT-784ac42a0f05608e3d9c5e15246dbf76ce9e3d51.tar.bz2
InputXSLT-784ac42a0f05608e3d9c5e15246dbf76ce9e3d51.tar.lz
InputXSLT-784ac42a0f05608e3d9c5e15246dbf76ce9e3d51.tar.xz
InputXSLT-784ac42a0f05608e3d9c5e15246dbf76ce9e3d51.tar.zst
InputXSLT-784ac42a0f05608e3d9c5e15246dbf76ce9e3d51.zip
Removed unnecessary template member methods from TranformationFacade
* neither the constructor nor the generate member methods need to be templatized ** only supported "output" argument is now a reference to a "std::basic_ostream<char>" instance ** the caller is responsible for e.g. writing the output to disk * this was done to simplify the basic interface of InputXSLT * removed "default_params" testcase along with default parameter generation ** this feature is neither used nor required
Diffstat (limited to 'ixslt.cc')
-rw-r--r--ixslt.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/ixslt.cc b/ixslt.cc
index b1671b3..abc7e1a 100644
--- a/ixslt.cc
+++ b/ixslt.cc
@@ -1,5 +1,6 @@
#include "boost/optional.hpp"
#include "boost/program_options.hpp"
+#include <boost/filesystem/fstream.hpp>
#include <string>
#include <vector>
@@ -117,9 +118,15 @@ bool process(const boost::program_options::variables_map& variables) {
try {
if ( variables.count("target") ) {
- transformation->generate(
+ boost::filesystem::ofstream file(
variables["target"].as<std::string>()
);
+
+ if ( file.is_open() ) {
+ transformation->generate(file);
+ } else {
+ return false;
+ }
} else {
transformation->generate(std::cout);
}