CGRA-ME
Classes | Functions
ConfigStore.h File Reference
#include <CGRA/utility/Collections.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <string>

Go to the source code of this file.

Classes

struct  ImplicitlyToString
 
class  ConfigStore
 

Functions

template<typename S1 , typename S2 >
bool equalsIgnoreCase (const S1 &s1, const S2 &s2)
 
template<typename S >
bool isTruthString (const S &s)
 
template<typename S >
bool isFarceString (const S &s)
 
const char * makeBoolString (bool v)
 
ConfigStoreadd_all (ConfigStore &into, const ConfigStore &from)
 Add (or set) all keys from from in into. More...
 
ConfigStoreset_all (ConfigStore &into, const ConfigStore &from)
 
ConfigStoreoverride_all (ConfigStore &into, const ConfigStore &from)
 
template<typename... CSes>
ConfigStoreadd_all (ConfigStore &into, const ConfigStore &from1, const CSes &... froms)
 
template<typename... CSes>
ConfigStoreset_all (ConfigStore &into, const ConfigStore &from1, const CSes &... froms)
 
template<typename... CSes>
ConfigStoreoverride_all (ConfigStore &into, const ConfigStore &from1, const CSes &... froms)
 
template<typename... CSes>
ConfigStore add_all (ConfigStore &&into, const ConfigStore &from1, const CSes &... froms)
 
template<typename... CSes>
ConfigStore set_all (ConfigStore &&into, const ConfigStore &from1, const CSes &... froms)
 
template<typename... CSes>
ConfigStore override_all (ConfigStore &&into, const ConfigStore &from1, const CSes &... froms)
 
template<typename... CSes>
ConfigStore with_added (ConfigStore into, const ConfigStore &from1, const CSes &... froms)
 
template<typename... CSes>
ConfigStore with_set (ConfigStore into, const ConfigStore &from1, const CSes &... froms)
 
template<typename... CSes>
ConfigStore with_overridden (ConfigStore into, const ConfigStore &from1, const CSes &... froms)
 
ConfigStore getEntriesForPrefix (const ConfigStore &cs, const std::string &prefix)
 
ConfigStore addPrefix (const ConfigStore &cs, const std::string &prefix)
 
template<typename Filter >
auto filterKeys (const ConfigStore &cs, Filter &&f) -> decltype(f(std::string()), ConfigStore())
 

Function Documentation

◆ add_all() [1/3]

template<typename... CSes>
ConfigStore add_all ( ConfigStore &&  into,
const ConfigStore from1,
const CSes &...  froms 
)

Definition at line 273 of file ConfigStore.h.

◆ add_all() [2/3]

ConfigStore& add_all ( ConfigStore into,
const ConfigStore from 
)
inline

Add (or set) all keys from from in into.

Definition at line 251 of file ConfigStore.h.

◆ add_all() [3/3]

template<typename... CSes>
ConfigStore& add_all ( ConfigStore into,
const ConfigStore from1,
const CSes &...  froms 
)

Definition at line 268 of file ConfigStore.h.

◆ addPrefix()

ConfigStore addPrefix ( const ConfigStore cs,
const std::string &  prefix 
)
inline

Return a (new) ConfigStore with all the keys prefixed with prefix

Definition at line 298 of file ConfigStore.h.

◆ equalsIgnoreCase()

template<typename S1 , typename S2 >
bool equalsIgnoreCase ( const S1 &  s1,
const S2 &  s2 
)

Definition at line 22 of file ConfigStore.h.

◆ filterKeys()

template<typename Filter >
auto filterKeys ( const ConfigStore cs,
Filter &&  f 
) -> decltype(f(std::string()), ConfigStore())

Return a (new) ConfigStore with only the allowed keys; keys that the filter returns true

2-arg (key, value) overload

Definition at line 311 of file ConfigStore.h.

◆ getEntriesForPrefix()

ConfigStore getEntriesForPrefix ( const ConfigStore cs,
const std::string &  prefix 
)
inline

Return a (new) ConfigStore, that is cs filtered to only contain entries that start with prefix, with that prefix removed.

Definition at line 285 of file ConfigStore.h.

◆ isFarceString()

template<typename S >
bool isFarceString ( const S &  s)

Definition at line 45 of file ConfigStore.h.

◆ isTruthString()

template<typename S >
bool isTruthString ( const S &  s)

Definition at line 35 of file ConfigStore.h.

◆ makeBoolString()

const char* makeBoolString ( bool  v)
inline

Definition at line 54 of file ConfigStore.h.

◆ override_all() [1/3]

template<typename... CSes>
ConfigStore override_all ( ConfigStore &&  into,
const ConfigStore from1,
const CSes &...  froms 
)

Definition at line 275 of file ConfigStore.h.

◆ override_all() [2/3]

ConfigStore& override_all ( ConfigStore into,
const ConfigStore from 
)
inline

Like set_all but throws if a key doesn't exist

Definition at line 257 of file ConfigStore.h.

◆ override_all() [3/3]

template<typename... CSes>
ConfigStore& override_all ( ConfigStore into,
const ConfigStore from1,
const CSes &...  froms 
)

Definition at line 270 of file ConfigStore.h.

◆ set_all() [1/3]

template<typename... CSes>
ConfigStore set_all ( ConfigStore &&  into,
const ConfigStore from1,
const CSes &...  froms 
)

Definition at line 274 of file ConfigStore.h.

◆ set_all() [2/3]

ConfigStore& set_all ( ConfigStore into,
const ConfigStore from 
)
inline

Definition at line 252 of file ConfigStore.h.

◆ set_all() [3/3]

template<typename... CSes>
ConfigStore& set_all ( ConfigStore into,
const ConfigStore from1,
const CSes &...  froms 
)

Definition at line 269 of file ConfigStore.h.

◆ with_added()

template<typename... CSes>
ConfigStore with_added ( ConfigStore  into,
const ConfigStore from1,
const CSes &...  froms 
)

Definition at line 278 of file ConfigStore.h.

◆ with_overridden()

template<typename... CSes>
ConfigStore with_overridden ( ConfigStore  into,
const ConfigStore from1,
const CSes &...  froms 
)

Definition at line 280 of file ConfigStore.h.

◆ with_set()

template<typename... CSes>
ConfigStore with_set ( ConfigStore  into,
const ConfigStore from1,
const CSes &...  froms 
)

Definition at line 279 of file ConfigStore.h.