#include <tinyxml.h>
Public Member Functions | |
virtual bool | Accept (TiXmlVisitor *content) const |
virtual bool | Accept (TiXmlVisitor *content) const |
bool | CDATA () const |
Queries whether this represents text using a CDATA section. | |
bool | CDATA () const |
Queries whether this represents text using a CDATA section. | |
void | operator= (const TiXmlText &base) |
TiXmlText & | operator= (const TiXmlText &base) |
virtual const char * | Parse (const char *p, TiXmlParsingData *data, TiXmlEncoding encoding) |
virtual const char * | Parse (const char *p, TiXmlParsingData *data, TiXmlEncoding encoding) |
virtual void | Print (FILE *cfile, int depth) const |
virtual void | Print (FILE *cfile, int depth) const |
void | SetCDATA (bool _cdata) |
Turns on or off a CDATA representation of text. | |
void | SetCDATA (bool _cdata) |
Turns on or off a CDATA representation of text. | |
TiXmlText (const TiXmlText ©) | |
TiXmlText (const char *initValue) | |
TiXmlText (const TiXmlText ©) | |
TiXmlText (const std::string &initValue) | |
Constructor. | |
TiXmlText (const char *initValue) | |
TiXmlText (const std::string &initValue) | |
Constructor. | |
virtual TiXmlText * | ToText () |
Cast to a more defined type. Will return null not of the requested type. | |
virtual const TiXmlText * | ToText () const |
Cast to a more defined type. Will return null not of the requested type. | |
virtual const TiXmlText * | ToText () const |
Cast to a more defined type. Will return null not of the requested type. | |
virtual TiXmlText * | ToText () |
Cast to a more defined type. Will return null not of the requested type. | |
virtual | ~TiXmlText () |
virtual | ~TiXmlText () |
Protected Member Functions | |
bool | Blank () const |
bool | Blank () const |
virtual TiXmlNode * | Clone () const |
[internal use] Creates a new Element and returns it. | |
virtual TiXmlNode * | Clone () const |
[internal use] Creates a new Element and returns it. | |
void | CopyTo (TiXmlText *target) const |
void | CopyTo (TiXmlText *target) const |
virtual void | StreamIn (std::istream *in, TIXML_STRING *tag) |
virtual void | StreamIn (std::istream *in, TIXML_STRING *tag) |
Private Attributes | |
bool | cdata |
Friends | |
class | TiXmlElement |
XML text. A text node can have 2 ways to output the next. "normal" output and CDATA. It will default to the mode it was parsed from the XML file and you generally want to leave it alone, but you can change the output mode with SetCDATA() and query it with CDATA().
TiXmlText::TiXmlText | ( | const char * | initValue | ) | [inline] |
Constructor for text element. By default, it is treated as normal, encoded text. If you want it be output as a CDATA text element, set the parameter _cdata to 'true'
Definition at line 1215 of file tinyxml.h.
References cdata, and TiXmlNode::SetValue().
Referenced by Clone().
: TiXmlNode (TiXmlNode::TEXT) { SetValue( initValue ); cdata = false; }
TiXmlText::TiXmlText | ( | const std::string & | initValue | ) | [inline] |
Constructor.
Definition at line 1224 of file tinyxml.h.
References cdata, and TiXmlNode::SetValue().
: TiXmlNode (TiXmlNode::TEXT) { SetValue( initValue ); cdata = false; }
TiXmlText::TiXmlText | ( | const TiXmlText & | copy | ) | [inline] |
TiXmlText::TiXmlText | ( | const char * | initValue | ) | [inline] |
Constructor for text element. By default, it is treated as normal, encoded text. If you want it be output as a CDATA text element, set the parameter _cdata to 'true'
Definition at line 1147 of file tinyxml.h.
References cdata, and TiXmlNode::SetValue().
: TiXmlNode (TiXmlNode::TEXT) { SetValue( initValue ); cdata = false; }
TiXmlText::TiXmlText | ( | const std::string & | initValue | ) | [inline] |
Constructor.
Definition at line 1155 of file tinyxml.h.
References cdata, and TiXmlNode::SetValue().
: TiXmlNode (TiXmlNode::TEXT) { SetValue( initValue ); cdata = false; }
TiXmlText::TiXmlText | ( | const TiXmlText & | copy | ) | [inline] |
bool TiXmlText::Accept | ( | TiXmlVisitor * | content | ) | const [virtual] |
Walk the XML tree visiting this node and all of its children.
Implements TiXmlNode.
Definition at line 1380 of file tinyxml.cc.
References TiXmlVisitor::Visit().
{ return visitor->Visit( *this ); }
virtual bool TiXmlText::Accept | ( | TiXmlVisitor * | content | ) | const [virtual] |
Walk the XML tree visiting this node and all of its children.
Implements TiXmlNode.
bool TiXmlText::Blank | ( | ) | const [protected] |
Definition at line 1645 of file tinyxmlparser.cc.
References i, TiXmlBase::IsWhiteSpace(), and TiXmlNode::value.
Referenced by TiXmlElement::ReadValue().
bool TiXmlText::Blank | ( | ) | const [protected] |
bool TiXmlText::CDATA | ( | ) | const [inline] |
Queries whether this represents text using a CDATA section.
Definition at line 1238 of file tinyxml.h.
References cdata.
Referenced by TiXmlPrinter::Visit(), and TiXmlPrinter::VisitEnter().
{ return cdata; }
bool TiXmlText::CDATA | ( | ) | const [inline] |
TiXmlNode * TiXmlText::Clone | ( | ) | const [protected, virtual] |
virtual TiXmlNode* TiXmlText::Clone | ( | ) | const [protected, virtual] |
[internal use] Creates a new Element and returns it.
Implements TiXmlNode.
void TiXmlText::CopyTo | ( | TiXmlText * | target | ) | const [protected] |
Definition at line 1373 of file tinyxml.cc.
References cdata.
Referenced by Clone(), operator=(), and TiXmlText().
{ TiXmlNode::CopyTo( target ); target->cdata = cdata; }
void TiXmlText::CopyTo | ( | TiXmlText * | target | ) | const [protected] |
void TiXmlText::operator= | ( | const TiXmlText & | base | ) | [inline] |
virtual const char* TiXmlText::Parse | ( | const char * | p, |
TiXmlParsingData * | data, | ||
TiXmlEncoding | encoding | ||
) | [virtual] |
Implements TiXmlBase.
const char * TiXmlText::Parse | ( | const char * | p, |
TiXmlParsingData * | data, | ||
TiXmlEncoding | encoding | ||
) | [virtual] |
Implements TiXmlBase.
Definition at line 1512 of file tinyxmlparser.cc.
References cdata, TiXmlParsingData::Cursor(), end, TiXmlNode::GetDocument(), TiXmlBase::location, AlCaHLTBitMon_ParallelJobs::p, TiXmlBase::ReadText(), TiXmlDocument::SetError(), TiXmlParsingData::Stamp(), TiXmlBase::StringEqual(), TiXmlBase::TIXML_ERROR_PARSING_CDATA, TIXML_STRING, and TiXmlNode::value.
Referenced by TiXmlElement::ReadValue().
{ value = ""; TiXmlDocument* document = GetDocument(); if ( data ) { data->Stamp( p, encoding ); location = data->Cursor(); } const char* const startTag = "<![CDATA["; const char* const endTag = "]]>"; if ( cdata || StringEqual( p, startTag, false, encoding ) ) { cdata = true; if ( !StringEqual( p, startTag, false, encoding ) ) { document->SetError( TIXML_ERROR_PARSING_CDATA, p, data, encoding ); return 0; } p += strlen( startTag ); // Keep all the white space, ignore the encoding, etc. while ( p && *p && !StringEqual( p, endTag, false, encoding ) ) { value += *p; ++p; } TIXML_STRING dummy; p = ReadText( p, &dummy, false, endTag, false, encoding ); return p; } else { bool ignoreWhite = true; const char* end = "<"; p = ReadText( p, &value, ignoreWhite, end, false, encoding ); if ( p ) return p-1; // don't truncate the '<' return 0; } }
void TiXmlText::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 TiXmlBase.
Definition at line 1352 of file tinyxml.cc.
References cdata, TiXmlBase::EncodeString(), i, TIXML_STRING, and TiXmlNode::value.
{ assert( cfile ); if ( cdata ) { int i; fprintf( cfile, "\n" ); for ( i=0; i<depth; i++ ) { fprintf( cfile, " " ); } fprintf( cfile, "<![CDATA[%s]]>\n", value.c_str() ); // unformatted output } else { TIXML_STRING buffer; EncodeString( value, &buffer ); fprintf( cfile, "%s", buffer.c_str() ); } }
virtual void TiXmlText::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 TiXmlBase.
void TiXmlText::SetCDATA | ( | bool | _cdata | ) | [inline] |
void TiXmlText::SetCDATA | ( | bool | _cdata | ) | [inline] |
Turns on or off a CDATA representation of text.
Definition at line 1240 of file tinyxml.h.
References cdata.
Referenced by TiXmlNode::Identify().
{ cdata = _cdata; }
virtual void TiXmlText::StreamIn | ( | std::istream * | in, |
TIXML_STRING * | tag | ||
) | [protected, virtual] |
Implements TiXmlNode.
virtual void TiXmlText::StreamIn | ( | std::istream * | in, |
TIXML_STRING * | tag | ||
) | [protected, virtual] |
Implements TiXmlNode.
virtual const TiXmlText* TiXmlText::ToText | ( | ) | const [inline, virtual] |
virtual TiXmlText* TiXmlText::ToText | ( | ) | [inline, virtual] |
virtual TiXmlText* TiXmlText::ToText | ( | ) | [inline, virtual] |
virtual const TiXmlText* TiXmlText::ToText | ( | ) | const [inline, virtual] |
TiXmlElement [friend] |
bool TiXmlText::cdata [private] |
Definition at line 1263 of file tinyxml.h.
Referenced by CDATA(), CopyTo(), Parse(), Print(), SetCDATA(), and TiXmlText().