aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-08-18 20:11:18 +0200
committerAdrian Kummerlaender2014-08-18 20:11:18 +0200
commitb31f9170c2bc2330442070968d3cb334cadb5faa (patch)
treeeb5eef97afdf5d5f4066743ec2b8ed05241a71e4 /src
parent8ed33c3e9e2648a5a0150c05e06c228336e9e9d6 (diff)
downloadInputXSLT-b31f9170c2bc2330442070968d3cb334cadb5faa.tar
InputXSLT-b31f9170c2bc2330442070968d3cb334cadb5faa.tar.gz
InputXSLT-b31f9170c2bc2330442070968d3cb334cadb5faa.tar.bz2
InputXSLT-b31f9170c2bc2330442070968d3cb334cadb5faa.tar.lz
InputXSLT-b31f9170c2bc2330442070968d3cb334cadb5faa.tar.xz
InputXSLT-b31f9170c2bc2330442070968d3cb334cadb5faa.tar.zst
InputXSLT-b31f9170c2bc2330442070968d3cb334cadb5faa.zip
Renamed FunctionExternalCommand result root node
* this change was implemented to match the naming scheme of all other external functions * updated external text formatter test case accordingly
Diffstat (limited to 'src')
-rw-r--r--src/function/external_command.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/function/external_command.cc b/src/function/external_command.cc
index bd2bf84..7d91a9a 100644
--- a/src/function/external_command.cc
+++ b/src/function/external_command.cc
@@ -41,7 +41,7 @@ namespace InputXSLT {
DomDocumentCache::document_ptr FunctionExternalCommand::constructDocument(
std::string command,
- boost::optional<std::string> stdinText
+ boost::optional<std::string> input
) const {
DomDocumentCache::document_ptr domDocument(
DomDocumentCache::createDocument("content")
@@ -56,18 +56,18 @@ DomDocumentCache::document_ptr FunctionExternalCommand::constructDocument(
boost::process::launch_shell(command, context)
);
- if ( stdinText ) {
+ if ( input ) {
boost::process::postream& inputStream = commandProcess.get_stdin();
- inputStream << *stdinText;
+ inputStream << *input;
inputStream.close();
}
boost::process::pistream& outputStream = commandProcess.get_stdout();
boost::process::status status = commandProcess.wait();
- ResultNodeFacade result(domDocument.get(), "output");
- result.setAttribute("command", command);
- result.setAttribute("code", std::to_string(status.exit_status()));
+ ResultNodeFacade result(domDocument.get(), "command");
+ result.setAttribute("executed", command);
+ result.setAttribute("code", std::to_string(status.exit_status()));
if ( status.exited() ) {
try {