diff options
Diffstat (limited to 'src/function')
-rw-r--r-- | src/function/read_directory.cc | 7 | ||||
-rw-r--r-- | src/function/read_directory.h | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/function/read_directory.cc b/src/function/read_directory.cc index 677aa1d..3f503b3 100644 --- a/src/function/read_directory.cc +++ b/src/function/read_directory.cc @@ -11,10 +11,9 @@ namespace InputXSLT { -FunctionReadDirectory::FunctionReadDirectory(const FilesystemContext& context, - DomDocumentCache& cache): +FunctionReadDirectory::FunctionReadDirectory(const FilesystemContext& context): fs_context_(context), - document_cache_(cache) { } + document_cache_(std::make_shared<DomDocumentCache>()) { } xalan::XObjectPtr FunctionReadDirectory::execute( xalan::XPathExecutionContext& executionContext, @@ -23,7 +22,7 @@ xalan::XObjectPtr FunctionReadDirectory::execute( const xalan::Locator* ) const { DomDocumentCache::item* const cachedDocument( - this->document_cache_.get(xalanToString(argument->str())) + this->document_cache_->get(xalanToString(argument->str())) ); if ( !cachedDocument->isFinalized() ) { diff --git a/src/function/read_directory.h b/src/function/read_directory.h index 3fcf389..f4f7ec8 100644 --- a/src/function/read_directory.h +++ b/src/function/read_directory.h @@ -6,6 +6,8 @@ #include <xalanc/XPath/Function.hpp> #include <xalanc/XPath/XObject.hpp> +#include <memory> + #include "common.h" #include "support/filesystem_context.h" #include "support/dom/document_cache.h" @@ -14,7 +16,7 @@ namespace InputXSLT { class FunctionReadDirectory : public xalan::Function { public: - FunctionReadDirectory(const FilesystemContext&, DomDocumentCache&); + FunctionReadDirectory(const FilesystemContext&); virtual xalan::XObjectPtr execute( xalan::XPathExecutionContext&, @@ -30,7 +32,7 @@ class FunctionReadDirectory : public xalan::Function { private: const FilesystemContext& fs_context_; - DomDocumentCache& document_cache_; + std::shared_ptr<DomDocumentCache> document_cache_; const xalan::XalanDOMString& getError(xalan::XalanDOMString&) const; |