aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdrian Kummerländer2014-05-09 20:24:12 +0200
committerAdrian Kummerländer2014-05-09 20:24:12 +0200
commite83bbb457c98a0b77ca04e2832d7d0601912acd7 (patch)
tree8b7a8fb1bdccf44af5044a0996a922042ee56e34 /src
parent947603b5d7f05053a93a3cfe257fa7ab11304a90 (diff)
downloadInputXSLT-e83bbb457c98a0b77ca04e2832d7d0601912acd7.tar
InputXSLT-e83bbb457c98a0b77ca04e2832d7d0601912acd7.tar.gz
InputXSLT-e83bbb457c98a0b77ca04e2832d7d0601912acd7.tar.bz2
InputXSLT-e83bbb457c98a0b77ca04e2832d7d0601912acd7.tar.lz
InputXSLT-e83bbb457c98a0b77ca04e2832d7d0601912acd7.tar.xz
InputXSLT-e83bbb457c98a0b77ca04e2832d7d0601912acd7.tar.zst
InputXSLT-e83bbb457c98a0b77ca04e2832d7d0601912acd7.zip
Marked DomDocumentCache::item class as private
* as the xerces document is not instantiated by DomDocumentCache::item and the class only exports a pointer to the converted xalan document, it makes no sense to expose the class to the outside in the first place
Diffstat (limited to 'src')
-rw-r--r--src/function/base.h3
-rw-r--r--src/function/read_directory.h2
-rw-r--r--src/function/read_file.h2
-rw-r--r--src/function/read_xml_file.h2
-rw-r--r--src/support/dom/document_cache.cc4
-rw-r--r--src/support/dom/document_cache.h9
6 files changed, 13 insertions, 9 deletions
diff --git a/src/function/base.h b/src/function/base.h
index 231800d..c5346c7 100644
--- a/src/function/base.h
+++ b/src/function/base.h
@@ -53,8 +53,7 @@ class FunctionBase : public xalan::Function {
);
nodeList->addNodes(
- *optionalCachedDocument.second->getXalanDocument()
- ->getDocumentElement()
+ *optionalCachedDocument.second->getDocumentElement()
->getChildNodes()
);
diff --git a/src/function/read_directory.h b/src/function/read_directory.h
index 85e7f1b..b050ff8 100644
--- a/src/function/read_directory.h
+++ b/src/function/read_directory.h
@@ -7,7 +7,7 @@ namespace InputXSLT {
class FunctionReadDirectory : public FunctionBase<FunctionReadDirectory> {
public:
- using FunctionBase<FunctionReadDirectory>::FunctionBase;
+ using FunctionBase::FunctionBase;
protected:
friend FunctionBase;
diff --git a/src/function/read_file.h b/src/function/read_file.h
index b581ee5..90139f4 100644
--- a/src/function/read_file.h
+++ b/src/function/read_file.h
@@ -7,7 +7,7 @@ namespace InputXSLT {
class FunctionReadFile : public FunctionBase<FunctionReadFile> {
public:
- using FunctionBase<FunctionReadFile>::FunctionBase;
+ using FunctionBase::FunctionBase;
protected:
friend FunctionBase;
diff --git a/src/function/read_xml_file.h b/src/function/read_xml_file.h
index 4aebe56..3636d18 100644
--- a/src/function/read_xml_file.h
+++ b/src/function/read_xml_file.h
@@ -7,7 +7,7 @@ namespace InputXSLT {
class FunctionReadXmlFile : public FunctionBase<FunctionReadXmlFile> {
public:
- using FunctionBase<FunctionReadXmlFile>::FunctionBase;
+ using FunctionBase::FunctionBase;
protected:
friend FunctionBase;
diff --git a/src/support/dom/document_cache.cc b/src/support/dom/document_cache.cc
index c4c57d3..81d90aa 100644
--- a/src/support/dom/document_cache.cc
+++ b/src/support/dom/document_cache.cc
@@ -14,7 +14,7 @@ DomDocumentCache::optional_item DomDocumentCache::get(const std::string& key) {
if ( itemIter == this->map_.end() ) {
return optional_item(false, nullptr);
} else {
- return optional_item(true, (*itemIter).second.get());
+ return optional_item(true, (*itemIter).second->getXalanDocument());
}
}
@@ -29,7 +29,7 @@ DomDocumentCache::optional_item DomDocumentCache::create(
);
if ( result.second ) {
- return optional_item(true, (*(result.first)).second.get());
+ return optional_item(true, (*(result.first)).second->getXalanDocument());
} else {
return optional_item(false, nullptr);
}
diff --git a/src/support/dom/document_cache.h b/src/support/dom/document_cache.h
index af99102..cbac5c7 100644
--- a/src/support/dom/document_cache.h
+++ b/src/support/dom/document_cache.h
@@ -1,6 +1,8 @@
#ifndef INPUTXSLT_SRC_SUPPORT_DOM_DOCUMENT_CACHE_H_
#define INPUTXSLT_SRC_SUPPORT_DOM_DOCUMENT_CACHE_H_
+#include <xalanc/XalanDOM/XalanDocument.hpp>
+
#include <xercesc/dom/DOMDocument.hpp>
#include <string>
@@ -8,12 +10,13 @@
#include <unordered_map>
#include <memory>
+#include "common.h"
+
namespace InputXSLT {
class DomDocumentCache {
public:
- class item;
- typedef std::pair<bool, item*> optional_item;
+ typedef std::pair<bool, xalan::XalanDocument*> optional_item;
DomDocumentCache();
@@ -21,6 +24,8 @@ class DomDocumentCache {
optional_item create(const std::string&, xercesc::DOMDocument*);
private:
+ class item;
+
std::mutex write_mutex_;
std::unordered_map<std::string, std::unique_ptr<item>> map_;