From 784ac42a0f05608e3d9c5e15246dbf76ce9e3d51 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Tue, 1 Jul 2014 20:54:02 +0200 Subject: 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" 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 --- src/transformation_facade.cc | 45 ++++++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 27 deletions(-) (limited to 'src/transformation_facade.cc') diff --git a/src/transformation_facade.cc b/src/transformation_facade.cc index 97b17bb..9d248b8 100644 --- a/src/transformation_facade.cc +++ b/src/transformation_facade.cc @@ -3,10 +3,6 @@ #include #include -#include "boost/filesystem.hpp" - -#include - #include "support/xerces_string_guard.h" namespace InputXSLT { @@ -70,39 +66,34 @@ WarningCapacitor::warning_cache_ptr TransformationFacade::getCachedWarnings() { return this->warning_capacitor_.discharge(); } +void TransformationFacade::generate(std::basic_ostream& targetStream) { + StylesheetParameterGuard guard(this->transformer_); + + this->generate(targetStream, guard); +} + void TransformationFacade::generate( - const std::string& targetPath, - StylesheetParameterGuard& parameters + std::basic_ostream& targetStream, + const StylesheetParameterGuard::map& parameters ) { - const boost::filesystem::path targetPathHelper( - boost::filesystem::absolute(targetPath) - ); - - parameters.set( - "target-file", targetPathHelper.filename().string() - ); - parameters.set( - "parent-directory", targetPathHelper.parent_path().filename().string() - ); + StylesheetParameterGuard guard(this->transformer_, parameters); - this->generate( - xalan::XSLTResultTarget(targetPath.data()), - parameters - ); + this->generate(targetStream, guard); } void TransformationFacade::generate( std::basic_ostream& targetStream, - StylesheetParameterGuard& parameters + const xalan::XObjectPtr& parameter ) { - this->generate( - xalan::XSLTResultTarget(targetStream), - parameters - ); + StylesheetParameterGuard guard(this->transformer_); + guard.set("parameters", parameter); + + this->generate(targetStream, guard); } + void TransformationFacade::generate( - xalan::XSLTResultTarget&& outputTarget, + std::basic_ostream& targetStream, StylesheetParameterGuard& ) { ErrorCapacitor errorCapacitor(&this->error_multiplexer_); @@ -110,7 +101,7 @@ void TransformationFacade::generate( this->transformer_.transform( *(this->input_), this->transformation_, - outputTarget + targetStream ); errorCapacitor.discharge(); -- cgit v1.2.3