#include <freXMLStreamObject.h>

Public Types | |
| typedef std::pair < std::string, std::string > | AttributeType |
| typedef std::map < std::string, std::string > | AttributesType |
| typedef std::vector < AttributeType > | AttributesSaveListType |
Public Member Functions | |
| virtual const char * | GetNameOfClass () const |
| void | LoadFromString (const std::string &rsData) |
| std::string | SaveToString () const |
| void | SaveToFile (const std::string &sFileName, const std::string &sXSLT="", const std::string &sEncoding="ISO-8859-1") const |
| void | LoadFromFile (const std::string &sFileName) |
| virtual void | Reset () |
| virtual const std::string | GetXMLTag () const |
| void | SetXMLTag (const std::string &sTag) |
| virtual XMLStreamObject & | operator= (const XMLStreamObject &rXMLStreamObject) |
| XMLStreamObject (const std::string &sXMLTag) | |
| XMLStreamObject (const XMLStreamObject &rXMLStreamObject) | |
| virtual | ~XMLStreamObject () |
Static Public Attributes | |
| static const std::string | cXML_Text = "" |
Protected Member Functions | |
| virtual void | SubElementLoadProcessing (const std::string &rsXMLSubTag, const std::string &rsXMLSubElement, const std::string &rsXMLSubData) |
| virtual void | AttributesLoadProcessing (const AttributesType &rAttributes) |
| virtual void | SaveAttributes (AttributesSaveListType &rAttributes) const |
| std::string | SaveToString (const unsigned int &iDepth) const |
| virtual std::string | SaveData (const unsigned int &iDepth, bool &bHasSubElements) const |
| virtual void | FinalizeLoading () const |
| virtual bool | CheckValidLoading () const |
| virtual void | SetNeededSubElements () |
| void | AddNeededSubElement (const std::string &sSubElementTag) |
Static Protected Member Functions | |
| static std::string | CreateSimpleElement (const std::string &sTag, const std::string &sValue) |
| static void | AddSubElement (std::string &sData, const std::string &sTag, const std::string &sValue, const unsigned int &iParentalDepth) |
| static void | AddSubElement (std::string &sData, const std::string &sTag, const std::string &sValue, const AttributesType &rAttributes, const unsigned int &iParentalDepth) |
| static void | AddSubElement (std::string &sData, const XMLStreamObject *pSubElement, const unsigned int &iParentalDepth) |
| static void | AddSubElement (std::string &sData, const std::string &sSubElement, const unsigned int &iParentalDepth) |
| static void | AddIndentation (std::string &sData, const unsigned int &iDepth) |
Private Member Functions | |
| void | CB_StartElement (const char *name, const char **pAttributes) |
| void | CB_EndElement (const char *name) |
| void | CB_CharacterDataHandler (const char *inData, int inLength) |
| void | ResetRequirements () |
| void | ResetLoadingHelpers () |
| std::string | ExtractSubElementXmlString () |
| std::string | ExtractSubElementContentString () |
| void | NotifyFoundSubElement (const std::string &sSubElementTag) |
| void | CommitSubElement () |
Static Private Member Functions | |
| static void | CB_Static_StartElement (void *parser, const char *name, const char **pAttributes) |
| static void | CB_Static_EndElement (void *parser, const char *name) |
| static void | CB_Static_CharacterDataHandler (void *parser, const char *data, int length) |
| static AttributesType | ConvertExpatAttrToMap (const char **pAttributes) |
| static std::string | ConvertAttributesToString (const AttributesSaveListType &rAttributes) |
Private Attributes | |
| STLStringVector | m_NeededSubElements |
| std::string | m_sActSubElementTag |
| AttributesType | m_ActSubElementAttributes |
| const std::string * | m_psLoadData |
| unsigned int | m_iActSubElementLevel |
| long | m_lElementStartPos |
| long | m_lElementStopPos |
| long | m_lContentStartPos |
| long | m_lContentStopPos |
| std::string | m_sXMLTag |
| XML_Parser | m_Parser |
XMLStreamObject is the base class for classes, which should have the ability to load their structure from or save it to a xml file. The class encapsulates the expat xml parser, included in the set of itk utilities, and offers an interface to load the xml file in an object oriented view. The concept of the class has been designed for the requirements in free, especially Setup, and has been motivated by the wish using present resources of itk and introduce as less as possible third-party libraries.
Definition at line 62 of file freXMLStreamObject.h.
| typedef std::pair<std::string,std::string> FREE::XMLStreamObject::AttributeType |
Definition at line 71 of file freXMLStreamObject.h.
| typedef std::map<std::string,std::string> FREE::XMLStreamObject::AttributesType |
Definition at line 72 of file freXMLStreamObject.h.
| typedef std::vector<AttributeType> FREE::XMLStreamObject::AttributesSaveListType |
Definition at line 74 of file freXMLStreamObject.h.
| FREE::XMLStreamObject::XMLStreamObject | ( | const std::string & | sXMLTag | ) |
Default constructor
Definition at line 250 of file freXMLStreamObject.cxx.
References m_sXMLTag, and ResetLoadingHelpers().

| FREE::XMLStreamObject::XMLStreamObject | ( | const XMLStreamObject & | rXMLStreamObject | ) |
Copy constructor
Definition at line 257 of file freXMLStreamObject.cxx.
References ResetLoadingHelpers().

| FREE::XMLStreamObject::~XMLStreamObject | ( | ) | [virtual] |
destructor
Definition at line 264 of file freXMLStreamObject.cxx.
References ResetLoadingHelpers().

| virtual const char* FREE::XMLStreamObject::GetNameOfClass | ( | ) | const [inline, virtual] |
Reimplemented in FREE::XMLCollectionBase< TXMLElement >, FREE::XMLKeyedCollectionBase< TKey, TXMLElement, TIdentifierClass >, FREE::Adaptation::Adaptation, FREE::Adaptation::AdaptationComponent, FREE::Adaptation::AdaptationList, FREE::ComponentMediaLink, FREE::ComponentSetup, FREE::ComponentSetupCollection, FREE::CtrlProfile::ControllerProfile, FREE::CtrlProfile::ControllerProfileBase, FREE::Parameter, FREE::ParameterLayer, FREE::CtrlProfile::Media, FREE::CtrlProfile::ProfileOption, FREE::CtrlProfile::Parameter, FREE::CtrlProfile::ProfileRequirement, FREE::CtrlProfile::SubComponent, FREE::CtrlProfile::ProfileSubComponents, FREE::Setup, FREE::SetupLoadingHelper, FREE::SetupSavingHelper, FREE::StatisticData, FREE::StatisticEntry, FREE::XMLCollectionBase< FREE::CtrlProfile::ProfileOption >, FREE::XMLCollectionBase< FREE::Adaptation::Adaptation >, FREE::XMLCollectionBase< FREE::CtrlProfile::ProfileRequirement >, FREE::XMLCollectionBase< FREE::Adaptation::AdaptationComponent >, FREE::XMLKeyedCollectionBase< std::string, FREE::CtrlProfile::Parameter, FREE::CtrlProfile::ProfileParameterIdentifier >, FREE::XMLKeyedCollectionBase< std::string, FREE::ComponentSetup, FREE::ComponentSetupIdentifier >, FREE::XMLKeyedCollectionBase< std::string, FREE::ComponentMediaLink, FREE::ComponentMediaLinkIdentifier >, FREE::XMLKeyedCollectionBase< std::string, FREE::CtrlProfile::SubComponent, FREE::CtrlProfile::ProfileSubCompIdentifier >, and FREE::XMLKeyedCollectionBase< std::string, FREE::CtrlProfile::Media, FREE::CtrlProfile::MediaIdentifierBase >.
Definition at line 65 of file freXMLStreamObject.h.
| void FREE::XMLStreamObject::LoadFromString | ( | const std::string & | rsData | ) |
Function to load a structure from a xml string. The function creates an expat parser, manages the callbacks, calls Reset() and ResetRequirements(). To control the loading process, the function SubElementLoadProcessing() should be overridden. When the loading is finished, it will be checked, if the requirements are meet, the expat resources will be freed.
| [in] | rsData | Reference to the whole data of the xml element (with start and end tag and attributes) |
Definition at line 72 of file freXMLStreamObject.cxx.
References CB_Static_EndElement(), CB_Static_StartElement(), CheckValidLoading(), FinalizeLoading(), m_Parser, m_psLoadData, Reset(), ResetLoadingHelpers(), ResetRequirements(), throwExceptionMacro, and FREE::Convert::ToStr().
Referenced by LoadFromFile(), FREE::XMLKeyedCollectionBase< TKey, TXMLElement, TIdentifierClass >::operator=(), FREE::XMLCollectionBase< TXMLElement >::operator=(), FREE::CtrlProfile::ProfileRequirements::operator=(), FREE::CtrlProfile::ProfileRequirement::operator=(), FREE::StatisticEntry::SubElementLoadProcessing(), FREE::StatisticDictionary::SubElementLoadProcessing(), FREE::Setup::SubElementLoadProcessing(), FREE::CtrlProfile::ProfileRequirements::SubElementLoadProcessing(), FREE::CtrlProfile::ProfileOption::SubElementLoadProcessing(), FREE::PointSetToXMLStreamObject< TPointSet >::SubElementLoadProcessing(), FREE::CtrlProfile::ControllerProfileBase::SubElementLoadProcessing(), FREE::CtrlProfile::ControllerProfile::SubElementLoadProcessing(), FREE::ComponentSetup::SubElementLoadProcessing(), and FREE::ComponentMediaLink::SubElementLoadProcessing().

| std::string FREE::XMLStreamObject::SaveToString | ( | ) | const |
Function that returns the whole structure/data of the object as a xml string. Function calls the overloaded version with a depth of 0.
Definition at line 103 of file freXMLStreamObject.cxx.
Referenced by AddSubElement(), FREE::XMLKeyedCollectionBase< TKey, TXMLElement, TIdentifierClass >::operator=(), FREE::XMLCollectionBase< TXMLElement >::operator=(), FREE::Setup::operator=(), FREE::CtrlProfile::ProfileRequirements::operator=(), FREE::CtrlProfile::ProfileRequirement::operator=(), and SaveToFile().
| void FREE::XMLStreamObject::SaveToFile | ( | const std::string & | sFileName, | |
| const std::string & | sXSLT = "", |
|||
| const std::string & | sEncoding = "ISO-8859-1" | |||
| ) | const |
Function saves the setup to the specified path/filename.
| [in] | sFileName | Name and path of the file, where the setup should be stored. |
| [in] | sXSLT | Path to an xslt file that should be specified as responsible for transformation. Pass empty string if no xslt should be specified for the xml file. |
| [in] | sEncoding | Specifies the encoding information that should be added to the xml file. |
Definition at line 110 of file freXMLStreamObject.cxx.
References catchAllNPassMacro, SaveToString(), and throwExceptionMacro.
Referenced by FREE::ParameterListIO::SaveListToFile(), and FREE::PointSetMediaControllerBase< PixelType, 2 >::SaveMedia().

| void FREE::XMLStreamObject::LoadFromFile | ( | const std::string & | sFileName | ) |
Function loads a setup from the specified path/filename.
| [in] | sFileName | Name and path of the file, where the setup should be stored. |
Definition at line 133 of file freXMLStreamObject.cxx.
References catchAllNPassMacro, LoadFromString(), and throwExceptionMacro.
Referenced by FREE::ParameterListIO::LoadListFromFile(), and FREE::PointSetMediaControllerBase< PixelType, 2 >::LoadMedia().

| void FREE::XMLStreamObject::Reset | ( | ) | [virtual] |
Resets the object to default/initial state
Reimplemented in FREE::XMLCollectionBase< TXMLElement >, FREE::XMLKeyedCollectionBase< TKey, TXMLElement, TIdentifierClass >, FREE::XMLStringMultiMap, FREE::XMLValueSet, FREE::Adaptation::Adaptation, FREE::Adaptation::AdaptationComponent, FREE::ComponentMediaLink, FREE::ComponentSetup, FREE::CtrlProfile::ControllerProfile, FREE::CtrlProfile::ControllerProfileBase, FREE::IDPath, FREE::Parameter, FREE::ParameterCollection, FREE::CtrlProfile::Media, FREE::CtrlProfile::ProfileOption, FREE::CtrlProfile::Parameter, FREE::CtrlProfile::ProfileRequirement, FREE::CtrlProfile::SubComponent, FREE::Setup, FREE::StatisticData, FREE::StatisticDictionary, FREE::StatisticEntry, FREE::StatisticEntryDefinition, FREE::Statistics, FREE::StatisticValue, FREE::StatisticValueDefinition, FREE::TimeStampedObject, FREE::XMLCollectionBase< FREE::CtrlProfile::ProfileOption >, FREE::XMLCollectionBase< FREE::Adaptation::Adaptation >, FREE::XMLCollectionBase< FREE::CtrlProfile::ProfileRequirement >, FREE::XMLCollectionBase< FREE::Adaptation::AdaptationComponent >, FREE::XMLKeyedCollectionBase< std::string, FREE::CtrlProfile::Parameter, FREE::CtrlProfile::ProfileParameterIdentifier >, FREE::XMLKeyedCollectionBase< std::string, FREE::ComponentSetup, FREE::ComponentSetupIdentifier >, FREE::XMLKeyedCollectionBase< std::string, FREE::ComponentMediaLink, FREE::ComponentMediaLinkIdentifier >, FREE::XMLKeyedCollectionBase< std::string, FREE::CtrlProfile::SubComponent, FREE::CtrlProfile::ProfileSubCompIdentifier >, and FREE::XMLKeyedCollectionBase< std::string, FREE::CtrlProfile::Media, FREE::CtrlProfile::MediaIdentifierBase >.
Definition at line 163 of file freXMLStreamObject.cxx.
Referenced by LoadFromString(), FREE::XMLValueSet::Reset(), FREE::XMLStringMultiMap::Reset(), FREE::XMLKeyedCollectionBase< TKey, TXMLElement, TIdentifierClass >::Reset(), FREE::XMLCollectionBase< TXMLElement >::Reset(), FREE::TimeStampedObject::Reset(), FREE::StatisticValueDefinition::Reset(), FREE::StatisticEntryDefinition::Reset(), FREE::Setup::Reset(), FREE::CtrlProfile::SubComponent::Reset(), FREE::CtrlProfile::Media::Reset(), FREE::ParameterCollection::Reset(), FREE::Parameter::Reset(), FREE::CtrlProfile::ControllerProfileBase::Reset(), FREE::ComponentSetup::Reset(), and FREE::ComponentMediaLink::Reset().
| const std::string FREE::XMLStreamObject::GetXMLTag | ( | ) | const [virtual] |
Returns the xml tag of the class
Definition at line 170 of file freXMLStreamObject.cxx.
References m_sXMLTag.
Referenced by AddSubElement(), CB_StartElement(), operator=(), and SaveToString().
| void FREE::XMLStreamObject::SetXMLTag | ( | const std::string & | sTag | ) | [inline] |
Sets the xml tag of the class
Definition at line 107 of file freXMLStreamObject.h.
References m_sXMLTag.
Referenced by FREE::Adaptation::AdaptationList::AdaptationList(), FREE::ComponentMediaLinks::ComponentMediaLinks(), FREE::ComponentSetupCollection::ComponentSetupCollection(), FREE::CtrlProfile::Parameter::Parameter(), FREE::ParameterLayer::ParameterLayer(), FREE::CtrlProfile::ProfileMediaMap::ProfileMediaMap(), FREE::CtrlProfile::ProfileOption::ProfileOption(), FREE::CtrlProfile::ProfileParameters::ProfileParameters(), FREE::CtrlProfile::ProfileRequirement::ProfileRequirement(), FREE::CtrlProfile::ProfileRequirements::ProfileRequirements(), FREE::CtrlProfile::ProfileSubComponents::ProfileSubComponents(), and FREE::PointSetToXMLStreamObject< TPointSet >::SubElementLoadProcessing().
| XMLStreamObject & FREE::XMLStreamObject::operator= | ( | const XMLStreamObject & | rXMLStreamObject | ) | [virtual] |
Assignment operator.
Definition at line 240 of file freXMLStreamObject.cxx.
References GetXMLTag(), and m_sXMLTag.

| void FREE::XMLStreamObject::SubElementLoadProcessing | ( | const std::string & | rsXMLSubTag, | |
| const std::string & | rsXMLSubElement, | |||
| const std::string & | rsXMLSubData | |||
| ) | [protected, virtual] |
Function is called by after the parser has extracted a new sub element out of the xml data string. The tag of the sub element is passed, along with its data and a string containing the total element (needed to call subsequent LoadFromString). To change the loading behaviour, this class should be reimplemented. This function is also called for plain text data of the element. In this case rsXMLTag is cXML_Text (an empty string), if not there is a real sub element in the data. Depending on the structure the text case (rsXMLTag==cXML_Text) could occure more then once.
Example:
<Element>aaaaaa<SubElement>bbbbbb</Subelement>cccccc</Element>\n
| [in] | rsXMLSubTag | Reference to the tag of xml to be loaded with the function call. |
| [in] | rsXMLSubElement | Reference to the whole element string (with attributes, start and end tag). |
| [in] | rsXMLSubData | Reference to the whole data of the xml element (without start and end tag) |
Reimplemented in FREE::XMLStringMultiMap, FREE::XMLValueSet, FREE::PointSetToXMLStreamObject< TPointSet >, FREE::Adaptation::Adaptation, FREE::Adaptation::AdaptationList, FREE::ComponentMediaLink, FREE::ComponentMediaLinks, FREE::ComponentSetup, FREE::ComponentSetupCollection, FREE::CtrlProfile::ControllerProfile, FREE::CtrlProfile::ControllerProfileBase, FREE::IDPath, FREE::Parameter, FREE::ParameterCollection, FREE::CtrlProfile::ProfileMediaMap, FREE::CtrlProfile::ProfileOption, FREE::CtrlProfile::ProfileParameters, FREE::CtrlProfile::ProfileRequirement, FREE::CtrlProfile::ProfileRequirements, FREE::CtrlProfile::SubComponent, FREE::CtrlProfile::ProfileSubComponents, FREE::Setup, FREE::SetupLoadingHelper, FREE::StatisticData, FREE::StatisticDictionary, FREE::StatisticEntry, FREE::StatisticEntryDefinition, FREE::Statistics, FREE::StatisticValue, and FREE::StatisticValueDefinition.
Definition at line 271 of file freXMLStreamObject.cxx.
References cXML_Text, and throwExceptionMacro.
Referenced by CommitSubElement(), FREE::StatisticEntry::SubElementLoadProcessing(), FREE::SetupLoadingHelper::SubElementLoadProcessing(), and FREE::ComponentMediaLinks::SubElementLoadProcessing().
| void FREE::XMLStreamObject::AttributesLoadProcessing | ( | const AttributesType & | rAttributes | ) | [protected, virtual] |
Function is called by LoadFromXMLString() to handle the Attributes contained by the xml string for this class.To change the loading behaviour of attributes, this function should be reimplemented. If the class has no xml attributes the function must not be reimplemented.
| [in] | rAttributes | Reference to a stl map with the attributes of the element. |
Definition at line 281 of file freXMLStreamObject.cxx.
Referenced by FREE::PointSetToXMLStreamObject< TPointSet >::AttributesLoadProcessing(), and CB_StartElement().
| void FREE::XMLStreamObject::SaveAttributes | ( | AttributesSaveListType & | rAttributes | ) | const [protected, virtual] |
This Function is called by SaveToString() to get the attributes of the class. The passed reference is an empty attribute map, which can be filled with the wanted parameters. This function should be reimplemented in derived classes to adapt saving behaviour. If the class has no xml attributes the function must not be reimplemented.
| [in,out] | rAttributes | Reference to the vector, where the attributes should be stored. |
Definition at line 289 of file freXMLStreamObject.cxx.
Referenced by FREE::PointSetToXMLStreamObject< TPointSet >::SaveAttributes(), and SaveToString().
| std::string FREE::XMLStreamObject::SaveToString | ( | const unsigned int & | iDepth | ) | const [protected] |
Function that returns the whole structure/data of the object as a xml string. Function calls the overloaded SaveAttributes() and SaveData() to compose the string. To control the saving process, these functions should be reimplemented.
| [in] | iDepth | The depth of the element within the structure tree. Used to realize correct indentation of the formated data. |
Definition at line 305 of file freXMLStreamObject.cxx.
References AddIndentation(), catchAllNPassMacro, ConvertAttributesToString(), GetXMLTag(), SaveAttributes(), and SaveData().

| std::string FREE::XMLStreamObject::SaveData | ( | const unsigned int & | iDepth, | |
| bool & | bHasSubElements | |||
| ) | const [protected, virtual] |
Function that returns the data of the object converted to a xml element. This function is called by SaveToString() to compose the whole xml string and should contain the data/value of the xml element couples.
| [in] | iDepth | The depth of the data within the xml structure tree. Used to realize correct indentation of the formated data by AddIndentation(). |
| [out] | bHasSubElements | Indicates whether the data string contains sub elements or just a plain value. By default bHasSubElements is true when the functon is called by SaveToString(). Reset the value to reset behavior of SaveToString. Example: <element attr1="1" attr2="a">aaaaaa<subElement>bbbbbb</subelement></element> For this xml string the function should return: "aaaaaa<subElement>bbbbbb</subElement>" |
Reimplemented in FREE::XMLCollectionBase< TXMLElement >, FREE::XMLKeyedCollectionBase< TKey, TXMLElement, TIdentifierClass >, FREE::XMLStringMultiMap, FREE::XMLValueSet, FREE::PointSetToXMLStreamObject< TPointSet >, FREE::Adaptation::Adaptation, FREE::Adaptation::AdaptationList, FREE::ComponentMediaLink, FREE::ComponentSetup, FREE::CtrlProfile::ControllerProfile, FREE::CtrlProfile::ControllerProfileBase, FREE::IDPath, FREE::Parameter, FREE::ParameterCollection, FREE::CtrlProfile::ProfileOption, FREE::CtrlProfile::SubComponent, FREE::Setup, FREE::SetupSavingHelper, FREE::StatisticData, FREE::StatisticDictionary, FREE::StatisticEntry, FREE::StatisticEntryDefinition, FREE::Statistics, FREE::StatisticValue, FREE::StatisticValueDefinition, FREE::XMLCollectionBase< FREE::CtrlProfile::ProfileOption >, FREE::XMLCollectionBase< FREE::Adaptation::Adaptation >, FREE::XMLCollectionBase< FREE::CtrlProfile::ProfileRequirement >, FREE::XMLCollectionBase< FREE::Adaptation::AdaptationComponent >, FREE::XMLKeyedCollectionBase< std::string, FREE::CtrlProfile::Parameter, FREE::CtrlProfile::ProfileParameterIdentifier >, FREE::XMLKeyedCollectionBase< std::string, FREE::ComponentSetup, FREE::ComponentSetupIdentifier >, FREE::XMLKeyedCollectionBase< std::string, FREE::ComponentMediaLink, FREE::ComponentMediaLinkIdentifier >, FREE::XMLKeyedCollectionBase< std::string, FREE::CtrlProfile::SubComponent, FREE::CtrlProfile::ProfileSubCompIdentifier >, and FREE::XMLKeyedCollectionBase< std::string, FREE::CtrlProfile::Media, FREE::CtrlProfile::MediaIdentifierBase >.
Definition at line 296 of file freXMLStreamObject.cxx.
Referenced by SaveToString().
| virtual void FREE::XMLStreamObject::FinalizeLoading | ( | ) | const [inline, protected, virtual] |
Function is called by LoadFromString() when the loading is finished, right before CheckValidLoading() is called. This member function can be used to realize operations which should be proceed after the loading process.
Definition at line 182 of file freXMLStreamObject.h.
Referenced by LoadFromString().
| bool FREE::XMLStreamObject::CheckValidLoading | ( | ) | const [protected, virtual] |
Function is called by LoadFromString() when the loading is finished, to check if all requirements are satisfied. This version checks, if needed elements were in the loading xml string with the m_NeededSubElements.
Definition at line 471 of file freXMLStreamObject.cxx.
References m_NeededSubElements, and throwExceptionMacro.
Referenced by LoadFromString().
| void FREE::XMLStreamObject::SetNeededSubElements | ( | ) | [protected, virtual] |
This function inserts all elements, which have to be present in a loading string, into m_NeededSubElements by AddNeededSubElement(). This Function is called by ResetRequirements() and should be reimplemented by Tasks to be adaptet to the requirements of the class.
Reimplemented in FREE::CtrlProfile::ControllerProfile, and FREE::Setup.
Definition at line 490 of file freXMLStreamObject.cxx.
Referenced by ResetRequirements().
| void FREE::XMLStreamObject::AddNeededSubElement | ( | const std::string & | sSubElementTag | ) | [protected] |
This function should be used in SetNeededSubElements() to add required elements to m_NeededSubElements.
| [in] | sSubElementTag | Tag of the needed sub element. |
Definition at line 499 of file freXMLStreamObject.cxx.
References m_NeededSubElements.
Referenced by FREE::Setup::SetNeededSubElements(), and FREE::CtrlProfile::ControllerProfile::SetNeededSubElements().
| std::string FREE::XMLStreamObject::CreateSimpleElement | ( | const std::string & | sTag, | |
| const std::string & | sValue | |||
| ) | [static, protected] |
Function creates a simple xml element with the passed tag and value.
| [in] | sTag | The tag of the element. |
| [in] | sValue | The value of the element |
Definition at line 382 of file freXMLStreamObject.cxx.
Referenced by AddSubElement().
| void FREE::XMLStreamObject::AddSubElement | ( | std::string & | sData, | |
| const std::string & | sTag, | |||
| const std::string & | sValue, | |||
| const unsigned int & | iParentalDepth | |||
| ) | [static, protected] |
Adds a simple xml element as sub element to the passed data string. The function calls CreatesimpleElement to compose the element and manages the right indentation by the given depth of the parent element.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| [in] | sData | The data string where the sub element will be added. |
| [in] | sTag | The tag of the element. |
| [in] | sValue | The value of the element |
| [in] | iParentalDepth | The depth of the parent element within the structure tree. Used to realize correct indentation of the formated data. |
Definition at line 390 of file freXMLStreamObject.cxx.
References AddIndentation(), catchAllNPassStaticMacro, CreateSimpleElement(), and FREE::Convert::ToStr().
Referenced by FREE::XMLValueSet::SaveData(), FREE::XMLStringMultiMap::SaveData(), FREE::XMLKeyedCollectionBase< TKey, TXMLElement, TIdentifierClass >::SaveData(), FREE::XMLCollectionBase< TXMLElement >::SaveData(), FREE::StatisticValueDefinition::SaveData(), FREE::Statistics::SaveData(), FREE::StatisticEntryDefinition::SaveData(), FREE::StatisticEntry::SaveData(), FREE::StatisticDictionary::SaveData(), FREE::StatisticData::SaveData(), FREE::SetupSavingHelper::SaveData(), FREE::Setup::SaveData(), FREE::CtrlProfile::SubComponent::SaveData(), FREE::CtrlProfile::ProfileOption::SaveData(), FREE::PointSetToXMLStreamObject< TPointSet >::SaveData(), FREE::ParameterCollection::SaveData(), FREE::Parameter::SaveData(), FREE::CtrlProfile::ControllerProfileBase::SaveData(), FREE::CtrlProfile::ControllerProfile::SaveData(), FREE::ComponentSetup::SaveData(), FREE::ComponentMediaLink::SaveData(), FREE::Adaptation::AdaptationList::SaveData(), and FREE::Adaptation::Adaptation::SaveData().

| void FREE::XMLStreamObject::AddSubElement | ( | std::string & | sData, | |
| const std::string & | sTag, | |||
| const std::string & | sValue, | |||
| const AttributesType & | rAttributes, | |||
| const unsigned int & | iParentalDepth | |||
| ) | [static, protected] |
Definition at line 403 of file freXMLStreamObject.cxx.
References AddIndentation(), catchAllNPassStaticMacro, and FREE::Convert::ToStr().

| void FREE::XMLStreamObject::AddSubElement | ( | std::string & | sData, | |
| const XMLStreamObject * | pSubElement, | |||
| const unsigned int & | iParentalDepth | |||
| ) | [static, protected] |
Adds a simple xml element as sub element to the passed data string. The function calls SaveToString of the passed element with the given depth and adds the string to sData.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| [in] | sData | The data string where the sub element will be added. |
| [in] | pSubElement | Pointer to the sub element to be added. |
| [in] | iParentalDepth | The depth of the parent element within the structure tree. Used to realize correct indentation of the formated data. |
Definition at line 421 of file freXMLStreamObject.cxx.
References catchAllNPassStaticMacro, GetStaticLocationMacro, GetXMLTag(), FREE::LogException(), SaveToString(), and FREE::Convert::ToStr().

| void FREE::XMLStreamObject::AddSubElement | ( | std::string & | sData, | |
| const std::string & | sSubElement, | |||
| const unsigned int & | iParentalDepth | |||
| ) | [static, protected] |
Adds a simple xml element represented by a string to the passed data string.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| [in] | sData | The data string where the sub element will be added. |
| [in] | sSubElement | Data string of to the sub element to be added. |
| [in] | iParentalDepth | The depth of the parent element within the structure tree. Used to realize correct indentation of the formated data. |
Definition at line 449 of file freXMLStreamObject.cxx.
References AddIndentation(), catchAllNPassStaticMacro, and FREE::Convert::ToStr().

| void FREE::XMLStreamObject::AddIndentation | ( | std::string & | sData, | |
| const unsigned int & | iDepth | |||
| ) | [static, protected] |
Adds an indentation add the beginning of the passed data string.
| [in] | sData | The data string to be indented. |
| [in] | iDepth | The depth of the parent element within the structure tree. Used to realize correct indentation of the formated data. |
Definition at line 462 of file freXMLStreamObject.cxx.
Referenced by AddSubElement(), and SaveToString().
| void FREE::XMLStreamObject::CB_Static_StartElement | ( | void * | parser, | |
| const char * | name, | |||
| const char ** | pAttributes | |||
| ) | [static, private] |
Implementation of FREE::XMLStreamObject ////////////////////////////
Definition at line 41 of file freXMLStreamObject.cxx.
References CB_StartElement().
Referenced by LoadFromString().

| void FREE::XMLStreamObject::CB_Static_EndElement | ( | void * | parser, | |
| const char * | name | |||
| ) | [static, private] |
Definition at line 52 of file freXMLStreamObject.cxx.
References CB_EndElement().
Referenced by LoadFromString().

| void FREE::XMLStreamObject::CB_Static_CharacterDataHandler | ( | void * | parser, | |
| const char * | data, | |||
| int | length | |||
| ) | [static, private] |
Definition at line 61 of file freXMLStreamObject.cxx.
References CB_CharacterDataHandler().
Referenced by CB_EndElement(), and CB_StartElement().

| void FREE::XMLStreamObject::CB_StartElement | ( | const char * | name, | |
| const char ** | pAttributes | |||
| ) | [private] |
Callback function -- called from XML parser when starting tag encountered
Definition at line 175 of file freXMLStreamObject.cxx.
References AttributesLoadProcessing(), CB_Static_CharacterDataHandler(), CommitSubElement(), ConvertExpatAttrToMap(), GetXMLTag(), m_ActSubElementAttributes, m_iActSubElementLevel, m_lContentStartPos, m_lContentStopPos, m_lElementStartPos, m_lElementStopPos, m_Parser, m_sActSubElementTag, and throwExceptionMacro.
Referenced by CB_Static_StartElement().

| void FREE::XMLStreamObject::CB_EndElement | ( | const char * | name | ) | [private] |
Callback function -- called from XML parser when ending tag encountered
Definition at line 208 of file freXMLStreamObject.cxx.
References CB_Static_CharacterDataHandler(), CommitSubElement(), m_iActSubElementLevel, m_lContentStopPos, and m_Parser.
Referenced by CB_Static_EndElement().

| void FREE::XMLStreamObject::CB_CharacterDataHandler | ( | const char * | inData, | |
| int | inLength | |||
| ) | [private] |
Callback function -- called from XML parser with the character data for a XML element
Definition at line 227 of file freXMLStreamObject.cxx.
References CommitSubElement(), m_lContentStartPos, m_lContentStopPos, m_lElementStopPos, and m_Parser.
Referenced by CB_Static_CharacterDataHandler().

| void FREE::XMLStreamObject::ResetRequirements | ( | ) | [private] |
This function clears the m_NeededSubElements and calls SetNeededSubElements() afterwards.
Definition at line 522 of file freXMLStreamObject.cxx.
References m_NeededSubElements, and SetNeededSubElements().
Referenced by LoadFromString().

| void FREE::XMLStreamObject::ResetLoadingHelpers | ( | ) | [private] |
This function resets all members used as helpers in the loading process.
Definition at line 530 of file freXMLStreamObject.cxx.
References m_ActSubElementAttributes, m_iActSubElementLevel, m_lContentStartPos, m_lContentStopPos, m_lElementStartPos, m_lElementStopPos, m_psLoadData, and m_sActSubElementTag.
Referenced by LoadFromString(), XMLStreamObject(), and ~XMLStreamObject().
| XMLStreamObject::AttributesType FREE::XMLStreamObject::ConvertExpatAttrToMap | ( | const char ** | pAttributes | ) | [static, private] |
Converts the attribute structure passed by expat to a stl string map.
Definition at line 544 of file freXMLStreamObject.cxx.
Referenced by CB_StartElement().
| std::string FREE::XMLStreamObject::ConvertAttributesToString | ( | const AttributesSaveListType & | rAttributes | ) | [static, private] |
Converts the attributes map to a xml string.
Definition at line 603 of file freXMLStreamObject.cxx.
References throwStaticExceptionMacro.
Referenced by SaveToString().
| std::string FREE::XMLStreamObject::ExtractSubElementXmlString | ( | ) | [private] |
Extracts the string of a sub element from m_sLoadData by using m_lElementStartPos and m_lElementStopPos to determine index and length. If the m_lElementStartPos<=-1 or m_lElementStartPos>m_lElementStopPos then the return is "".
Definition at line 564 of file freXMLStreamObject.cxx.
References m_lElementStartPos, m_lElementStopPos, and m_psLoadData.
Referenced by CommitSubElement().
| std::string FREE::XMLStreamObject::ExtractSubElementContentString | ( | ) | [private] |
Extracts the string of a sub element from m_sLoadData by using m_lContentStartPos and m_lContentStopPos to determine index and length. If the m_lContentStartPos<=-1 or m_lContentStartPos>m_lContentStopPos then the return is "".
Definition at line 575 of file freXMLStreamObject.cxx.
References m_lContentStartPos, m_lContentStopPos, and m_psLoadData.
Referenced by CommitSubElement().
| void FREE::XMLStreamObject::NotifyFoundSubElement | ( | const std::string & | sSubElementTag | ) | [private] |
This function is used to remove an element tag from the needed sub element list, when it was found and loaded. The function is called be CommitSubElement()
| [in] | sSubElementTag | Tag of the found sub element. |
Definition at line 506 of file freXMLStreamObject.cxx.
References m_NeededSubElements.
Referenced by CommitSubElement().
| void FREE::XMLStreamObject::CommitSubElement | ( | ) | [private] |
This function is used within the parser event callbacks, when a sub element is about to be avaible for further loading processing.
Definition at line 586 of file freXMLStreamObject.cxx.
References cXML_Text, ExtractSubElementContentString(), ExtractSubElementXmlString(), m_lContentStartPos, m_lContentStopPos, m_lElementStopPos, m_Parser, m_sActSubElementTag, NotifyFoundSubElement(), and SubElementLoadProcessing().
Referenced by CB_CharacterDataHandler(), CB_EndElement(), and CB_StartElement().

const std::string FREE::XMLStreamObject::cXML_Text = "" [static] |
Used for LoadSubElement() calls if sub element is plain text of the xml element
Definition at line 66 of file freXMLStreamObject.h.
Referenced by CommitSubElement(), FREE::XMLStringMultiMap::SaveData(), FREE::XMLValueSet::SubElementLoadProcessing(), FREE::XMLStringMultiMap::SubElementLoadProcessing(), SubElementLoadProcessing(), FREE::CtrlProfile::ProfileSubComponents::SubElementLoadProcessing(), FREE::CtrlProfile::ProfileRequirements::SubElementLoadProcessing(), FREE::CtrlProfile::ProfileRequirement::SubElementLoadProcessing(), FREE::CtrlProfile::ProfileParameters::SubElementLoadProcessing(), FREE::CtrlProfile::ProfileMediaMap::SubElementLoadProcessing(), FREE::ParameterCollection::SubElementLoadProcessing(), FREE::Parameter::SubElementLoadProcessing(), FREE::ComponentSetupCollection::SubElementLoadProcessing(), and FREE::ComponentSetup::SubElementLoadProcessing().
List of sub element tags, which should be in the xml loading string. This String is Set by SetNeededSubElements().
Definition at line 299 of file freXMLStreamObject.h.
Referenced by AddNeededSubElement(), CheckValidLoading(), NotifyFoundSubElement(), and ResetRequirements().
std::string FREE::XMLStreamObject::m_sActSubElementTag [private] |
Tag name of the current handled sub element
Definition at line 302 of file freXMLStreamObject.h.
Referenced by CB_StartElement(), CommitSubElement(), and ResetLoadingHelpers().
Pointer to the Attributes of the current sub element. Is null if there are no actual Attributes or element.
Definition at line 306 of file freXMLStreamObject.h.
Referenced by CB_StartElement(), and ResetLoadingHelpers().
const std::string* FREE::XMLStreamObject::m_psLoadData [private] |
pointer to the data string passed with LoadFromXMLString
Definition at line 309 of file freXMLStreamObject.h.
Referenced by ExtractSubElementContentString(), ExtractSubElementXmlString(), LoadFromString(), and ResetLoadingHelpers().
unsigned int FREE::XMLStreamObject::m_iActSubElementLevel [private] |
Help variable indicating the differece between StartElement callbacks (++) and StopElement callbacks (--). Allows the handling of cascading element tags.
Definition at line 313 of file freXMLStreamObject.h.
Referenced by CB_EndElement(), CB_StartElement(), and ResetLoadingHelpers().
long FREE::XMLStreamObject::m_lElementStartPos [private] |
Position of the element beginning within m_pLoadData. Used in the loading process to extract the sub elements.
Definition at line 317 of file freXMLStreamObject.h.
Referenced by CB_StartElement(), ExtractSubElementXmlString(), and ResetLoadingHelpers().
long FREE::XMLStreamObject::m_lElementStopPos [private] |
Position of the first character not belonging to the sub element within m_pLoadData. Used in the loading process to extract the sub elements.
Definition at line 320 of file freXMLStreamObject.h.
Referenced by CB_CharacterDataHandler(), CB_StartElement(), CommitSubElement(), ExtractSubElementXmlString(), and ResetLoadingHelpers().
long FREE::XMLStreamObject::m_lContentStartPos [private] |
Position of the content of the current sub element within m_pLoadData. Used in the loading process to extract the element content of sub elements.
Definition at line 323 of file freXMLStreamObject.h.
Referenced by CB_CharacterDataHandler(), CB_StartElement(), CommitSubElement(), ExtractSubElementContentString(), and ResetLoadingHelpers().
long FREE::XMLStreamObject::m_lContentStopPos [private] |
Position of the first charcter not belonging to the content of a sub element. Used in the loading process to extract contents of sub elements.
Definition at line 326 of file freXMLStreamObject.h.
Referenced by CB_CharacterDataHandler(), CB_EndElement(), CB_StartElement(), CommitSubElement(), ExtractSubElementContentString(), and ResetLoadingHelpers().
std::string FREE::XMLStreamObject::m_sXMLTag [private] |
The XML tag of this object
Definition at line 329 of file freXMLStreamObject.h.
Referenced by GetXMLTag(), operator=(), SetXMLTag(), and XMLStreamObject().
XML_Parser FREE::XMLStreamObject::m_Parser [private] |
Pointer to the expat parser
Definition at line 332 of file freXMLStreamObject.h.
Referenced by CB_CharacterDataHandler(), CB_EndElement(), CB_StartElement(), CommitSubElement(), and LoadFromString().
1.5.3 written by Dimitri van Heesch,
© 1997-2000