56 explicit Config(
bool multi_value =
false);
62 explicit Config(std::istream& is,
bool multi_value =
false);
81 void SetParam(
const std::string& key,
const T& value,
bool is_string =
false);
89 const std::string&
GetParam(
const std::string& key)
const;
123 using iterator_category = std::input_iterator_tag;
125 using difference_type = std::ptrdiff_t;
161 void FindNextIndex();
170 std::vector<std::string> val;
171 std::vector<size_t> insert_index;
174 void Insert(
const std::string& key,
const std::string& value,
bool is_string);
177 std::map<std::string, ConfigValue> config_map_;
178 std::vector<std::pair<std::string, size_t> > order_;
179 const bool multi_value_;
184 std::ostringstream oss;
186 Insert(key, oss.str(), is_string);
iterator class
Definition config.h:120
ConfigIterator & operator++()
uni-increment operators
Definition config.cc:236
ConfigEntry operator*() const
retrieve value from operator
Definition config.cc:258
bool operator!=(const ConfigIterator &rhs) const
compare operators not equal
Definition config.cc:254
bool operator==(const ConfigIterator &rhs) const
compare operators
Definition config.cc:250
class for config parser
Definition config.h:40
ConfigIterator begin() const
get begin iterator
Definition config.cc:203
void Clear(void)
clear all the values
Definition config.cc:138
bool IsGenuineString(const std::string &key) const
check whether the configure value given by the key should be wrapped by quotes
Definition config.cc:172
Config(std::istream &is, bool multi_value=false)
create config and load content from the given stream
ConfigIterator end() const
get end iterator
Definition config.cc:207
void SetParam(const std::string &key, const T &value, bool is_string=false)
set a key-value pair into the config; if the key already exists in the configure file,...
Definition config.h:183
const std::string & GetParam(const std::string &key) const
get the config under the key; if multiple values exist for the same key, return the last inserted one...
Definition config.cc:165
std::string ToProtoString(void) const
transform all the configuration into string recognizable to protobuf
Definition config.cc:191
void LoadFromStream(std::istream &is)
load the contents from the stream
Definition config.cc:143
std::pair< std::string, std::string > ConfigEntry
type when extracting from iterator
Definition config.h:45
namespace for dmlc
Definition array_view.h:12