45 const std::string& section,
const std::string& name,
46 const std::string& str)
override;
52 const std::string& section,
const std::string& name,
53 const std::string& defaultStr,
54 bool failIfNotFound =
false)
const override;
86 void getAllSections(std::vector<std::string>& sections)
const override;
89 void clear()
override;
92 void getAllKeys(
const std::string& section, std::vector<std::string>& keys)
mrpt::pimpl< Impl > m_impl
~CConfigFile() override
Destructor.
void writeString(const std::string §ion, const std::string &name, const std::string &str) override
A virtual method to write a generic string.
void getAllSections(std::vector< std::string > §ions) const override
Returns a list with all the section names.
spimpl::impl_ptr< T > pimpl
bool m_modified
If modified since load.
This class allows loading and storing values and vectors of different types from ".ini" files easily.
CConfigFile()
Constructor, does not open any file.
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.
This class allows loading and storing values and vectors of different types from a configuration text...
void writeNow()
Dumps the changes to the physical configuration file now, not waiting until destruction.
std::string m_file
The name of the file.
std::string getAssociatedFile() const
Returns the file currently open by this object.
void setFileName(const std::string &fil_path)
Associate this object with the given file, so future read/write operations will be applied to that fi...
void discardSavingChanges()
Discard saving (current) changes to physical file upon destruction.
void getAllKeys(const std::string §ion, std::vector< std::string > &keys) const override
Returs a list with all the keys into a section.
void clear() override
Empties the "config file".