summaryrefslogtreecommitdiff
path: root/project2/ice/iceboxOptionsSource.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-08-23 17:41:58 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-10-06 14:07:10 +0100
commitad7be2bd9721c0ebf1ebeba7a1b7f36ebb3bffdf (patch)
treec84aadeaac3aaa7b65ff3137055c6e295a0e0f02 /project2/ice/iceboxOptionsSource.cpp
parentBasic daemon implementation to host a Project2 daemon inside IceBox with unit... (diff)
downloadproject2-ad7be2bd9721c0ebf1ebeba7a1b7f36ebb3bffdf.tar.bz2
project2-ad7be2bd9721c0ebf1ebeba7a1b7f36ebb3bffdf.tar.xz
project2-ad7be2bd9721c0ebf1ebeba7a1b7f36ebb3bffdf.zip
Add basic support for reading Project2 options from Ice properties
Diffstat (limited to 'project2/ice/iceboxOptionsSource.cpp')
-rw-r--r--project2/ice/iceboxOptionsSource.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/project2/ice/iceboxOptionsSource.cpp b/project2/ice/iceboxOptionsSource.cpp
new file mode 100644
index 0000000..90eca8e
--- /dev/null
+++ b/project2/ice/iceboxOptionsSource.cpp
@@ -0,0 +1,25 @@
+#include "iceboxOptionsSource.h"
+
+IceBoxOptionsSource::IceBoxOptionsSource(Ice::CommunicatorPtr i) :
+ ic(i),
+ startTime(boost::posix_time::microsec_clock::universal_time())
+{
+}
+
+boost::posix_time::ptime
+IceBoxOptionsSource::modifiedTime() const
+{
+ return startTime;
+}
+
+void
+IceBoxOptionsSource::loadInto(const ConfigConsumer & consume, const Options::CurrentPlatform & currentPlatform) const
+{
+ if (!ic) return;
+ auto props = ic->getProperties();
+ if (!props) return;
+ for (auto & prop : props->getPropertiesForPrefix("project2")) {
+ consume(prop.first.substr(9), "", prop.second, currentPlatform);
+ }
+}
+