#include <tinyxml.h>
Inheritance diagram for TiXmlComment:

Public Member Functions | |
| TiXmlComment () | |
| Constructs an empty comment. | |
| TiXmlComment (const char *_value) | |
| Construct a comment from text. | |
| TiXmlComment (const TiXmlComment &) | |
| void | operator= (const TiXmlComment &base) |
| virtual | ~TiXmlComment () |
| virtual TiXmlNode * | Clone () const |
| Returns a copy of this Comment. | |
| virtual void | Print (FILE *cfile, int depth) const |
| virtual const char * | Parse (const char *p, TiXmlParsingData *data, TiXmlEncoding encoding) |
| virtual const TiXmlComment * | ToComment () const |
| Cast to a more defined type. Will return null not of the requested type. | |
| virtual TiXmlComment * | ToComment () |
| Cast to a more defined type. Will return null not of the requested type. | |
| virtual bool | Accept (TiXmlVisitor *visitor) const |
Protected Member Functions | |
| void | CopyTo (TiXmlComment *target) const |
| virtual void | StreamIn (std::istream *in, TIXML_STRING *tag) |
Definition at line 1133 of file tinyxml.h.
|
|
Constructs an empty comment.
Definition at line 1137 of file tinyxml.h. Referenced by Clone(). 01137 : TiXmlNode( TiXmlNode::COMMENT ) {}
|
|
|
Construct a comment from text.
Definition at line 1139 of file tinyxml.h. References TiXmlNode::SetValue().
|
|
|
Definition at line 1269 of file tinyxml.cpp. References CopyTo().
|
|
|
Definition at line 1145 of file tinyxml.h. 01145 {}
|
|
|
Walk the XML tree visiting this node and all of its children. Implements TiXmlNode. Definition at line 1299 of file tinyxml.cpp. References TiXmlVisitor::Visit(). 01300 {
01301 return visitor->Visit( *this );
01302 }
|
|
|
Returns a copy of this Comment.
Implements TiXmlNode. Definition at line 1305 of file tinyxml.cpp. References CopyTo(), and TiXmlComment(). 01306 {
01307 TiXmlComment* clone = new TiXmlComment();
01308
01309 if ( !clone )
01310 return 0;
01311
01312 CopyTo( clone );
01313 return clone;
01314 }
|
|
|
Definition at line 1293 of file tinyxml.cpp. References TiXmlNode::CopyTo(). Referenced by Clone(), operator=(), and TiXmlComment(). 01294 {
01295 TiXmlNode::CopyTo( target );
01296 }
|
|
|
Definition at line 1275 of file tinyxml.cpp. References base, TiXmlNode::Clear(), and CopyTo().
|
|
||||||||||||||||
|
Implements TiXmlBase. Definition at line 1331 of file tinyxmlparser.cpp. References TiXmlParsingData::Cursor(), TiXmlNode::GetDocument(), TiXmlBase::ReadText(), TiXmlDocument::SetError(), TiXmlBase::SkipWhiteSpace(), TiXmlParsingData::Stamp(), and TiXmlBase::StringEqual(). 01332 {
01333 TiXmlDocument* document = GetDocument();
01334 value = "";
01335
01336 p = SkipWhiteSpace( p, encoding );
01337
01338 if ( data )
01339 {
01340 data->Stamp( p, encoding );
01341 location = data->Cursor();
01342 }
01343 const char* startTag = "<!--";
01344 const char* endTag = "-->";
01345
01346 if ( !StringEqual( p, startTag, false, encoding ) )
01347 {
01348 document->SetError( TIXML_ERROR_PARSING_COMMENT, p, data, encoding );
01349 return 0;
01350 }
01351 p += strlen( startTag );
01352 p = ReadText( p, &value, false, endTag, false, encoding );
01353 return p;
01354 }
|
|
||||||||||||
|
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 1282 of file tinyxml.cpp. 01283 {
01284 assert( cfile );
01285 for ( int i=0; i<depth; i++ )
01286 {
01287 fprintf( cfile, " " );
01288 }
01289 fprintf( cfile, "<!--%s-->", value.c_str() );
01290 }
|
|
||||||||||||
|
Implements TiXmlNode. Definition at line 1304 of file tinyxmlparser.cpp. References TiXmlNode::GetDocument(), TiXmlDocument::SetError(), and TIXML_ENCODING_UNKNOWN. 01305 {
01306 while ( in->good() )
01307 {
01308 int c = in->get();
01309 if ( c <= 0 )
01310 {
01311 TiXmlDocument* document = GetDocument();
01312 if ( document )
01313 document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN );
01314 return;
01315 }
01316
01317 (*tag) += (char) c;
01318
01319 if ( c == '>'
01320 && tag->at( tag->length() - 2 ) == '-'
01321 && tag->at( tag->length() - 3 ) == '-' )
01322 {
01323 // All is well.
01324 return;
01325 }
01326 }
01327 }
|
|
|
Cast to a more defined type. Will return null not of the requested type.
Reimplemented from TiXmlNode. |
|
|
Cast to a more defined type. Will return null not of the requested type.
Reimplemented from TiXmlNode. |
1.3.9.1