sptk2 logo
SPTK Home Page

sptk::CRegistry Class Reference
[Utility Classes]

Registry. More...

#include <CRegistry.h>

Inheritance diagram for sptk::CRegistry:

sptk::CXmlDoc sptk::CSharedStrings sptk::CXmlElement sptk::CXmlNamedItem sptk::CXmlNode

List of all members.

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.


Detailed Description

Registry.

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.


Constructor & Destructor Documentation

sptk::CRegistry::CRegistry ( std::string  fileName,
std::string  programGroupName,
CRegistryMode  mode = USER_REGISTRY 
)

Constructor.

Parameters:
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


Member Function Documentation

virtual void sptk::CRegistry::load ( const CBuffer buffer  )  [inline, virtual]

Loads registry from buffer.

Parameters:
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 "/".

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
data const CXmlDoc&, the XML document to load data from


The documentation for this class was generated from the following file:

Mon Mar 5 11:56:06 2012: SPTK 3.5.7