diff options
author | Adrian Kummerlaender | 2014-08-20 22:28:15 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2014-08-20 22:28:15 +0200 |
commit | 2c89112141530617b51af8c41211c2507ec8c738 (patch) | |
tree | c467e07340c55cf81090315e79e85af05b542647 /src/support | |
parent | b31f9170c2bc2330442070968d3cb334cadb5faa (diff) | |
download | InputXSLT-2c89112141530617b51af8c41211c2507ec8c738.tar InputXSLT-2c89112141530617b51af8c41211c2507ec8c738.tar.gz InputXSLT-2c89112141530617b51af8c41211c2507ec8c738.tar.bz2 InputXSLT-2c89112141530617b51af8c41211c2507ec8c738.tar.lz InputXSLT-2c89112141530617b51af8c41211c2507ec8c738.tar.xz InputXSLT-2c89112141530617b51af8c41211c2507ec8c738.tar.zst InputXSLT-2c89112141530617b51af8c41211c2507ec8c738.zip |
Setting the correct work directory in FunctionExternalCommand
* 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
Diffstat (limited to 'src/support')
-rw-r--r-- | src/support/type/xobject_value.cc | 10 | ||||
-rw-r--r-- | src/support/type/xobject_value.h | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/support/type/xobject_value.cc b/src/support/type/xobject_value.cc index e457a69..2fe4f9f 100644 --- a/src/support/type/xobject_value.cc +++ b/src/support/type/xobject_value.cc @@ -15,10 +15,10 @@ namespace InputXSLT { XObjectValue::XObjectValue( - const boost::filesystem::path& path, - const IncludeEntityResolver* resolver + const FilesystemContext* context, + const IncludeEntityResolver* resolver ): - filesystem_context_(path), + filesystem_context_(context), include_resolver_(resolver) { } template <> @@ -47,7 +47,7 @@ boost::filesystem::path XObjectValue::get<boost::filesystem::path>( if ( auto resolvedPath = this->include_resolver_->resolve(rawPath) ) { return *resolvedPath; } else { - return this->filesystem_context_.resolve(rawPath); + return this->filesystem_context_->resolve(rawPath); } } @@ -89,7 +89,7 @@ xalan::XSLTInputSource XObjectValue::get<xalan::XSLTInputSource>( source.setSystemId( *XercesStringGuard<XMLCh>( - this->filesystem_context_.getBase().string() + this->filesystem_context_->getBase().string() ) ); diff --git a/src/support/type/xobject_value.h b/src/support/type/xobject_value.h index cfc259d..53ceacc 100644 --- a/src/support/type/xobject_value.h +++ b/src/support/type/xobject_value.h @@ -12,7 +12,7 @@ namespace InputXSLT { class XObjectValue { public: XObjectValue( - const boost::filesystem::path&, + const FilesystemContext*, const IncludeEntityResolver* ); @@ -20,7 +20,7 @@ class XObjectValue { Type get(const xalan::XObjectPtr&) const; private: - const FilesystemContext filesystem_context_; + const FilesystemContext* const filesystem_context_; const IncludeEntityResolver* const include_resolver_; }; |