summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/sys/windows
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2012-12-20 00:35:54 +0000
committerAndrew Stitcher <astitcher@apache.org>2012-12-20 00:35:54 +0000
commit4a0452844f85edc5b0be0edcf877e6b5d33302ed (patch)
treea1e5f62f65fb9cf767c393bda9020f6e1b63a187 /cpp/src/qpid/sys/windows
parent24e9d70d7bcefae3a68d3cc4b19e684440776a05 (diff)
downloadqpid-python-4a0452844f85edc5b0be0edcf877e6b5d33302ed.tar.gz
QPID-4095: Move the directory iteration into FileSysDir:
- For Posix implement with direct calls - For windows implement with v2/v3 boost::filesystem to be replaced later git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1424247 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/windows')
-rw-r--r--cpp/src/qpid/sys/windows/FileSysDir.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/cpp/src/qpid/sys/windows/FileSysDir.cpp b/cpp/src/qpid/sys/windows/FileSysDir.cpp
index 88f1637d48..88a2e62acc 100644
--- a/cpp/src/qpid/sys/windows/FileSysDir.cpp
+++ b/cpp/src/qpid/sys/windows/FileSysDir.cpp
@@ -25,6 +25,11 @@
#include <direct.h>
#include <errno.h>
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/path.hpp>
+
+namespace fs=boost::filesystem;
+
namespace qpid {
namespace sys {
@@ -50,4 +55,13 @@ void FileSysDir::mkdir(void)
throw Exception ("Can't create directory: " + dirPath);
}
+void FileSysDir::forEachFile(Callback cb) const {
+ fs::directory_iterator dirP(dirPath);
+ fs::directory_iterator endItr;
+ for (fs::directory_iterator itr (dirP); itr != endItr; ++itr)
+ {
+ cb(itr->path().string());
+ }
+}
+
}} // namespace qpid::sys