Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

COptionsXML Class Reference

Store configuration options in an XML tree. More...

#include <OptionsXML.h>

Inheritance diagram for COptionsXML:

CVideoDeviceOptions CVideoOptions List of all members.

Public Member Functions

Protected Member Functions


Detailed Description

Store configuration options in an XML tree.

Author:
Nemosoft Unv.
With this class configuration options for applications can be easily stored and retrieved in XML format. Rather than wading through a complex XML tree, this class lets you store a simple list of options and references their values by their name.

This class won't do recursive storage or grouping. It's a simple 1-to-1 list. For 90% of the cases, that is enough.

The class should be initialized with a list of variable names and their defaults using DeclareVariable . Trying to set a variable name that isn't in the list will be ignored; getting a variable that isn't there will return a null variable.


Constructor & Destructor Documentation

COptionsXML::COptionsXML  )  [protected]
 

COptionsXML::~COptionsXML  )  [virtual]
 


Member Function Documentation

void COptionsXML::DeclareVariable const QString &  name,
const QString &  defvalue
[protected]
 

Declare a variable in this class.

Parameters:
name The name by which the variable is known
defvalue A default (start) value
With this function you can declare a variable that can be retrieved and stored in an XML subtree.

virtual void COptionsXML::DeclareVariables  )  [protected, pure virtual]
 

Implemented in CVideoOptions, and CVideoDeviceOptions.

QString COptionsXML::Get const QString &  name  )  const
 

bool COptionsXML::GetBool const QString &  name  )  const
 

int COptionsXML::GetInt const QString &  name  )  const
 

void COptionsXML::GetXML QDomNode &  node  )  const [virtual]
 

Return XML tree.

For every variable declared, set its value as a subnode in the XML node. In the XML file, it looks like this: <name>value

Note:
No subnodes are cleared, so existing subnodes that are not in our declared variables remain intact.

Reimplemented in CVideoOptions.

void COptionsXML::Set const QString &  name,
bool  value
 

void COptionsXML::Set const QString &  name,
int  value
 

void COptionsXML::Set const QString &  name,
const QString &  value
 

void COptionsXML::SetXML const QDomNode &  node  )  [virtual]
 

Parse XML tree.

For every variable declared, retrieve the value from this node and store it.

Reimplemented in CVideoOptions.


The documentation for this class was generated from the following files:
Generated on Wed Dec 13 23:38:47 2006 for CamStream by doxygen 1.3.7