Panda3D
Public Member Functions | List of all members
TiXmlVisitor Class Reference

Implements the interface to the "Visitor pattern" (see the Accept() method.) If you call the Accept() method, it requires being passed a TiXmlVisitor class to handle callbacks. More...

Inheritance diagram for TiXmlVisitor:
TiXmlPrinter

Public Member Functions

 __init__ ()
 
 __init__ (const TiXmlVisitor)
 
bool Visit (const TiXmlComment)
 
bool Visit (const TiXmlDeclaration)
 
bool Visit (const TiXmlText)
 
bool Visit (const TiXmlUnknown)
 
bool VisitEnter (const TiXmlDocument)
 
bool VisitEnter (const TiXmlElement, const TiXmlAttribute)
 
bool VisitExit (const TiXmlDocument)
 
bool VisitExit (const TiXmlElement)
 

Detailed Description

Implements the interface to the "Visitor pattern" (see the Accept() method.) If you call the Accept() method, it requires being passed a TiXmlVisitor class to handle callbacks.

For nodes that contain other nodes (Document, Element) you will get called with a VisitEnter/VisitExit pair. Nodes that are always leaves are simply called with Visit().

If you return 'true' from a Visit method, recursive parsing will continue. If you return false, <b>no children of this node or its sibilings</b> will be Visited.

All flavors of Visit methods have a default implementation that returns 'true' (continue visiting). You need to only override methods that are interesting to you.

Generally Accept() is called on the TiXmlDocument, although all nodes suppert Visiting.

You should never change the document from a callback.

See also
TiXmlNode::Accept()

Member Function Documentation

◆ __init__() [1/2]

__init__ ( )

◆ __init__() [2/2]

__init__ ( const  TiXmlVisitor)

◆ Visit() [1/4]

bool Visit ( const  TiXmlComment)

◆ Visit() [2/4]

bool Visit ( const  TiXmlDeclaration)

◆ Visit() [3/4]

bool Visit ( const  TiXmlText)

◆ Visit() [4/4]

bool Visit ( const  TiXmlUnknown)

◆ VisitEnter() [1/2]

bool VisitEnter ( const  TiXmlDocument)

◆ VisitEnter() [2/2]

bool VisitEnter ( const  TiXmlElement,
const  TiXmlAttribute 
)

◆ VisitExit() [1/2]

bool VisitExit ( const  TiXmlDocument)

◆ VisitExit() [2/2]

bool VisitExit ( const  TiXmlElement)