Changeset 25:f4719d28635c in rrlib_xml


Ignore:
Timestamp:
21.01.2011 18:12:06 (9 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
default
Phase:
public
Convert:
svn:3219ad6e-c0b7-4ac2-9554-e22e195eef7a/trunk@26
Message:
  • Fixed tXMLNode::operator = for case of self assignment
  • Moved method that return local static variables to cpp-file
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tXMLDocument.cpp

    r24 r25  
    105105} 
    106106 
    107 tXMLDocument& tXMLDocument::operator=(const tXMLDocument & other) 
     107//---------------------------------------------------------------------- 
     108// tXMLDocument operator = 
     109//---------------------------------------------------------------------- 
     110tXMLDocument &tXMLDocument::operator = (const tXMLDocument & other) 
    108111{ 
     112  if (this == &other) 
     113  { 
     114    return *this; 
     115  } 
    109116  xmlFreeDoc(this->document); 
    110117  this->document = xmlCopyDoc(other.document, true); 
  • tXMLNode.cpp

    r18 r25  
    7070 
    7171//---------------------------------------------------------------------- 
    72 // tXMLNode GetName 
    73 //---------------------------------------------------------------------- 
    74 const std::string tXMLNode::GetName() const 
    75 { 
    76   return reinterpret_cast<const char *>(this->name); 
    77 } 
    78  
    79 //---------------------------------------------------------------------- 
    8072// tXMLNode IsInSubtreeOf 
    8173//---------------------------------------------------------------------- 
     
    9587 
    9688//---------------------------------------------------------------------- 
     89// tXMLNode GetName 
     90//---------------------------------------------------------------------- 
     91const std::string tXMLNode::GetName() const 
     92{ 
     93  return reinterpret_cast<const char *>(this->name); 
     94} 
     95 
     96//---------------------------------------------------------------------- 
     97// tXMLNode GetChildrenEnd 
     98//---------------------------------------------------------------------- 
     99const tXMLNode::iterator &tXMLNode::GetChildrenEnd() 
     100{ 
     101  static iterator end; 
     102  return end; 
     103} 
     104 
     105const tXMLNode::const_iterator &tXMLNode::GetChildrenEnd() const 
     106{ 
     107  static const_iterator end; 
     108  return end; 
     109} 
     110 
     111//---------------------------------------------------------------------- 
    97112// tXMLNode GetFirstChild 
    98113//---------------------------------------------------------------------- 
     
    145160  } 
    146161  it->FreeNode(); 
     162} 
     163 
     164//---------------------------------------------------------------------- 
     165// tXMLNode GetNextSiblingsEnd 
     166//---------------------------------------------------------------------- 
     167const tXMLNode::iterator &tXMLNode::GetNextSiblingsEnd() 
     168{ 
     169  static iterator end; 
     170  return end; 
     171} 
     172 
     173const tXMLNode::const_iterator &tXMLNode::GetNextSiblingsEnd() const 
     174{ 
     175  static const_iterator end; 
     176  return end; 
    147177} 
    148178 
  • tXMLNode.h

    r23 r25  
    327327   * \returns An end-iterator 
    328328   */ 
    329   inline const iterator &GetChildrenEnd() 
    330   { 
    331     static iterator end; 
    332     return end; 
    333   } 
     329  const iterator &GetChildrenEnd(); 
    334330 
    335331  /*! Get a const_iterator to mark the end of children traversal 
     
    337333   * \returns An end-const_iterator 
    338334   */ 
    339   inline const const_iterator &GetChildrenEnd() const 
    340   { 
    341     static const_iterator end; 
    342     return end; 
    343   } 
     335  const const_iterator &GetChildrenEnd() const; 
    344336 
    345337  /*! Check if this node has children of type XML_ELEMENT_NODE 
     
    437429   * \returns A begin-iterator 
    438430   */ 
    439   const iterator GetNextSiblingsBegin() 
     431  inline const iterator GetNextSiblingsBegin() 
    440432  { 
    441433    return iterator(reinterpret_cast<tXMLNode *>(this->next)); 
     
    446438   * \returns A begin-const_iterator 
    447439   */ 
    448   const const_iterator GetNextSiblingsBegin() const 
     440  inline const const_iterator GetNextSiblingsBegin() const 
    449441  { 
    450442    return const_iterator(reinterpret_cast<tXMLNode *>(this->next)); 
     
    455447   * \returns An end-iterator 
    456448   */ 
    457   const iterator &GetNextSiblingsEnd() 
    458   { 
    459     static iterator end; 
    460     return end; 
    461   } 
     449  const iterator &GetNextSiblingsEnd(); 
    462450 
    463451  /*! Get a const_iterator to mark the end of sibling traversal 
     
    465453   * \returns An end-const_iterator 
    466454   */ 
    467   const const_iterator &GetNextSiblingsEnd() const 
    468   { 
    469     static const_iterator end; 
    470     return end; 
    471   } 
     455  const const_iterator &GetNextSiblingsEnd() const; 
    472456 
    473457  /*! Check if siblings of type XML_ELEMENT_NODE are reachable via \c GetNextSibling from this node 
Note: See TracChangeset for help on using the changeset viewer.