From a45c37a31eae86424d3b72ebb07604d6d1fa8bd3 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Tue, 15 Jul 2014 22:08:40 +0200 Subject: Fixed PlatformGuard name spelling * its called a "platform" and not a "plattform" as in German... --- CMakeLists.txt | 2 +- ixslt.cc | 12 ++++----- src/platform_guard.cc | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/platform_guard.h | 25 ++++++++++++++++++ src/plattform_guard.cc | 72 -------------------------------------------------- src/plattform_guard.h | 25 ------------------ 6 files changed, 104 insertions(+), 104 deletions(-) create mode 100644 src/platform_guard.cc create mode 100644 src/platform_guard.h delete mode 100644 src/plattform_guard.cc delete mode 100644 src/plattform_guard.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 331aa2c..9f19bb1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ set( set( Sources - src/plattform_guard.cc + src/platform_guard.cc src/transformer_facade.cc src/function/read_file.cc src/function/write_file.cc diff --git a/ixslt.cc b/ixslt.cc index 610d28f..23dc9ca 100644 --- a/ixslt.cc +++ b/ixslt.cc @@ -10,7 +10,7 @@ #include #include -#include "plattform_guard.h" +#include "platform_guard.h" #include "transformer_facade.h" namespace { @@ -131,7 +131,7 @@ bool process(const boost::program_options::variables_map& variables) { includePath = variables["include"].as>(); }; - InputXSLT::PlattformGuard plattform(includePath); + InputXSLT::PlatformGuard platform(includePath); if ( variables.count("target") ) { boost::filesystem::ofstream file( @@ -141,14 +141,14 @@ bool process(const boost::program_options::variables_map& variables) { if ( file.is_open() ) { if ( variables.count("input") ) { return generate( - plattform.getEntityResolver(), + platform.getEntityResolver(), file, variables["input"].as().data(), variables["transformation"].as().data() ); } else { return generate( - plattform.getEntityResolver(), + platform.getEntityResolver(), file, variables["transformation"].as().data() ); @@ -159,14 +159,14 @@ bool process(const boost::program_options::variables_map& variables) { } else { if ( variables.count("input") ) { return generate( - plattform.getEntityResolver(), + platform.getEntityResolver(), std::cout, variables["input"].as().data(), variables["transformation"].as().data() ); } else { return generate( - plattform.getEntityResolver(), + platform.getEntityResolver(), std::cout, variables["transformation"].as().data() ); diff --git a/src/platform_guard.cc b/src/platform_guard.cc new file mode 100644 index 0000000..6be5b4a --- /dev/null +++ b/src/platform_guard.cc @@ -0,0 +1,72 @@ +#include "platform_guard.h" + +#include +#include + +#include + +#include "common.h" +#include "function/read_file.h" +#include "function/write_file.h" +#include "function/read_directory.h" +#include "function/transform.h" +#include "function/generate.h" +#include "function/external_text_formatter.h" + +namespace InputXSLT { + +PlatformGuard::PlatformGuard(const std::vector& path): + include_resolver_(path) { + xercesc::XMLPlatformUtils::Initialize(); + xalan::XalanTransformer::initialize(); + + const xalan::XalanDOMString customNamespace( + "function.inputxslt.application" + ); + + xalan::XalanTransformer::installExternalFunctionGlobal( + customNamespace, + xalan::XalanDOMString("read-file"), + InputXSLT::FunctionReadFile(&this->include_resolver_) + ); + + xalan::XalanTransformer::installExternalFunctionGlobal( + customNamespace, + xalan::XalanDOMString("write-file"), + InputXSLT::FunctionWriteFile(&this->include_resolver_) + ); + + xalan::XalanTransformer::installExternalFunctionGlobal( + customNamespace, + xalan::XalanDOMString("read-directory"), + InputXSLT::FunctionReadDirectory(&this->include_resolver_) + ); + + xalan::XalanTransformer::installExternalFunctionGlobal( + customNamespace, + xalan::XalanDOMString("transform"), + InputXSLT::FunctionTransform(&this->include_resolver_) + ); + + xalan::XalanTransformer::installExternalFunctionGlobal( + customNamespace, + xalan::XalanDOMString("generate"), + InputXSLT::FunctionGenerate(&this->include_resolver_) + ); + + xalan::XalanTransformer::installExternalFunctionGlobal( + customNamespace, + xalan::XalanDOMString("external-text-formatter"), + InputXSLT::FunctionExternalTextFormatter(&this->include_resolver_) + ); +} + +PlatformGuard::~PlatformGuard() { + xalan::XalanTransformer::terminate(); +} + +IncludeEntityResolver* PlatformGuard::getEntityResolver() { + return &this->include_resolver_; +} + +} diff --git a/src/platform_guard.h b/src/platform_guard.h new file mode 100644 index 0000000..ff72207 --- /dev/null +++ b/src/platform_guard.h @@ -0,0 +1,25 @@ +#ifndef INPUTXSLT_SRC_PLATFORM_GUARD_H_ +#define INPUTXSLT_SRC_PLATFORM_GUARD_H_ + +#include +#include + +#include "support/include_entity_resolver.h" + +namespace InputXSLT { + +class PlatformGuard { + public: + PlatformGuard(const std::vector&); + ~PlatformGuard(); + + IncludeEntityResolver* getEntityResolver(); + + private: + IncludeEntityResolver include_resolver_; + +}; + +} + +#endif // INPUTXSLT_SRC_PLATFORM_GUARD_H_ diff --git a/src/plattform_guard.cc b/src/plattform_guard.cc deleted file mode 100644 index 5d19e32..0000000 --- a/src/plattform_guard.cc +++ /dev/null @@ -1,72 +0,0 @@ -#include "plattform_guard.h" - -#include -#include - -#include - -#include "common.h" -#include "function/read_file.h" -#include "function/write_file.h" -#include "function/read_directory.h" -#include "function/transform.h" -#include "function/generate.h" -#include "function/external_text_formatter.h" - -namespace InputXSLT { - -PlattformGuard::PlattformGuard(const std::vector& path): - include_resolver_(path) { - xercesc::XMLPlatformUtils::Initialize(); - xalan::XalanTransformer::initialize(); - - const xalan::XalanDOMString customNamespace( - "function.inputxslt.application" - ); - - xalan::XalanTransformer::installExternalFunctionGlobal( - customNamespace, - xalan::XalanDOMString("read-file"), - InputXSLT::FunctionReadFile(&this->include_resolver_) - ); - - xalan::XalanTransformer::installExternalFunctionGlobal( - customNamespace, - xalan::XalanDOMString("write-file"), - InputXSLT::FunctionWriteFile(&this->include_resolver_) - ); - - xalan::XalanTransformer::installExternalFunctionGlobal( - customNamespace, - xalan::XalanDOMString("read-directory"), - InputXSLT::FunctionReadDirectory(&this->include_resolver_) - ); - - xalan::XalanTransformer::installExternalFunctionGlobal( - customNamespace, - xalan::XalanDOMString("transform"), - InputXSLT::FunctionTransform(&this->include_resolver_) - ); - - xalan::XalanTransformer::installExternalFunctionGlobal( - customNamespace, - xalan::XalanDOMString("generate"), - InputXSLT::FunctionGenerate(&this->include_resolver_) - ); - - xalan::XalanTransformer::installExternalFunctionGlobal( - customNamespace, - xalan::XalanDOMString("external-text-formatter"), - InputXSLT::FunctionExternalTextFormatter(&this->include_resolver_) - ); -} - -PlattformGuard::~PlattformGuard() { - xalan::XalanTransformer::terminate(); -} - -IncludeEntityResolver* PlattformGuard::getEntityResolver() { - return &this->include_resolver_; -} - -} diff --git a/src/plattform_guard.h b/src/plattform_guard.h deleted file mode 100644 index ccc9449..0000000 --- a/src/plattform_guard.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef INPUTXSLT_SRC_PLATTFORM_GUARD_H_ -#define INPUTXSLT_SRC_PLATTFORM_GUARD_H_ - -#include -#include - -#include "support/include_entity_resolver.h" - -namespace InputXSLT { - -class PlattformGuard { - public: - PlattformGuard(const std::vector&); - ~PlattformGuard(); - - IncludeEntityResolver* getEntityResolver(); - - private: - IncludeEntityResolver include_resolver_; - -}; - -} - -#endif // INPUTXSLT_SRC_PLATTFORM_GUARD_H_ -- cgit v1.2.3