From 085935ddd577b0c65b4330318b5ba20492d93126 Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Sat, 24 May 2014 13:59:42 +0200 Subject: Implemented ResultNodeFacade as a DOM node construction helper * wraps result node construction and appends it to root node on destruction * offers a simpler interface for common node construction patterns * simplifies result node construction in all external function implementations ** most noticeable in FunctionReadDirectory * expanded FunctionReadDirectory result nodes by name, extension, and full-path nodes --- src/support/dom/result_node_facade.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/support/dom/result_node_facade.h (limited to 'src/support/dom/result_node_facade.h') diff --git a/src/support/dom/result_node_facade.h b/src/support/dom/result_node_facade.h new file mode 100644 index 0000000..ccdd850 --- /dev/null +++ b/src/support/dom/result_node_facade.h @@ -0,0 +1,35 @@ +#ifndef INPUTXSLT_SRC_SUPPORT_RESULT_NODE_FACADE_H_ +#define INPUTXSLT_SRC_SUPPORT_RESULT_NODE_FACADE_H_ + +#include +#include +#include + +#include + +namespace InputXSLT { + +class ResultNodeFacade { + public: + ResultNodeFacade( + xercesc::DOMDocument*, + xercesc::DOMNode*, + const std::string& + ); + ~ResultNodeFacade(); + + void setAttribute(const std::string&, const std::string&); + void setValueNode(const std::string&, const std::string&); + void setContent(const std::string&); + void setContent(xercesc::DOMNode*); + + private: + xercesc::DOMDocument* const dom_document_; + xercesc::DOMElement* const result_node_; + xercesc::DOMNode* const root_node_; + +}; + +} + +#endif // INPUTXSLT_SRC_SUPPORT_RESULT_NODE_FACADE_H_ -- cgit v1.2.3