diff options
author | Adrian Kummerländer | 2014-04-26 11:21:10 +0200 |
---|---|---|
committer | Adrian Kummerländer | 2014-04-26 11:21:10 +0200 |
commit | 0b611b7bd28851fe8096b3d2c121c68e231ada11 (patch) | |
tree | 80352794dce96cec2b86659e5a8260fb9a7686c2 /src/support/dom/document_cache_item.h | |
parent | 938ed7622656c3494ae8fdb83bc2ad4b1f31d901 (diff) | |
download | InputXSLT-0b611b7bd28851fe8096b3d2c121c68e231ada11.tar InputXSLT-0b611b7bd28851fe8096b3d2c121c68e231ada11.tar.gz InputXSLT-0b611b7bd28851fe8096b3d2c121c68e231ada11.tar.bz2 InputXSLT-0b611b7bd28851fe8096b3d2c121c68e231ada11.tar.lz InputXSLT-0b611b7bd28851fe8096b3d2c121c68e231ada11.tar.xz InputXSLT-0b611b7bd28851fe8096b3d2c121c68e231ada11.tar.zst InputXSLT-0b611b7bd28851fe8096b3d2c121c68e231ada11.zip |
Implemented global DOM document cache
* the plan to return XML-nodes from each external function requires a better way to manage the lifetime of many xerces DOM document instances and their support class instances
** this is why DomDocumentCache and DomDocumentCache::item were implemented
** based on std::map so we can easily access the result of old function calls
* changed external read-directory function to return the children of the document node instead of the document node itself
** removes unnecessary cruft in function calls
** will make returning status codes alongside the function result more pleasing to the eye
* updated test transformation to reflect new features
Diffstat (limited to 'src/support/dom/document_cache_item.h')
-rw-r--r-- | src/support/dom/document_cache_item.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/support/dom/document_cache_item.h b/src/support/dom/document_cache_item.h new file mode 100644 index 0000000..1f7152b --- /dev/null +++ b/src/support/dom/document_cache_item.h @@ -0,0 +1,42 @@ +#ifndef INPUTXSLT_SRC_SUPPORT_DOM_DOCUMENT_CACHE_ITEM_H_ +#define INPUTXSLT_SRC_SUPPORT_DOM_DOCUMENT_CACHE_ITEM_H_ + +#include <xalanc/XercesParserLiaison/XercesParserLiaison.hpp> +#include <xalanc/XercesParserLiaison/XercesDOMSupport.hpp> +#include <xalanc/XalanTransformer/XercesDOMWrapperParsedSource.hpp> + +#include <xercesc/dom/DOMDocument.hpp> + +#include <string> +#include <memory> + +#include "common.h" +#include "document_cache.h" + +namespace InputXSLT { + +class DomDocumentCache::item { + public: + ~item(); + + bool isFinalized() const; + + xercesc::DOMDocument* getXercesDocument() const; + xalan::XalanDocument* getXalanDocument(); + + protected: + friend DomDocumentCache; + + item(const std::string&); + + private: + xalan::XercesParserLiaison parser_; + xalan::XercesDOMSupport dom_support_; + xercesc::DOMDocument* const document_; + std::unique_ptr<xalan::XercesDOMWrapperParsedSource> parsed_source_; + +}; + +} + +#endif // INPUTXSLT_SRC_SUPPORT_DOM_DOCUMENT_CACHE_ITEM_H_ |