summaryrefslogtreecommitdiff
path: root/project2/ut/testOptionsSource.cpp
blob: 23e21d0f77b2e39966cfa84235e2383690bc584c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "testOptionsSource.h"

const Glib::ustring testPlatform;

TestOptionsSource::TestOptionsSource(const Opts & o) :
	createdAt(boost::posix_time::microsec_clock::universal_time()),
	opts(o)
{
}

void
TestOptionsSource::loadInto(const ConfigConsumer & consume, const Options::CurrentPlatform & platform) const
{
	for (const auto & opt : opts) {
		consume(opt.first, testPlatform, opt.second, platform);
	}
}

boost::posix_time::ptime
TestOptionsSource::modifiedTime() const
{
	return createdAt;
}

void
TestOptionsSource::LoadTestOptions(const Opts & o)
{
	OptionsSource::loadSource(boost::bind<const Glib::ustring &>([]{ return testPlatform; }),
			OptionsSourcePtr(new TestOptionsSource(o)));	
}