Browse Source

Make filePaths vector private and create a public getter method for it

master
Krisjanis Rijnieks 11 years ago
parent
commit
1a8f527f57
  1. 29
      src/MediaServer/DirectoryWatcher.cpp
  2. 4
      src/MediaServer/DirectoryWatcher.h

29
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);
}
}
}
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<std::string>& DirectoryWatcher::getFilePaths() {
return filePaths;
}
} // namespace piMapper
} // namespace ifx

4
src/MediaServer/DirectoryWatcher.h

@ -99,7 +99,8 @@ class DirectoryWatcher {
<< "Error: " << exc.displayText();
}
std::vector<std::string> filePaths;
// Getters
std::vector<std::string>& getFilePaths();
// Custom events
ofEvent<string> onItemAdded;
@ -111,6 +112,7 @@ class DirectoryWatcher {
private:
ofx::IO::DirectoryWatcherManager dirWatcher;
CustomPathFilter filter;
std::vector<std::string> filePaths;
};
}
}
Loading…
Cancel
Save