Public Types | Public Member Functions | Static Public Attributes

TiXmlString Class Reference

#include <tinystr.h>

Inherited by TiXmlOutStream.

List of all members.

Public Types

typedef size_t size_type
 The size type used.

Public Member Functions

 TiXmlString ()
 TiXmlString empty constructor.
 TiXmlString (const TiXmlString &copy)
 TiXmlString copy constructor.
TIXML_EXPLICIT TiXmlString (const char *copy)
 TiXmlString constructor, based on a string.
TIXML_EXPLICIT TiXmlString (const char *str, size_type len)
 TiXmlString constructor, based on a string.
 ~TiXmlString ()
 TiXmlString destructor.
TiXmlStringoperator= (const char *copy)
 = operator
TiXmlStringoperator= (const TiXmlString &copy)
 = operator
TiXmlStringoperator+= (const char *suffix)
 += operator. Maps to append
TiXmlStringoperator+= (char single)
 += operator. Maps to append
TiXmlStringoperator+= (const TiXmlString &suffix)
 += operator. Maps to append
const char * c_str () const
 Convert a TiXmlString into a null-terminated char *.
const char * data () const
 Convert a TiXmlString into a char * (need not be null terminated).
size_type length () const
 Return the length of a TiXmlString.
size_type size () const
 Alias for length().
bool empty () const
 Checks if a TiXmlString is empty.
size_type capacity () const
 Return capacity of string.
const char & at (size_type index) const
 single char extraction
char & operator[] (size_type index) const
 [] operator
size_type find (char lookup) const
 find a char in a string. Return TiXmlString::npos if not found
size_type find (char tofind, size_type offset) const
 find a char in a string from an offset. Return TiXmlString::npos if not found
void reserve (size_type cap)

Static Public Attributes

static const size_type npos = static_cast< TiXmlString::size_type >(-1)
 Error value for find primitive.

Detailed Description

TiXmlString is an emulation of a subset of the std::string template. Its purpose is to allow compiling TinyXML on compilers with no or poor STL support. Only the member functions relevant to the TinyXML project have been implemented. The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase a string and there's no more room, we allocate a buffer twice as big as we need.


Member Function Documentation

void TiXmlString::reserve ( size_type  cap  ) 

Function to reserve a big amount of data when we know we'll need it. Be aware that this function DOES NOT clear the content of the TiXmlString if any exists.


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