コード例 #1
0
 /// <summary>
 /// Walk the XML tree visiting this node and all of its children.
 /// </summary>
 public override bool Accept(TiXmlVisitor visitor)
 {
     if (visitor.VisitEnter(this))
     {
         for (TiXmlNode node = FirstChild(); node != null; node = node.NextSibling())
         {
             if (!node.Accept(visitor))
             {
                 break;
             }
         }
     }
     return(visitor.VisitExit(this));
 }
コード例 #2
0
 /// <summary>
 /// Accept a hierchical visit the nodes in the TinyXML DOM. Every node in the
 /// XML tree will be conditionally visited and the host will be called back
 /// via the TiXmlVisitor interface.
 ///
 /// This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse
 /// the XML for the callbacks, so the performance of TinyXML is unchanged by using this
 /// interface versus any other.)
 ///
 /// The interface has been based on ideas from:
 ///
 /// - http://www.saxproject.org/
 /// - http://c2.com/cgi/wiki?HierarchicalVisitorPattern
 ///
 /// Which are both good references for "visiting".
 /// s
 /// An example of using Accept():
 /// @verbatim
 /// TiXmlPrinter printer;
 /// tinyxmlDoc.Accept( &printer );
 /// const char* xmlcstr = printer.CStr();
 /// @endverbatim
 /// </summary>
 public abstract bool Accept(TiXmlVisitor visitor);
コード例 #3
0
 /// <summary>
 /// Walk the XML tree visiting this node and all of its children.
 /// </summary>
 public override bool Accept(TiXmlVisitor visitor)
 {
     return(visitor.Visit(this));
 }