FREE::XMLStringMultiMap Class Reference
[XML streaming]

Class parses a whole xml element and stores his data in a string vector. More...

#include <freXMLStringMultiMap.h>

Inheritance diagram for FREE::XMLStringMultiMap:

Inheritance graph
FREE::CtrlProfile::ProfileInheritanceFREE::XMLStreamObject
[legend]
Collaboration diagram for FREE::XMLStringMultiMap:

Collaboration graph
FREE::XMLStreamObject
[legend]

List of all members.

Public Types

typedef unsigned int ElementIndexType

Public Member Functions

ElementIndexType Size () const
ElementIndexType AddElement (const std::string &sXMLTag, const std::string &sData)
void DeleteElement (const ElementIndexType &index)
ElementIndexType GetElementData (const std::string &sXMLTag, std::string &sData) const
ElementIndexType GetElementData (const std::string &sXMLTag, std::string &sData, ElementIndexType &nextIndex) const
bool GetElementData (const ElementIndexType &index, std::string &sData) const
bool GetElementTag (const ElementIndexType &index, std::string &sXMLTag) const
void SetElementData (const ElementIndexType &index, const std::string &sData)
virtual void Reset ()
virtual
XMLStringMultiMap
operator= (const XMLStringMultiMap &rXMLStringMultiMap)
 XMLStringMultiMap (const std::string sXMLTag)
 XMLStringMultiMap (const XMLStringMultiMap &rXMLStringMultiMap)
virtual ~XMLStringMultiMap ()

Protected Member Functions

virtual void SubElementLoadProcessing (const std::string &rsXMLSubTag, const std::string &rsXMLSubElement, const std::string &rsXMLSubData)
virtual std::string SaveData (const unsigned int &iDepth, bool &bHasSubElements) const

Private Attributes

STLStringVector m_Keys
STLStringVector m_Datas


Detailed Description

Class parses a whole xml element and stores his data in a string vector.

XMLStringMultiMap parses the data of a xml element a stores the sub elements with their values keyed by their tag. Like in a std::mulitmap the keyes have not to be unique. The sequence of the vector elements is the order of occurance within the xml element Attributes of xml sub elements will be ignored and not stored, also plain text parts will be skipped.

Definition at line 44 of file freXMLStringMultiMap.h.


Member Typedef Documentation

typedef unsigned int FREE::XMLStringMultiMap::ElementIndexType

Reimplemented in FREE::CtrlProfile::ProfileInheritance.

Definition at line 47 of file freXMLStringMultiMap.h.


Constructor & Destructor Documentation

FREE::XMLStringMultiMap::XMLStringMultiMap ( const std::string  sXMLTag  ) 

Default constructor

Definition at line 144 of file freXMLStringMultiMap.cxx.

FREE::XMLStringMultiMap::XMLStringMultiMap ( const XMLStringMultiMap rXMLStringMultiMap  ) 

Copy constructor

Definition at line 149 of file freXMLStringMultiMap.cxx.

FREE::XMLStringMultiMap::~XMLStringMultiMap (  )  [virtual]

destructor

Definition at line 155 of file freXMLStringMultiMap.cxx.

References Reset().

Here is the call graph for this function:

FREE::XMLStringMultiMap::ResetFREE::XMLStreamObject::Reset


Member Function Documentation

XMLStringMultiMap::ElementIndexType FREE::XMLStringMultiMap::Size (  )  const

Size of the vector

Implementation of FREE::XMLStringMultiMap ////////////////////////////

Definition at line 35 of file freXMLStringMultiMap.cxx.

References m_Keys.

Referenced by FREE::CtrlProfile::ProfileInheritance::GetParent(), FREE::CtrlProfile::ProfileInheritance::IndexOfAncestor(), operator=(), and FREE::CtrlProfile::ProfileOption::ProfileMatchesOption().

XMLStringMultiMap::ElementIndexType FREE::XMLStringMultiMap::AddElement ( const std::string &  sXMLTag,
const std::string &  sData 
)

Adds an element with tag and data to the vector.

Parameters:
[in] sXMLTag The xml tag of the sub element
[in] sData The data of the added sub element
Returns:
The index of the added sub element within the vector.

Definition at line 42 of file freXMLStringMultiMap.cxx.

References m_Datas, and m_Keys.

Referenced by FREE::CtrlProfile::ProfileInheritance::AddAncestor(), operator=(), and SubElementLoadProcessing().

void FREE::XMLStringMultiMap::DeleteElement ( const ElementIndexType index  ) 

Deletes a sub element within the vector, specified by the index.

Parameters:
[in] index The indexs of the sub element within the vector. If index is out of range, no element will be deleted.

Definition at line 94 of file freXMLStringMultiMap.cxx.

References m_Datas, and m_Keys.

XMLStringMultiMap::ElementIndexType FREE::XMLStringMultiMap::GetElementData ( const std::string &  sXMLTag,
std::string &  sData 
) const

Retrieves the data of a sub element, specified by the tag.

Remarks:
If the tag encounters multiple times the first occurance will be used.
Parameters:
[in] sXMLTag The xml tag of the wanted sub element
[out] sData The data of the specified sub element
Returns:
Returns the index of the found element within the vector. If the return is ==-1, no element was found and sData is invalid.

Definition at line 51 of file freXMLStringMultiMap.cxx.

Referenced by FREE::CtrlProfile::ProfileInheritance::GetAncestor(), FREE::CtrlProfile::ProfileInheritance::GetParent(), FREE::CtrlProfile::ProfileInheritance::IndexOfAncestor(), and operator=().

XMLStringMultiMap::ElementIndexType FREE::XMLStringMultiMap::GetElementData ( const std::string &  sXMLTag,
std::string &  sData,
ElementIndexType nextIndex 
) const

Retrieves the data of a sub element, specified by the tag. With the help of nextIndex multiple occurance of one tag can be found within the vector. When calling the function, nextIndex specifies the starting point of the tag search within the vector. After the return of the function it contains the index+1 of the finding. Or is -1 if there was no finding, so when the return is false.

Remarks:
If the tag encounters multiple times the first occurance will be used.
Parameters:
[in] sXMLTag The xml tag of the wanted sub element
[out] sData The data of the specified sub element
[out] nextIndex Specifies the current position for the search within the vector.
Returns:
Returns the index of the found element within the vector. If the return is ==-1, no element was found and sData is invalid.

Definition at line 59 of file freXMLStringMultiMap.cxx.

References m_Datas, and m_Keys.

bool FREE::XMLStringMultiMap::GetElementData ( const ElementIndexType index,
std::string &  sData 
) const

Retrieves the data of a sub element, specified by the index within the vector.

Parameters:
[in] index The indexs of the sub element within the vector. If index is out of range, the return is false.
[out] sData The data of the specified sub element
Returns:
Returns true if a sub element with the passed tag was found and so sData is valid.

Definition at line 75 of file freXMLStringMultiMap.cxx.

References m_Datas.

bool FREE::XMLStringMultiMap::GetElementTag ( const ElementIndexType index,
std::string &  sXMLTag 
) const

Retrieves the tag of a sub element, specified by the index within the vector.

Parameters:
[in] index The indexs of the sub element within the vector. If index is out of range, the return is false.
[out] sXMLTag The tag of the specified sub element
Returns:
Returns true if a sub element with the passed tag was found and so sData is valid.

Definition at line 104 of file freXMLStringMultiMap.cxx.

References m_Keys.

Referenced by operator=().

void FREE::XMLStringMultiMap::SetElementData ( const ElementIndexType index,
const std::string &  sData 
)

Sets the data of a sub element within the vector, specified by the index.

Parameters:
[in] index The indexs of the sub element within the vector.
[in] sData The new data to be set.

Definition at line 85 of file freXMLStringMultiMap.cxx.

References m_Datas.

Referenced by FREE::CtrlProfile::ProfileInheritance::AddAncestor().

void FREE::XMLStringMultiMap::Reset (  )  [virtual]

Resets the object to default/initial state

Reimplemented from FREE::XMLStreamObject.

Definition at line 114 of file freXMLStringMultiMap.cxx.

References m_Datas, m_Keys, and FREE::XMLStreamObject::Reset().

Referenced by operator=(), FREE::CtrlProfile::ControllerProfileBase::Reset(), and ~XMLStringMultiMap().

Here is the call graph for this function:

FREE::XMLStreamObject::Reset

XMLStringMultiMap & FREE::XMLStringMultiMap::operator= ( const XMLStringMultiMap rXMLStringMultiMap  )  [virtual]

Assignment operator.

Definition at line 123 of file freXMLStringMultiMap.cxx.

References AddElement(), GetElementData(), GetElementTag(), Reset(), and Size().

Referenced by FREE::CtrlProfile::ProfileInheritance::operator=().

Here is the call graph for this function:

FREE::XMLStringMultiMap::AddElementFREE::XMLStringMultiMap::GetElementDataFREE::XMLStringMultiMap::GetElementTagFREE::XMLStringMultiMap::ResetFREE::XMLStringMultiMap::SizeFREE::XMLStreamObject::Reset

void FREE::XMLStringMultiMap::SubElementLoadProcessing ( const std::string &  rsXMLSubTag,
const std::string &  rsXMLSubElement,
const std::string &  rsXMLSubData 
) [protected, virtual]

Reimplementation

Reimplemented from FREE::XMLStreamObject.

Definition at line 162 of file freXMLStringMultiMap.cxx.

References AddElement(), and FREE::XMLStreamObject::cXML_Text.

Here is the call graph for this function:

FREE::XMLStringMultiMap::AddElement

std::string FREE::XMLStringMultiMap::SaveData ( const unsigned int &  iDepth,
bool &  bHasSubElements 
) const [protected, virtual]

Reimplementation

Reimplemented from FREE::XMLStreamObject.

Definition at line 169 of file freXMLStringMultiMap.cxx.

References FREE::XMLStreamObject::AddSubElement(), FREE::XMLStreamObject::cXML_Text, m_Datas, and m_Keys.

Here is the call graph for this function:

FREE::XMLStreamObject::AddSubElementFREE::XMLStreamObject::AddIndentationFREE::XMLStreamObject::CreateSimpleElementFREE::Convert::ToStr


Member Data Documentation

STLStringVector FREE::XMLStringMultiMap::m_Keys [private]

Definition at line 119 of file freXMLStringMultiMap.h.

Referenced by AddElement(), DeleteElement(), GetElementData(), GetElementTag(), Reset(), SaveData(), and Size().

STLStringVector FREE::XMLStringMultiMap::m_Datas [private]

Definition at line 120 of file freXMLStringMultiMap.h.

Referenced by AddElement(), DeleteElement(), GetElementData(), Reset(), SaveData(), and SetElementData().


The documentation for this class was generated from the following files:
Generated at Sat Oct 13 18:17:29 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000