From 7142544d43b431df44d34921b0f3012fa1e0137d Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Mon, 21 Apr 2014 21:47:20 +0200 Subject: Implemented basic external directory traversal function * _read-directory_ lists all files in a given directory ** currently text-only output, xml planned * improved FilesystemContext path resolution (relative path is fully resolved by boost::filesystem) --- src/function/read_directory.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/function/read_directory.h (limited to 'src/function/read_directory.h') diff --git a/src/function/read_directory.h b/src/function/read_directory.h new file mode 100644 index 0000000..4a865f2 --- /dev/null +++ b/src/function/read_directory.h @@ -0,0 +1,41 @@ +#ifndef INPUTXSLT_SRC_FUNCTION_READ_DIRECTORY_H_ +#define INPUTXSLT_SRC_FUNCTION_READ_DIRECTORY_H_ + +#include +#include +#include +#include + +#include + +#include "common.h" +#include "support/filesystem_context.h" + +namespace InputXSLT { + +class FunctionReadDirectory : public xalan::Function { + public: + FunctionReadDirectory(const FilesystemContext&); + + virtual xalan::XObjectPtr execute( + xalan::XPathExecutionContext&, + xalan::XalanNode*, + const xalan::Function::XObjectArgVectorType&, + const xalan::Locator* + ) const; + + virtual FunctionReadDirectory* clone(xalan::MemoryManager&) const; + + FunctionReadDirectory& operator=(const FunctionReadDirectory&) = delete; + bool operator==(const FunctionReadDirectory&) const = delete; + + private: + const FilesystemContext& fs_context_; + + const xalan::XalanDOMString& getError(xalan::XalanDOMString&) const; + +}; + +} + +#endif // INPUTXSLT_SRC_FUNCTION_READ_DIRECTORY_H_ -- cgit v1.2.3