#include <ConfigFile.h>
Inheritance diagram for fun::ConfigFile:
Public Slots | |
virtual bool | loadFromXML (const QString &filename=QString()) |
Loads this ConfigFile from the given file. | |
virtual bool | saveToXML (const QString &filename=QString()) const |
Saves this ConfigFile to the given file. | |
bool | loadFromText (std::istream &is) |
Loads this ConfigFile from the given input stream. | |
bool | saveToText (std::ostream &os) const |
Stores this ConfigFile to the given output stream. | |
Public Methods | |
virtual void | deserialize (const Deserializer &node) |
Tells the object to restore it's state from the given Deserializer. | |
virtual void | serialize (Serializer &node) const |
Tells the instance to save it's state to the given Serializer object. |
They can be loaded from & saved to plain text or XML files.
The most interesting methods are probably getString(), getInt(), etc., as those are how you get at the configuration values loaded from file. If you need to know whether a value was explicitly set in the file, use isSet(). That might be a little cumbersome; hopefully there aren't that many cases where it will matter whether a value was explicitly set, or couldn't be interpreted as an int or whatever.
The text format used will treat lines ending in "\" as continued on the next line. \t and
will be expanded into tab and newline during reading, and will be escaped again during writing.
Definition at line 68 of file ConfigFile.h.
|
Loads this ConfigFile from the given file. If filename is empty, this->getFilename() will be used. Definition at line 174 of file ConfigFile.cpp. References fun::Deserializer::getSerializable(), and fun::PropertyList::mergeIn(). |
|
Saves this ConfigFile to the given file. If filename is empty, this->getFilename() will be used. Definition at line 203 of file ConfigFile.cpp. References fun::Serializer::putSerializable(), and fun::SerialTree::saveToXMLFile(). |