Go to the documentation of this file.
146 config2.
setValue(
"foo",
"replaced");
148 config2.
setValue(
"test2",
"also replaced");
151 config2.
setValue(
"name",
"this is a new group");
154 config1.add(config2);
163 int main(
int argc,
char **argv) {
bool endArrayItem()
endArrayItem go back to the array level
bool writeArray(const std::string &name)
writeArray starts writing an array. Or start extending it, if it already exists.
bool loadFromYAMLFile(const std::string &filename, const ResolveConfig &resolve_config=ResolveConfig::defaultConfig())
loadFromYAMLFile loads a yaml file into a ReaderWriter class
bool writeGroup(const std::string &name)
writeGroup starts writing a group. Or start extending it, if it already exists.
bool addArrayItem()
addArrayItem create a new item in the array
void test1(const std::string &filename)
bool readArray(const std::string &name, const RequiredOrOptional opt=OPTIONAL)
readArray read the child with key 'name', which should be an array
bool sync()
sync re-read the source file if the file has changed since last reading time.
const std::string & error() const
bool endGroup()
endGroup go to the parrent of current group, wrapping end() for readbility
bool endArray()
endArray go to parrent of current array, wrapping end() for readibility
bool value(const std::string &name, T &value, RequiredOrOptional opt=REQUIRED)
value read value of child with key 'name'
void setValue(const std::string &name, const T &value)
setValue set child value with key 'name' and value 'value'
ReaderWriter limitScope() const
limitScope Limit the data to the current position. All parents and siblings incl. their child aren't ...
int main(int argc, char **argv)
bool readGroup(const std::string &name, const RequiredOrOptional opt=OPTIONAL)
readGroup read the child with key 'name', which should be a group
bool nextArrayItem()
nextArrayItem go to the next item in the array, wrapping next() for readbility
tue::config::ReaderWriter config