From f6ff54c492df81018cf48da039ee681508f88e46 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sat, 16 Aug 2014 23:30:36 +0200 Subject: Implemented primitive optional parameter support for external functions * renamed FunctionExternalTextFormatter into FunctionExternalCommand ** the goal is to provide a general interface to a variety of external commands *** e.g. not just text formatters but system utilities for file management and so on ** this requires the stdin parameter to be optional as not all external commands require stdin input * implemented "filter_derived" helper template to determine amount of optional parameters ** optional parameters are defined as "boost::optional" specializations *** they in turn can be detected by checking if "boost::optional_detail::optional_tag" is a base class * "callConstructDocument" member method of "FunctionBase" performs additional bounds checking of parameter vector * "boost::optional" specific member overload was added to "XObjectValue" helper class ** we will have to provide full specializations for all optional types as C++ prohibits partial member function template specialization * renamed the external function in "PlattformGuard" * changed README.md and test cases accordingly --- src/platform_guard.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/platform_guard.cc') diff --git a/src/platform_guard.cc b/src/platform_guard.cc index 6be5b4a..f50d976 100644 --- a/src/platform_guard.cc +++ b/src/platform_guard.cc @@ -11,7 +11,7 @@ #include "function/read_directory.h" #include "function/transform.h" #include "function/generate.h" -#include "function/external_text_formatter.h" +#include "function/external_command.h" namespace InputXSLT { @@ -56,8 +56,8 @@ PlatformGuard::PlatformGuard(const std::vector& path): xalan::XalanTransformer::installExternalFunctionGlobal( customNamespace, - xalan::XalanDOMString("external-text-formatter"), - InputXSLT::FunctionExternalTextFormatter(&this->include_resolver_) + xalan::XalanDOMString("external-command"), + InputXSLT::FunctionExternalCommand(&this->include_resolver_) ); } -- cgit v1.2.3