|
#include <CRegistry.h>

Public Member Functions | |
| CRegistry (std::string fileName, std::string programGroupName, CRegistryMode mode=USER_REGISTRY) | |
| Constructor. | |
| virtual | ~CRegistry () |
| Destructor. | |
| void | fileName (std::string fname) |
| Sets the registry file name. | |
| const std::string | fileName () |
| Returns the registry file name. | |
| virtual void | load (const char *fileName=NULL) |
| Loads registry from the file. Usually it's the first action with registry. | |
| virtual void | load (const CStrings &data) |
| Loads registry from the string list. | |
| virtual void | load (const CXmlDoc &data) |
| Loads registry from XML node. | |
| virtual void | load (const CBuffer &buffer) |
| Loads registry from buffer. | |
| virtual void | save () |
| Saves registry to the file. | |
| virtual void | save (CStrings &data) |
| Saves registry to the the string list. | |
| virtual void | save (CXmlDoc &data) const |
| Saves registry to XML node. | |
| virtual void | save (CBuffer &buffer, int indent=0) const |
| Saves registry to buffer. | |
Static Public Member Functions | |
| static std::string | homeDirectory () |
| Finds out the user's home directory. | |
Works with INI and XML configuration-files. Class allows to read both INI and XML files and write the output file in the same format, or change the output format before saving the file.
| sptk::CRegistry::CRegistry | ( | std::string | fileName, | |
| std::string | programGroupName, | |||
| CRegistryMode | mode = USER_REGISTRY | |||
| ) |
Constructor.
| fileName | std::string, the registry file name w/o path | |
| programGroupName | std::string, the name of the program group to generate a directory name for the registry files. Should be a single phrase without '\' or '/' | |
| mode | CRegistryMode, see CRegistryMode for details |
| virtual void sptk::CRegistry::load | ( | const CBuffer & | buffer | ) | [inline, virtual] |
Loads registry from buffer.
| buffer | const CBuffer&, source buffer |
Reimplemented from sptk::CXmlDoc.
References sptk::CXmlDoc::load().
| virtual void sptk::CRegistry::load | ( | const CXmlDoc & | data | ) | [virtual] |
Loads registry from XML node.
Any XML node that has subnodes is considered as section. Nested sections make paths with the elements separated with "/".
| data | const CXmlDoc&, the XML document to load data from |
| virtual void sptk::CRegistry::load | ( | const char * | fileName = NULL |
) | [virtual] |
Loads registry from the file. Usually it's the first action with registry.
| fileName | const char*, the optional file name |
Reimplemented from sptk::CXmlDoc.
| virtual void sptk::CRegistry::save | ( | CBuffer & | buffer, | |
| int | indent = 0 | |||
| ) | const [inline, virtual] |
Saves registry to buffer.
| buffer | CBuffer&, a buffer to save document | |
| indent | int, how many indent spaces at start |
Reimplemented from sptk::CXmlDoc.
References sptk::CXmlDoc::save().
| virtual void sptk::CRegistry::save | ( | CXmlDoc & | data | ) | const [virtual] |
Saves registry to XML node.
Nested sections with paths with the elements separated with "/" make nested XML nodes.
| data | const CXmlDoc&, the XML document to load data from |