38 : m_stringValues(rhs.m_stringValues ? new
std::
vector<
std::
string>(*(rhs.m_stringValues)) : nullptr),
39 m_keyValues(rhs.m_keyValues ? new
KeyValues(*(rhs.m_keyValues)) : nullptr),
40 m_version(rhs.m_version) {}
60 throw std::runtime_error(
"adding key/value to configuration containing string values");
63 m_keyValues = std::make_unique<KeyValues>(1, std::make_pair(iKey, iConfig));
65 m_keyValues->push_back(std::make_pair(iKey, iConfig));
71 throw std::runtime_error(
"adding key/value to configuration containing string values");
74 throw std::runtime_error(
"adding key/value to configuration containing string values");
78 m_keyValues = std::make_unique<KeyValues>(1, std::make_pair(iKey, iConfig));
85 m_keyValues->push_back(std::make_pair(iKey, iConfig));
96 throw std::runtime_error(
"adding string value to configuration containing key/value pairs");
99 m_stringValues = std::make_unique<std::vector<std::string>>(1, iValue);
117 throw std::runtime_error(
"no string values set");
124 throw std::runtime_error(
"valueFoKey fails because configuration containing string values");
127 throw std::runtime_error(
"valueForKey fails becuase no key/values set");
129 KeyValues::iterator itFind =
132 std::bind(std::equal_to<void>(),
138 return &(itFind->second);
197 static int recursionLevel = -1;
202 for (FWConfiguration::StringValues::const_iterator
it = iConfig.
stringValues()->begin();
209 for (FWConfiguration::KeyValues::const_iterator
it = iConfig.
keyValues()->begin();
it != iConfig.
keyValues()->end();
FWConfiguration(unsigned int iVersion=1)
FWConfiguration & operator=(const FWConfiguration &)
void swap(Association< C > &lhs, Association< C > &rhs)
const std::string & value(unsigned int iIndex=0) const
void swap(FWConfiguration &)
std::unique_ptr< std::vector< std::pair< std::string, FWConfiguration > > > m_keyValues
const StringValues * stringValues() const
std::vector< std::pair< std::string, FWConfiguration > > KeyValues
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
FWConfiguration & addValue(const std::string &)
std::string attrEscape(std::string value)
virtual ~FWConfiguration()
const FWConfiguration * valueForKey(const std::string &iKey) const
const KeyValues * keyValues() const
std::unique_ptr< std::vector< std::string > > m_stringValues
unsigned int version() const
static void streamTo(std::ostream &oTo, const FWConfiguration &iConfig, const std::string &name)