|
SWC-DB
v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
|
Go to the documentation of this file.
11 namespace SWC {
namespace Config {
14 for (
const auto& kv :
m_map)
22 for(
const auto& kv : opts.
map) {
23 if(
has(kv.first.c_str()) &&
24 (kv.second->is_default() ||
25 (only_guarded && !kv.second->is_guarded())))
27 set(kv.first.c_str(), kv.second);
35 bool allow_unregistered,
42 std::ifstream in(fname.c_str());
46 (void)allow_unregistered;
54 load(fname, filedesc, cmddesc,
true);
59 <<
"CONFIG_BAD_CFG_FILE " << fname <<
": " << e;
77 ptr->default_value(
false);
83 for(
auto it=m_map.cbegin(); it!=m_map.cend(); ++it) {
87 for(
auto it=m_alias_map.cbegin(); it!=m_alias_map.cend(); ++it) {
89 return m_map.find(it->second) != m_map.cend();
104 for(
auto it =
m_map.cbegin(); it !=
m_map.cend(); ++it)
109 for(
auto it=
m_map.cbegin(); it!=
m_map.cend(); ++it) {
118 SWC_SHOULD_NOT_INLINE
120 bool null_ok)
const {
121 for(
auto it=
m_map.cbegin(); it!=
m_map.cend(); ++it) {
127 auto prop =
m_map.find(it->second);
128 if(prop !=
m_map.cend())
137 "getting value of '%s' - missing", name);
142 for(
const auto& kv :
m_map) {
143 isdefault = kv.second->is_default();
144 if(include_default || !isdefault) {
145 out << kv.first <<
'=' << kv.second->to_string();
static const char *SWC_CONST_FUNC to_string(Type type) noexcept
void reload(const std::string &fname, const Config::ParserConfig &filedesc, const Config::ParserConfig &cmddesc)
ParserConfig & add(const ParserConfig &other_cfg)
void remove(const char *name)
#define SWC_LOG_OUT(pr, _code_)
void print(std::ostream &out, bool include_default=false) const
const Options &SWC_CONST_FUNC get_options() const noexcept
bool is_default() const noexcept
bool defaulted(const char *name) const
void get_names(Strings &names) const
bool str_eq(const char *s1, const char *s2) noexcept SWC_ATTRIBS((SWC_ATTRIB_O3))
#define SWC_CURRENT_EXCEPTION(_msg_)
The SWC-DB C++ namespace 'SWC'.
void set(const char *name, Property::Value::Ptr p)
virtual Ptr make_new(const Strings &values=Strings())=0
std::map< std::string, Property::Value::Ptr > map
bool SWC_PURE_FUNC has(const char *name) const noexcept
#define SWC_THROWF(_code_, _fmt_,...)
void load(const std::string &fname, const Config::ParserConfig &filedesc, const Config::ParserConfig &cmddesc, bool allow_unregistered=false, bool only_guarded=false)
void parse_filedata(std::ifstream &in)
void load_from(const Config::Parser::Options &opts, bool only_guarded=false)
std::string to_string(const char *name) const
Property::Value::Ptr get_ptr(const char *name, bool null_ok=false) const
SWC_CAN_INLINE void push_back(ArgsT &&... args)
void alias(const char *primary, const char *secondary)
SWC_CAN_INLINE void reserve(size_type cap)