Go to the documentation of this file.
20 const std::string& prefix_keys)
22 m_prefix_sections(prefix_sections),
23 m_prefix_keys(prefix_keys)
37 const std::string& prefix_sections,
const std::string& prefix_keys)
57 "You must first bind CConfigFilePrefixer to an existing object!");
61 std::vector<std::string>& sections)
const
69 const std::string& section, std::vector<std::string>& keys)
const
82 const std::string& section,
const std::string& name,
const std::string& str)
90 const std::string& section,
const std::string& name,
91 const std::string& defaultStr,
bool failIfNotFound)
const
std::string readString(const std::string §ion, const std::string &name, const std::string &defaultStr, bool failIfNotFound=false) const override
A virtual method to read a generic string.
std::string getKeyPrefix() const
virtual std::string readString(const std::string §ion, const std::string &name, const std::string &defaultStr, bool failIfNotFound=false) const =0
A virtual method to read a generic string.
void setPrefixes(const std::string &prefix_sections, const std::string &prefix_keys)
Change the prefix for sections and keys.
CConfigFileBase * m_bound_object
The object we are wrapping.
CConfigFileBase * getBoundConfigFileBase() const
Returns the currently-bounded config source, or nullptr if none.
void ensureIsBound() const
std::string getSectionPrefix() const
std::string m_prefix_keys
void bind(const CConfigFileBase &o)
Make this object to wrap the given existing CConfigFileBase object.
CConfigFilePrefixer()
Unbound constructor: must bind this object to CConfigFileBase before usage with bind() and setPrefixe...
virtual void writeString(const std::string §ion, const std::string &name, const std::string &str)=0
A virtual method to write a generic string.
void clear() override
Empties the "config file".
This class allows loading and storing values and vectors of different types from a configuration text...
virtual void clear()=0
Empties the "config file".
void getAllSections(std::vector< std::string > §ions) const override
Returns a list with all the section names.
virtual void getAllSections(std::vector< std::string > §ions) const =0
Returns a list with all the section names.
#define ASSERTMSG_(f, __ERROR_MSG)
Defines an assertion mechanism.
void getAllKeys(const std::string §ion, std::vector< std::string > &keys) const override
Returs a list with all the keys into a section.
virtual void getAllKeys(const std::string §ion, std::vector< std::string > &keys) const =0
Returs a list with all the keys into a section.
~CConfigFilePrefixer() override
std::string m_prefix_sections
void writeString(const std::string §ion, const std::string &name, const std::string &str) override
A virtual method to write a generic string.
Page generated by Doxygen 1.8.18 for MRPT 2.0.4 at Thu Sep 24 07:14:18 UTC 2020 | |