xmlTiny::TiXmlUnknown Class Reference

Any tag that tinyXml doesn't recognize is saved as an unknown. More...

#include <OBTtinyxml.h>

Inheritance diagram for xmlTiny::TiXmlUnknown:

Inheritance graph
[legend]
Collaboration diagram for xmlTiny::TiXmlUnknown:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 TiXmlUnknown ()
virtual ~TiXmlUnknown ()
 TiXmlUnknown (const TiXmlUnknown &copy)
void operator= (const TiXmlUnknown &copy)
virtual TiXmlNodeClone () const
 Creates a copy of this Unknown and returns it.
virtual void Print (FILE *cfile, int depth) const
 All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.
virtual const char * Parse (const char *p, TiXmlParsingData *data, TiXmlEncoding encoding)
virtual const
TiXmlUnknown
ToUnknown () const
 Cast to a more defined type. Will return null not of the requested type.
virtual TiXmlUnknownToUnknown ()
 Cast to a more defined type. Will return null not of the requested type.
virtual bool Accept (TiXmlVisitor *content) const
 Walk the XML tree visiting this node and all of its children.

Protected Member Functions

void CopyTo (TiXmlUnknown *target) const
virtual void StreamIn (std::istream *in, TIXML_STRING *tag)


Detailed Description

Any tag that tinyXml doesn't recognize is saved as an unknown.

It is a tag of text, but should not be modified. It will be written back to the XML, unchanged, when the file is saved.

DTD tags get thrown into TiXmlUnknowns.

Definition at line 1351 of file tiny/tmp/OBTtinyxml.h.


Constructor & Destructor Documentation

xmlTiny::TiXmlUnknown::TiXmlUnknown (  )  [inline]

Definition at line 1354 of file tiny/tmp/OBTtinyxml.h.

Referenced by Clone().

virtual xmlTiny::TiXmlUnknown::~TiXmlUnknown (  )  [inline, virtual]

Definition at line 1355 of file tiny/tmp/OBTtinyxml.h.

01355 {}

xmlTiny::TiXmlUnknown::TiXmlUnknown ( const TiXmlUnknown copy  )  [inline]

Definition at line 1357 of file tiny/tmp/OBTtinyxml.h.

References CopyTo().

01357 : TiXmlNode( TiXmlNode::UNKNOWN )               { copy.CopyTo( this ); }


Member Function Documentation

void xmlTiny::TiXmlUnknown::operator= ( const TiXmlUnknown copy  )  [inline]

Definition at line 1358 of file tiny/tmp/OBTtinyxml.h.

References CopyTo().

01358 { copy.CopyTo( this ); }

TiXmlNode * xmlTiny::TiXmlUnknown::Clone (  )  const [virtual]

Creates a copy of this Unknown and returns it.

Implements xmlTiny::TiXmlNode.

Definition at line 1493 of file tiny/tmp/OBTtinyxml.cpp.

References CopyTo(), and TiXmlUnknown().

01494 {
01495         TiXmlUnknown* clone = new TiXmlUnknown();
01496 
01497         if ( !clone )
01498                 return 0;
01499 
01500         CopyTo( clone );
01501         return clone;
01502 }

void xmlTiny::TiXmlUnknown::Print ( FILE *  cfile,
int  depth 
) const [virtual]

All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.

) Either or both cfile and str can be null.

This is a formatted print, and will insert tabs and newlines.

(For an unformatted stream, use the << operator.)

Implements xmlTiny::TiXmlBase.

Definition at line 1473 of file tiny/tmp/OBTtinyxml.cpp.

References xmlTiny::TiXmlNode::value.

01474 {
01475         for ( int i=0; i<depth; i++ )
01476                 fprintf( cfile, "    " );
01477         fprintf( cfile, "<%s>", value.c_str() );
01478 }

const char * xmlTiny::TiXmlUnknown::Parse ( const char *  p,
TiXmlParsingData data,
TiXmlEncoding  encoding 
) [virtual]

Implements xmlTiny::TiXmlBase.

Definition at line 1276 of file tiny/tmp/OBTtinyxmlparser.cpp.

References xmlTiny::TiXmlParsingData::Cursor(), xmlTiny::TiXmlNode::GetDocument(), xmlTiny::TiXmlBase::location, xmlTiny::TiXmlDocument::SetError(), xmlTiny::TiXmlBase::SkipWhiteSpace(), xmlTiny::TiXmlParsingData::Stamp(), xmlTiny::TiXmlBase::TIXML_ERROR_PARSING_UNKNOWN, and xmlTiny::TiXmlNode::value.

01277 {
01278         TiXmlDocument* document = GetDocument();
01279         p = SkipWhiteSpace( p, encoding );
01280 
01281         if ( data )
01282         {
01283                 data->Stamp( p, encoding );
01284                 location = data->Cursor();
01285         }
01286         if ( !p || !*p || *p != '<' )
01287         {
01288                 if ( document ) document->SetError( TIXML_ERROR_PARSING_UNKNOWN, p, data, encoding );
01289                 return 0;
01290         }
01291         ++p;
01292     value = "";
01293 
01294         while ( p && *p && *p != '>' )
01295         {
01296                 value += *p;
01297                 ++p;
01298         }
01299 
01300         if ( !p )
01301         {
01302                 if ( document ) document->SetError( TIXML_ERROR_PARSING_UNKNOWN, 0, 0, encoding );
01303         }
01304         if ( *p == '>' )
01305                 return p+1;
01306         return p;
01307 }

virtual const TiXmlUnknown* xmlTiny::TiXmlUnknown::ToUnknown (  )  const [inline, virtual]

Cast to a more defined type. Will return null not of the requested type.

Reimplemented from xmlTiny::TiXmlNode.

Definition at line 1367 of file tiny/tmp/OBTtinyxml.h.

virtual TiXmlUnknown* xmlTiny::TiXmlUnknown::ToUnknown (  )  [inline, virtual]

Cast to a more defined type. Will return null not of the requested type.

Reimplemented from xmlTiny::TiXmlNode.

Definition at line 1368 of file tiny/tmp/OBTtinyxml.h.

bool xmlTiny::TiXmlUnknown::Accept ( TiXmlVisitor content  )  const [virtual]

Walk the XML tree visiting this node and all of its children.

Implements xmlTiny::TiXmlNode.

Definition at line 1487 of file tiny/tmp/OBTtinyxml.cpp.

References xmlTiny::TiXmlVisitor::Visit().

01488 {
01489         return visitor->Visit( *this );
01490 }

void xmlTiny::TiXmlUnknown::CopyTo ( TiXmlUnknown target  )  const [protected]

Definition at line 1481 of file tiny/tmp/OBTtinyxml.cpp.

References xmlTiny::TiXmlNode::CopyTo().

Referenced by Clone(), operator=(), and TiXmlUnknown().

01482 {
01483         TiXmlNode::CopyTo( target );
01484 }

virtual void xmlTiny::TiXmlUnknown::StreamIn ( std::istream *  in,
TIXML_STRING *  tag 
) [protected, virtual]

Implements xmlTiny::TiXmlNode.


Generated on Wed Oct 1 11:34:25 2008 for OBT by  doxygen 1.5.3