The parameter manager class This class manages a parameter XML document. More...
#include <Parameter.h>
Public Member Functions | |
void CheckDocument () const | |
void CreateDocument (void) | |
int LoadDocument (const char *sFileName) | |
int LoadDocument (const XERCES_CPP_NAMESPACE_QUALIFIER InputSource &) | |
bool LoadOrCreateDocument (const char *sFileName) | |
ParameterManager () | |
Default construction. More... | |
void SaveDocument (const char *sFileName) const | |
void SaveDocument (XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatTarget *pFormatTarget) const | |
~ParameterManager () | |
Destruction complete destruction of the object. More... | |
![]() | |
void copyTo (Base::Reference< ParameterGrp >) | |
make a deep copy to the other group More... | |
void insertTo (Base::Reference< ParameterGrp >) | |
overwrite everything similar, leave the others alone More... | |
void exportTo (const char *FileName) | |
export this group to a file More... | |
void importFrom (const char *FileName) | |
import from a file to this group More... | |
void insert (const char *FileName) | |
insert from a file to this group, overwrite only the similar More... | |
bool GetBool (const char *Name, bool bPreset=false) const | |
read bool values or give default More... | |
void SetBool (const char *Name, bool bValue) | |
set a bool value More... | |
std::vector< bool > GetBools (const char *sFilter=NULL) const | |
get a vector of all bool values in this group More... | |
std::vector< std::pair< std::string, bool > > GetBoolMap (const char *sFilter=NULL) const | |
get a map with all bool values and the keys of this group More... | |
void RemoveBool (const char *Name) | |
remove a bool value from this group More... | |
long GetInt (const char *Name, long lPreset=0) const | |
read bool values or give default More... | |
void SetInt (const char *Name, long lValue) | |
set a int value More... | |
std::vector< long > GetInts (const char *sFilter=NULL) const | |
get a vector of all int values in this group More... | |
std::vector< std::pair< std::string, long > > GetIntMap (const char *sFilter=NULL) const | |
get a map with all int values and the keys of this group More... | |
void RemoveInt (const char *Name) | |
remove a int value from this group More... | |
unsigned long GetUnsigned (const char *Name, unsigned long lPreset=0) const | |
read uint values or give default More... | |
void SetUnsigned (const char *Name, unsigned long lValue) | |
set a uint value More... | |
std::vector< unsigned long > GetUnsigneds (const char *sFilter=NULL) const | |
get a vector of all uint values in this group More... | |
std::vector< std::pair< std::string, unsigned long > > GetUnsignedMap (const char *sFilter=NULL) const | |
get a map with all uint values and the keys of this group More... | |
void RemoveUnsigned (const char *Name) | |
remove a uint value from this group More... | |
double GetFloat (const char *Name, double dPreset=0.0) const | |
set a float value More... | |
void SetFloat (const char *Name, double dValue) | |
read float values or give default More... | |
std::vector< double > GetFloats (const char *sFilter=NULL) const | |
get a vector of all float values in this group More... | |
std::vector< std::pair< std::string, double > > GetFloatMap (const char *sFilter=NULL) const | |
get a map with all float values and the keys of this group More... | |
void RemoveFloat (const char *Name) | |
remove a float value from this group More... | |
void SetBlob (const char *Name, void *pValue, long lLength) | |
set a blob value More... | |
void GetBlob (const char *Name, void *pBuf, long lMaxLength, void *pPreset=NULL) const | |
read blob values or give default More... | |
void RemoveBlob (const char *Name) | |
remove a blob value from this group More... | |
Base::Reference< ParameterGrp > GetGroup (const char *Name) | |
get a handle to a sub group or create one More... | |
std::vector< Base::Reference< ParameterGrp > > GetGroups (void) | |
get a vector of all sub groups in this group More... | |
bool IsEmpty (void) const | |
test if this group is empty More... | |
bool HasGroup (const char *Name) const | |
test if a special sub group is in this group More... | |
void RemoveGrp (const char *Name) | |
remove a sub group from this group More... | |
bool RenameGrp (const char *OldName, const char *NewName) | |
rename a sub group from this group More... | |
void Clear (void) | |
clears everything in this group (all types) More... | |
void SetASCII (const char *Name, const char *sValue) | |
set a string value More... | |
std::string GetASCII (const char *Name, const char *pPreset=NULL) const | |
read a string values More... | |
void RemoveASCII (const char *Name) | |
remove a string value from this group More... | |
std::vector< std::string > GetASCIIs (const char *sFilter=NULL) const | |
Return all string elements in this group as a vector of strings Its also possible to set a filter criteria. More... | |
std::vector< std::pair< std::string, std::string > > GetASCIIMap (const char *sFilter=NULL) const | |
Same as GetASCIIs() but with key,value map. More... | |
const char * GetGroupName (void) const | |
returns the name More... | |
void NotifyAll () | |
Notifies all observers for all entries except of sub-groups. More... | |
![]() | |
int getRefCount (void) const | |
Handled () | |
const Handled & operator= (const Handled &) | |
void ref () const | |
void unref () const | |
virtual ~Handled () | |
![]() | |
void Attach (Observer< const char * > *ToObserv) | |
Attach an Observer Attach an Observer to the list of Observers which get called when Notify is called. More... | |
void ClearObserver () | |
Clears the list of all registered observers. More... | |
void Detach (Observer< const char * > *ToObserv) | |
Detach an Observer Detach an Observer from the list of Observers which get called when Notify is called. More... | |
Observer< const char * > * Get (const char *Name) | |
Get an Observer by name Get a observer by name if the observer reimplements the Name() mthode. More... | |
void Notify (const char * rcReason) | |
Notify all Observers Send a message to all Observers attached to this subject. More... | |
Subject () | |
A constructor. More... | |
virtual ~Subject () | |
A destructor. More... | |
Static Public Member Functions | |
static void Init (void) | |
static void Terminate (void) | |
Parameter serialization | |
void SetSerializer (ParameterSerializer *) | |
Sets a serializer. The ParameterManager takes ownership of the serializer. More... | |
bool HasSerializer () const | |
Returns true if a serializer is set, otherwise false is returned. More... | |
int LoadDocument () | |
Loads an XML document by calling the serializer's load method. More... | |
bool LoadOrCreateDocument () | |
Loads or creates an XML document by calling the serializer's load method. More... | |
void SaveDocument () const | |
Saves an XML document by calling the serializer's save method. More... | |
Additional Inherited Members | |
![]() | |
typedef Base::Reference< ParameterGrp > handle | |
type of the handle More... | |
![]() | |
typedef const char * MessageType | |
typedef Observer< const char * > ObserverType | |
typedef Subject< const char * > SubjectType | |
![]() | |
ParameterGrp (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *GroupNode=0L, const char *sName=0L) | |
constructor is protected (handle concept) More... | |
~ParameterGrp () | |
destructor is protected (handle concept) More... | |
bool ShouldRemove () const | |
XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * FindNextElement (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *Prev, const char *Type) const | |
XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * FindElement (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *Start, const char *Type, const char *Name=0L) const | |
Find an element specified by Type and Name Search in the parent element Start for the first occurrence of an element of Type and with the attribute Name=Name. More... | |
XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * FindOrCreateElement (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *Start, const char *Type, const char *Name) const | |
Find an element specified by Type and Name or create it if not found Search in the parent element Start for the first occurrence of an element of Type and with the attribute Name=Name. More... | |
Detailed Description
The parameter manager class This class manages a parameter XML document.
Does loading, saving and handling the DOM document.
- See also
- ParameterGrp
Constructor & Destructor Documentation
◆ ParameterManager()
ParameterManager::ParameterManager | ( | ) |
Default construction.
References Init().
◆ ~ParameterManager()
ParameterManager::~ParameterManager | ( | ) |
Destruction complete destruction of the object.
Member Function Documentation
◆ CheckDocument()
void ParameterManager::CheckDocument | ( | ) | const |
References Base::Console(), Base::ConsoleSingleton::Error(), and SaveDocument().
Referenced by Gui::Dialog::DlgParameterImp::onChangeParameterSet().
◆ CreateDocument()
void ParameterManager::CreateDocument | ( | void | ) |
References XStr::unicodeForm().
Referenced by ParameterGrp::exportTo(), and LoadOrCreateDocument().
◆ HasSerializer()
bool ParameterManager::HasSerializer | ( | ) | const |
Returns true if a serializer is set, otherwise false is returned.
Referenced by Gui::Dialog::DlgParameterImp::onChangeParameterSet().
◆ Init()
|
static |
Referenced by ParameterManager().
◆ LoadDocument() [1/3]
int ParameterManager::LoadDocument | ( | ) |
Loads an XML document by calling the serializer's load method.
References ParameterSerializer::LoadDocument().
Referenced by LoadDocument(), and LoadOrCreateDocument().
◆ LoadDocument() [2/3]
int ParameterManager::LoadDocument | ( | const char * | sFileName | ) |
References LoadDocument(), and XStr::unicodeForm().
Referenced by ParameterGrp::importFrom(), ParameterGrp::insert(), and ParameterSerializer::LoadDocument().
◆ LoadDocument() [3/3]
int ParameterManager::LoadDocument | ( | const XERCES_CPP_NAMESPACE_QUALIFIER InputSource & | inputSource | ) |
References ParameterGrp::FindElement().
◆ LoadOrCreateDocument() [1/2]
bool ParameterManager::LoadOrCreateDocument | ( | ) |
Loads or creates an XML document by calling the serializer's load method.
References ParameterSerializer::LoadOrCreateDocument().
◆ LoadOrCreateDocument() [2/2]
bool ParameterManager::LoadOrCreateDocument | ( | const char * | sFileName | ) |
References CreateDocument(), and LoadDocument().
Referenced by ParameterSerializer::LoadOrCreateDocument().
◆ SaveDocument() [1/3]
void ParameterManager::SaveDocument | ( | ) | const |
Saves an XML document by calling the serializer's save method.
References ParameterSerializer::SaveDocument().
Referenced by CheckDocument(), and SaveDocument().
◆ SaveDocument() [2/3]
void ParameterManager::SaveDocument | ( | const char * | sFileName | ) | const |
◆ SaveDocument() [3/3]
void ParameterManager::SaveDocument | ( | XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatTarget * | pFormatTarget | ) | const |
◆ SetSerializer()
void ParameterManager::SetSerializer | ( | ParameterSerializer * | ps | ) |
Sets a serializer. The ParameterManager takes ownership of the serializer.
◆ Terminate()
|
static |
References StrXUTF8::terminate(), and XUTF8Str::terminate().
Referenced by App::Application::destruct().
The documentation for this class was generated from the following files:
- src/Base/Parameter.h
- src/Base/Parameter.cpp