30 #ifndef TIXML_STRING_INCLUDED
31 #define TIXML_STRING_INCLUDED
34 #pragma warning( disable : 4530 )
35 #pragma warning( disable : 4786 )
72 const char * c_str ()
const
80 size_t length ()
const
82 return ( allocated ) ? current_length : 0;
86 void operator = (
const char * content);
111 bool operator == (
const TiXmlString & compare)
const;
112 bool operator == (
const char* compare)
const;
113 bool operator < (
const TiXmlString & compare)
const;
114 bool operator > (
const TiXmlString & compare)
const;
119 return length () ?
false :
true;
123 const char& at (
unsigned index)
const
125 assert( index < length ());
126 return cstring [index];
130 unsigned find (
char lookup)
const
132 return find (lookup, 0);
136 unsigned find (
char tofind,
unsigned offset)
const;
141 void reserve (
unsigned size)
147 cstring =
new char [size];
154 char& operator [] (
unsigned index)
const
156 assert( index < length ());
157 return cstring [index];
161 enum { notfound = 0xffffffff,
164 void append (
const char *str,
size_t len );
173 size_t current_length;
177 size_t assign_new_size (
size_t minimum_to_allocate)
179 return minimum_to_allocate * 2;
192 void append (
const char *suffix );
197 append (suffix . c_str ());
201 void append (
char single)
203 if ( cstring && current_length < (allocated-1) )
205 cstring[ current_length ] = single;
207 cstring[ current_length ] = 0;
212 smallstr [0] = single;
239 append (in . c_str ());
245 #pragma warning( default : 4530 )
246 #pragma warning( default : 4786 )
249 #endif // TIXML_STRING_INCLUDED
250 #endif // TIXML_USE_STL
Definition: tinystr.h:224