nux-1.16.0
TiXmlText Class Reference

XML text. More...

#include <NuxCore/TinyXML/tinyxml.h>

Inheritance diagram for TiXmlText:
TiXmlNode TiXmlBase

List of all members.

Public Member Functions

 TiXmlText (const char *initValue)
 Constructor for text element.
 TiXmlText (const TiXmlText &copy)
void operator= (const TiXmlText &base)
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.) Either or both cfile and str can be null.
bool CDATA () const
 Queries whether this represents text using a CDATA section.
void SetCDATA (bool _cdata)
 Turns on or off a CDATA representation of text.
virtual const char * Parse (const char *p, TiXmlParsingData *data, TiXmlEncoding encoding)
virtual const TiXmlTextToText () const
virtual TiXmlTextToText ()
virtual bool Accept (TiXmlVisitor *content) const
 Walk the XML tree visiting this node and all of its children.

Protected Member Functions

virtual TiXmlNodeClone () const
 [internal use] Creates a new Element and returns it.
void CopyTo (TiXmlText *target) const
bool Blank () const

Friends

class TiXmlElement

Detailed Description

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().

Definition at line 1511 of file tinyxml.h.


Constructor & Destructor Documentation

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 1519 of file tinyxml.h.

References TiXmlNode::SetValue().

Referenced by Clone().

                                     : TiXmlNode (TiXmlNode::TEXT)
  {
    SetValue ( initValue );
    cdata = false;
  }

Member Function Documentation

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 1490 of file tinyxml.cpp.

References TiXmlBase::EncodeString().

{
  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 TiXmlText* TiXmlText::ToText ( ) [inline, virtual]

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

Reimplemented from TiXmlNode.

Definition at line 1564 of file tinyxml.h.

  {
    return this;  
  }
virtual const TiXmlText* TiXmlText::ToText ( ) const [inline, virtual]

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

Reimplemented from TiXmlNode.

Definition at line 1560 of file tinyxml.h.

  {
    return this;  
  }

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends