#ifndef INPUTXSLT_SRC_TRANSFORMATION_FACADE_H_ #define INPUTXSLT_SRC_TRANSFORMATION_FACADE_H_ #include #include #include #include #include #include "common.h" #include "support/include_entity_resolver.h" #include "support/stylesheet_parameter_guard.h" #include "support/error/error_multiplexer.h" #include "support/error/error_capacitor.h" #include "support/error/warning_capacitor.h" namespace InputXSLT { class TransformationFacade { public: typedef std::unique_ptr ptr; template static ptr try_create( const std::function&, Arguments&&... ); TransformationFacade( xalan::XSLTInputSource, IncludeEntityResolver* ); TransformationFacade( xalan::XSLTInputSource, xalan::XSLTInputSource, IncludeEntityResolver* ); void generate(std::basic_ostream&); void generate(std::basic_ostream&, const StylesheetParameterGuard::map&); void generate(std::basic_ostream&, const xalan::XObjectPtr&); WarningCapacitor::warning_cache_ptr getCachedWarnings(); private: const xalan::XalanParsedSource* input_; const xalan::XalanCompiledStylesheet* transformation_; xalan::XalanTransformer transformer_; ErrorMultiplexer error_multiplexer_; WarningCapacitor warning_capacitor_; void generate( std::basic_ostream&, StylesheetParameterGuard& ); }; template auto TransformationFacade::try_create( const std::function& handleErrors, Arguments&&... arguments ) -> ptr { try { return ptr( new InputXSLT::TransformationFacade( std::forward(arguments)... ) ); } catch (const ErrorCapacitor::exception& exception) { handleErrors(*exception); return ptr(); } } } #endif // INPUTXSLT_SRC_TRANSFORMATION_FACADE_H_