aboutsummaryrefslogtreecommitdiff
path: root/src/function/resolve_include.h
diff options
context:
space:
mode:
authorAdrian Kummerländer2014-05-19 22:14:31 +0200
committerAdrian Kummerländer2014-05-19 22:14:31 +0200
commit426265b91d4533b7aa16d53124ad9b5d0a6862d6 (patch)
tree8d42a9e3b27229bad9a194191ca42f32f9717972 /src/function/resolve_include.h
parentd19a195985b96701b2ab302538fe24e87e76decf (diff)
downloadInputXSLT-426265b91d4533b7aa16d53124ad9b5d0a6862d6.tar
InputXSLT-426265b91d4533b7aa16d53124ad9b5d0a6862d6.tar.gz
InputXSLT-426265b91d4533b7aa16d53124ad9b5d0a6862d6.tar.bz2
InputXSLT-426265b91d4533b7aa16d53124ad9b5d0a6862d6.tar.lz
InputXSLT-426265b91d4533b7aa16d53124ad9b5d0a6862d6.tar.xz
InputXSLT-426265b91d4533b7aa16d53124ad9b5d0a6862d6.tar.zst
InputXSLT-426265b91d4533b7aa16d53124ad9b5d0a6862d6.zip
Implemented external "resolve-include" function
* resolves paths provided as strings against include paths provided through the newly created "--include" argument of the test executable * this was implemented to enable central collections of XSLT libraries simmilar to how there are C headers in "/usr/include"
Diffstat (limited to 'src/function/resolve_include.h')
-rw-r--r--src/function/resolve_include.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/function/resolve_include.h b/src/function/resolve_include.h
new file mode 100644
index 0000000..2d6e62f
--- /dev/null
+++ b/src/function/resolve_include.h
@@ -0,0 +1,44 @@
+#ifndef INPUTXSLT_SRC_FUNCTION_RESOLVE_INCLUDE_H_
+#define INPUTXSLT_SRC_FUNCTION_RESOLVE_INCLUDE_H_
+
+#include <xalanc/XPath/XObjectFactory.hpp>
+#include <xalanc/XPath/Function.hpp>
+#include <xalanc/XPath/XObject.hpp>
+
+#include "boost/filesystem.hpp"
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "common.h"
+#include "support/filesystem_context.h"
+
+namespace InputXSLT {
+
+class FunctionResolveInclude : public xalan::Function {
+ public:
+ FunctionResolveInclude(const std::vector<std::string>&);
+
+ virtual xalan::XObjectPtr execute(
+ xalan::XPathExecutionContext&,
+ xalan::XalanNode*,
+ const xalan::XObjectPtr,
+ const xalan::Locator*
+ ) const;
+
+ virtual FunctionResolveInclude* clone(xalan::MemoryManager&) const;
+
+ FunctionResolveInclude& operator=(const FunctionResolveInclude&) = delete;
+ bool operator==(const FunctionResolveInclude&) const = delete;
+
+ private:
+ const std::shared_ptr<std::vector<FilesystemContext>> path_;
+
+ const xalan::XalanDOMString& getError(xalan::XalanDOMString&) const;
+
+};
+
+}
+
+#endif // INPUTXSLT_SRC_FUNCTION_RESOLVE_INCLUDE_H_