freXMLStringMultiMap.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   F.R.E.E. - flexible registration evaluation engine
00004   Version:   v.1.0.0
00005   Date:      $Date: 2006/09/01 12:00:00 $
00006   Module:    $RCSfile: freXMLStringMultiMap.h,v $
00007   Language:  C++
00008 
00009 
00010 
00011   Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics,
00012   Institute for Medical Biometry and Informatics, University of Heidelberg,
00013   Germany). All rights reserved.
00014   See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm
00015   for details.
00016 
00017      This software is distributed WITHOUT ANY WARRANTY; without even 
00018      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00019      PURPOSE.  See the above copyright notices for more information.
00020 
00021 =========================================================================*/
00022 #ifndef __freXMLStringMultiMap_h
00023 #define __freXMLStringMultiMap_h
00024 
00025 //This is to avoid the warnings produced by itk/stl and ease the search for errors
00026 //in the creation report
00027 #pragma warning( disable : 4786)
00028 
00029 #include "freXMLStreamObject.h"
00030 
00031 namespace FREE
00032 {
00033 
00044  class XMLStringMultiMap : public XMLStreamObject
00045 {
00046 public:
00047   typedef unsigned int ElementIndexType;
00048   
00050   ElementIndexType Size() const;
00055   ElementIndexType AddElement(const std::string& sXMLTag, const std::string& sData);
00059   void DeleteElement(const ElementIndexType& index);
00066   ElementIndexType GetElementData(const std::string& sXMLTag, std::string& sData) const;
00078   ElementIndexType GetElementData(const std::string& sXMLTag, std::string& sData, ElementIndexType& nextIndex) const;
00084   bool GetElementData(const ElementIndexType& index, std::string& sData) const;
00090   bool GetElementTag(const ElementIndexType& index, std::string& sXMLTag) const;
00094   void SetElementData(const ElementIndexType& index, const std::string& sData);
00095 
00097   virtual void Reset();
00098 
00100   virtual XMLStringMultiMap& operator = (const XMLStringMultiMap& rXMLStringMultiMap);
00101 
00103   XMLStringMultiMap(const std::string sXMLTag);
00104 
00106   XMLStringMultiMap(const XMLStringMultiMap& rXMLStringMultiMap);
00107 
00109   virtual ~XMLStringMultiMap();
00110 
00111 protected:
00113   virtual void SubElementLoadProcessing(const std::string& rsXMLSubTag, const std::string& rsXMLSubElement, const std::string& rsXMLSubData);
00114 
00116   virtual std::string SaveData(const unsigned int& iDepth, bool& bHasSubElements) const;
00117 
00118 private:
00119         STLStringVector m_Keys;
00120   STLStringVector m_Datas;
00121 };
00122 
00123 static std::string XMLCreateSimpleElement(const std::string& sTag, const std::string& sValue)
00124 {
00125   std::string sResult = "<"+sTag+">"+sValue+"</"+sTag+">";
00126   return sResult;
00127 };
00128 
00129 }//end of namespace FREE
00130 
00131 #endif

Generated at Sat Oct 13 18:14:02 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000