aboutsummaryrefslogtreecommitdiff
path: root/src/function/external_command.cc
AgeCommit message (Collapse)Author
2017-06-01Adapt `FunctionExternalCommand` to new `boost::process` versionAdrian Kummerlaender
2016-01-05Fix `generate` problem caused by _boost_ updateAdrian Kummerlaender
i.e. the directory tree was not correctly created in all circumstances which led to both the `generate` and `write-file` test cases failing. This was combined with some accumulated changes such as the extraction of process context instantiation.
2014-11-09Removed unnecessary `inline` declarationsAdrian Kummerlaender
* e.g. member functions defined in the class definition are implicitly marked `inline`
2014-10-29Activated namespace comprehension for all `XercesDOMParser` instancesAdrian Kummerlaender
* this is possibly a breaking change for all applications built on either `FunctionExternalCommand` or `FunctionReadFile` ** e.g. meta datasource XPath queries in _StaticXSLT_ will have to be changed to accomodate this * the reason for doing this was to fix the behaviour when reading namespaced XML files ** e.g. XSL stylesheets could only be queried with a clunky XPath expression such as `$transformation/self::*[name() = 'xsl:stylesheet']` instead of simply `$transformation/self::xsl:stylesheet` *** this was caused by the now activated namespace comprehension in `xercesc::XercesDOMParser` which is disabled by default *** it caused all local node names to be converted into their namespace prefixed version, e.g. `local-name()` returned `xsl:stylesheet` instead of `stylesheet`
2014-10-26Fixed XML declaration handling in FunctionExternalCommandAdrian Kummerlaender
* `FunctionExternalCommand` failed to offer correct output handling when provided with a valid XML document which included a XML declaration ** `xerces::XercesDOMParser` generated the appropriate errors but they were not handled by `FunctionExternalCommand` ** wrapping is not necessary for full XML documents but is required for invalid XML as returned by e.g. common _Markdown_ processors *** if wrapping is applied to full XML documents which include a XML declaration the parser and subsequently the complete external function fails * added error parser handling by making the compilation unit local `importDocumentElement` method return value optional * added XML declaration detection and handling to `readOutput` ** if XML declaration is detected no wrapping is applied * added wrapping detection in `FunctionExternalCommand::constructDocument` ** if no wrapping is detected the whole tree is returned as content instead of just returning its child nodes
2014-10-16Changed FunctionExternalCommand stream read orderAdrian Kummerlaender
* long outputs to stdout from child processes filled up the `boost::process::pistream` buffer and caused `write` to block ** this issue was circumvented by reading the stream into a `std::stringstream` instance before retrieving the blocking exit status * modified document import implementation accordingly
2014-08-20Setting the correct work directory in FunctionExternalCommandAdrian Kummerlaender
* changed the XObjectValue constructor to accept a pointer to FilesystemContext instead of instantiating the context by itself * the FilesystemContext is now instantiated in the "callConstructDocument" member method of "FunctionBase" ** a const reference to FilesystemContext is passed to all "constructDocument" member method implementations * the FilesystemContext is currently only used by FunctionExternal command to set the correct work directory in "boost::process::context" ** this is required so calling external commands from inside a stylesheet works as expected *** i.e. from inside the directory the stylesheet is located in * modified all remaining external function implementations accordingly
2014-08-18Renamed FunctionExternalCommand result root nodeAdrian Kummerlaender
* this change was implemented to match the naming scheme of all other external functions * updated external text formatter test case accordingly
2014-08-16Implemented primitive optional parameter support for external functionsAdrian Kummerlaender
* 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<std::string>" 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