Actin  Version 5.5.5
Software for Robotics Simulation and Control
EcXmlReader Class Reference

An XML file reader. More...

#include <ecXmlReader.h>

Collaboration diagram for EcXmlReader:


struct  FileReaderElement

Public Types

enum  EcXmlReaderModifierFlags {
enum  EcHrefSourceTypes {
 Supported href source types for including XML content.

Public Member Functions

 EcXmlReader ()
 Default constructor.
 EcXmlReader (const EcString &filename, std::istream &stream, EcInt64 fileSize=-1, EcInt32 *pProgress=EcNULL)
 Constructor with filename argument.
virtual ~EcXmlReader ()
 Default destructor.
 EcXmlReader (const EcXmlReader &orig)
 copy constructor
EcXmlReaderoperator= (const EcXmlReader &orig)
 assignment operator
virtual void open (const EcString &filename, std::istream &stream)
 Opens an XML reader.
virtual EcXmlFileReader::XML_READER_MODE readXml ()
 Executive for XML processing.
virtual EcBoolean versionFlag () const
 Get version flag.
virtual EcXmlFileReader::XML_READER_MODE mode () const
 Get mode.
virtual const EcTokenelement () const
 Get element name.
virtual const EcTokenattributeName ()
 Get next attribute name (then pop value -> nonconst)
virtual const EcTokenattributeName (const EcToken &key)
 Get next attribute name given key (then pop value -> nonconst)
virtual const EcStringattributeValue ()
 Get next attribute value (then pop value -> nonconst)
virtual const EcStringattributeValue (const EcToken &key)
 Get next attribute value given key (then pop value -> nonconst)
virtual EcSizeT numOfAttributes () const
 Get original size of attribute queue.
virtual EcSizeT remainingNumOfAttributes () const
 Get size of attribute name queue.
virtual const EcStringcontent () const
 Get content.
virtual const EcStringcontentByWord () const
 Get next word of content.
virtual const EcSizeT contentCount () const
 Get number of items in content.
virtual EcBoolean isContentAvailable () const
 Test for content.
virtual void setContentVectorFlag (EcBoolean contentVectorFlag=EcTrue)
 Set content vector flag.
virtual const char * filename ()
virtual EcInt32 lineCountOfFile () const
 Get line count.
virtual EcBoolean nextMatchingEndTag ()
 Continue reading to matching end tag for current element.
virtual void skipCurrentAttribute ()
 skip the current attribute
virtual const EcStringgetChildrenAsString ()
 Get childen content as string. More...
virtual std::istream & stream () const
 Get input stream.
virtual const EcStringgetComplexStartTagFast ()
virtual const EcStringgetSimpleStartTagFast ()
virtual const EcStringgetAttributeValueFast ()
 Get next attribute value (fast without error checking)
virtual const EcStringgetLastAttributeValueFast ()
 Get last attribute value (fast without error checking)
virtual const EcStringgetContentByWordFast ()
 Get next content word (fast without error checking)
virtual void getEndTagFast ()
 Get end tag (fast without error checking)
virtual void setFactoryPointer (EcBaseXmlFactory *pFactory)
 Set (and delete) the factory pionter.
virtual const EcBaseXmlFactoryfactoryPointer () const
 Get the factory pointer.
virtual EcBoolean registerComponentCreator (const EcToken &token, EcXmlObjectCreator creator)
virtual EcU32 errorCode () const
 Get error code.
virtual void setLinkTotal (EcSizeT linkTotal)
 set link total
virtual void resetLinkCount ()
 reset link count to zero
virtual void incrementLinkCount ()
 Increment link count.
EcU32 modifierFlags () const
 get the XML reader modifier flags
void setModifierFlags (const EcU32 flags)
 set the XML reader modifier flags
template<class InputStreamType >
EcBoolean registerInputStream (EcHrefSourceTypes type)
 register a supported input stream for reading href sources

Protected Types

typedef EcInputStreamPtr(* EcInputStreamCreator) ()
 type definition of an expression element creator function
typedef std::map< EcU32, EcInputStreamCreatorHrefSourceStreamCreatorMap

Protected Member Functions

virtual EcBoolean openFileTest ()
 Test for open of include file.
virtual EcBoolean closeFileTest ()
 Test for close of include file.
virtual EcU32 parseHref (const EcString &href, const EcString &parse, EcString &sourceAddress)
 Parse href into url, path, and file name.
virtual EcBoolean checkVersion ()
 Test compatibility of XML file.
virtual EcBaseXmlFactorynewFactory () const
 XML factory creator. Used internally.

Protected Attributes

std::stack< FileReaderElementm_XmlFileReader
 Pointer to top (i.e., of stack) file reader.
EcBoolean m_VersionPerformCheckFlag
 Perform version check.
EcBoolean m_VersionFlag
 Is version valid?
 A factory pointer.
EcSizeT m_LinkTotal
 total number of links
EcSizeT m_LinkCount
 Link count.
EcU32 m_ReaderModifierFlags
 Bit flags that can be used to configure the read operation at runtime.
EcInt64 m_FileSize
 file size
 file loading progress
HrefSourceStreamCreatorMap m_InputStreamMap
 The input stream map for href sources.

Detailed Description

An XML file reader.

ecCustomTypeLink.cpp, and ecXmlMain.cpp.

Definition at line 17 of file ecXmlReader.h.

Member Enumeration Documentation

Reader modifier flags enum these flags can be used in read method implementations to achieve different behaviors

Definition at line 24 of file ecXmlReader.h.

Member Function Documentation

virtual const char* EcXmlReader::filename ( )

Get file name

char * is returned due to the type needed by EcWARN
virtual const EcString& EcXmlReader::getChildrenAsString ( )

Get childen content as string.

Return values
Stringcontaining children
virtual const EcString& EcXmlReader::getComplexStartTagFast ( )

Get start tag (fast without error checking) Complex means tags with attributes

virtual const EcString& EcXmlReader::getSimpleStartTagFast ( )

Get start tag (fast without error checking) Simple means tags without attributes

virtual EcBoolean EcXmlReader::registerComponentCreator ( const EcToken token,
EcXmlObjectCreator  creator 

register a single optional component with the factory returns true if a new factory is created

The documentation for this class was generated from the following file: