From 1a8f527f57d0c0d78f082272871f831667bc1775 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Wed, 15 Oct 2014 15:45:57 +0200 Subject: [PATCH] Make filePaths vector private and create a public getter method for it --- src/MediaServer/DirectoryWatcher.cpp | 29 ++++++++++++++++------------ src/MediaServer/DirectoryWatcher.h | 4 +++- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/MediaServer/DirectoryWatcher.cpp b/src/MediaServer/DirectoryWatcher.cpp index 661792c..b8d4199 100644 --- a/src/MediaServer/DirectoryWatcher.cpp +++ b/src/MediaServer/DirectoryWatcher.cpp @@ -9,15 +9,20 @@ #include "DirectoryWatcher.h" namespace ofx { -namespace piMapper { -DirectoryWatcher::DirectoryWatcher(std::string path, bool video) { - if (video) { - filter = CustomVideoPathFilter(); - } else { - filter = CustomImagePathFilter(); - } - dirWatcher.registerAllEvents(this); - dirWatcher.addPath(path, true, &filter); -} -} -} \ No newline at end of file + namespace piMapper { + DirectoryWatcher::DirectoryWatcher(std::string path, bool video) { + if (video) { + filter = CustomVideoPathFilter(); + } else { + filter = CustomImagePathFilter(); + } + dirWatcher.registerAllEvents(this); + dirWatcher.addPath(path, true, &filter); + } + + std::vector& DirectoryWatcher::getFilePaths() { + return filePaths; + } + + } // namespace piMapper +} // namespace ifx \ No newline at end of file diff --git a/src/MediaServer/DirectoryWatcher.h b/src/MediaServer/DirectoryWatcher.h index 121ea5c..47e6b27 100644 --- a/src/MediaServer/DirectoryWatcher.h +++ b/src/MediaServer/DirectoryWatcher.h @@ -99,7 +99,8 @@ class DirectoryWatcher { << "Error: " << exc.displayText(); } - std::vector filePaths; + // Getters + std::vector& getFilePaths(); // Custom events ofEvent onItemAdded; @@ -111,6 +112,7 @@ class DirectoryWatcher { private: ofx::IO::DirectoryWatcherManager dirWatcher; CustomPathFilter filter; + std::vector filePaths; }; } } \ No newline at end of file