diff options
author | Adrian Kummerländer | 2014-05-05 20:42:36 +0200 |
---|---|---|
committer | Adrian Kummerländer | 2014-05-05 20:42:36 +0200 |
commit | 9aad4dffd9c8b0fde534b3abc3c27875547423fa (patch) | |
tree | efe5f9af32f9854c6bc7f2caed3c01a4369ca41e /src/function/read_file.h | |
parent | bd24e3fe6335bc776400be6bcb44a0701ecc4133 (diff) | |
download | InputXSLT-9aad4dffd9c8b0fde534b3abc3c27875547423fa.tar InputXSLT-9aad4dffd9c8b0fde534b3abc3c27875547423fa.tar.gz InputXSLT-9aad4dffd9c8b0fde534b3abc3c27875547423fa.tar.bz2 InputXSLT-9aad4dffd9c8b0fde534b3abc3c27875547423fa.tar.lz InputXSLT-9aad4dffd9c8b0fde534b3abc3c27875547423fa.tar.xz InputXSLT-9aad4dffd9c8b0fde534b3abc3c27875547423fa.tar.zst InputXSLT-9aad4dffd9c8b0fde534b3abc3c27875547423fa.zip |
Encapsulated common parts of external function inplementations
* common parts were moved into CRTP template base class _FunctionBase_
* all external functions are derived from that class
** only have to implement _constructDocument_ member method
** currently only supports a single string input parameter which is enough for now
* this change condenses external funtion implementations to the essential and should increase readability as well as maintainability
Diffstat (limited to 'src/function/read_file.h')
-rw-r--r-- | src/function/read_file.h | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/src/function/read_file.h b/src/function/read_file.h index 65746a5..fd36847 100644 --- a/src/function/read_file.h +++ b/src/function/read_file.h @@ -1,38 +1,21 @@ #ifndef INPUTXSLT_SRC_FUNCTION_READ_FILE_H_ #define INPUTXSLT_SRC_FUNCTION_READ_FILE_H_ -#include <xalanc/XalanTransformer/XalanTransformer.hpp> -#include <xalanc/XPath/XObjectFactory.hpp> -#include <xalanc/XPath/Function.hpp> -#include <xalanc/XPath/XObject.hpp> - -#include <string> - -#include "common.h" -#include "support/dom/document_cache.h" +#include "base.h" namespace InputXSLT { -class FunctionReadFile : public xalan::Function { +class FunctionReadFile : public FunctionBase<FunctionReadFile> { public: - FunctionReadFile(); - - virtual xalan::XObjectPtr execute( - xalan::XPathExecutionContext&, - xalan::XalanNode*, - const xalan::XObjectPtr, - const xalan::Locator* - ) const; - - virtual FunctionReadFile* clone(xalan::MemoryManager&) const; - - FunctionReadFile& operator=(const FunctionReadFile&) = delete; - bool operator==(const FunctionReadFile&) const = delete; + using FunctionBase<FunctionReadFile>::FunctionBase; - private: - std::shared_ptr<DomDocumentCache> document_cache_; + protected: + friend FunctionBase<FunctionReadFile>; - const xalan::XalanDOMString& getError(xalan::XalanDOMString&) const; + xercesc::DOMDocument* constructDocument( + const FilesystemContext&, + const boost::filesystem::path& + ); }; |