39 #ifndef TIXML_STRING_INCLUDED 40 #define TIXML_STRING_INCLUDED 49 #if defined(_MSC_VER) && (_MSC_VER >= 1200 ) 51 #define TIXML_EXPLICIT explicit 52 #elif defined(__GNUC__) && (__GNUC__ >= 3 ) 54 #define TIXML_EXPLICIT explicit 56 #define TIXML_EXPLICIT 74 static const size_type
npos;
92 init( static_cast<size_type>( strlen(copy) ));
100 memcpy(
start(), str, len);
112 return assign( copy, (size_type)strlen(copy));
125 return append(suffix, static_cast<size_type>( strlen(suffix) ));
131 return append(&single, 1);
161 const char&
at (size_type index)
const 163 assert( index <
length() );
170 assert( index <
length() );
175 size_type
find (
char lookup)
const 177 return find(lookup, 0);
181 size_type
find (
char tofind, size_type offset)
const 185 for (
const char* p =
c_str() + offset; *p !=
'\0'; ++p)
187 if (*p == tofind)
return static_cast< size_type
>( p -
c_str() );
231 void init(size_type sz, size_type cap)
240 const size_type bytesNeeded =
sizeof(
Rep) + cap;
241 const size_type intsNeeded = ( bytesNeeded +
sizeof(int) - 1 ) /
sizeof( int );
242 rep_ =
reinterpret_cast<Rep*
>(
new int[ intsNeeded ] );
259 delete [] (
reinterpret_cast<int*
>(
rep_ ) );
318 #endif // TIXML_STRING_INCLUDED 319 #endif // TIXML_USE_STL size_type find(char lookup) const
Definition: tinystr.h:175
const char & at(size_type index) const
Definition: tinystr.h:161
~TiXmlString()
Definition: tinystr.h:104
bool empty() const
Definition: tinystr.h:154
bool operator>(const TiXmlString &a, const TiXmlString &b)
Definition: tinystr.h:280
TiXmlString()
Definition: tinystr.h:78
TiXmlString operator+(const TiXmlString &a, const TiXmlString &b)
Definition: tinystr.cpp:86
TIXML_EXPLICIT TiXmlString(const char *copy)
Definition: tinystr.h:90
TiXmlString & assign(const char *str, size_type len)
Definition: tinystr.cpp:54
bool operator<(const TiXmlString &a, const TiXmlString &b)
Definition: tinystr.h:274
size_type length() const
Definition: tinystr.h:148
void swap(TiXmlString &other)
Definition: tinystr.h:211
size_type size
Definition: tinystr.h:227
TiXmlString & operator+=(const char *suffix)
Definition: tinystr.h:123
TiXmlString & append(const char *str, size_type len)
Definition: tinystr.cpp:73
const char * c_str() const
Definition: tinystr.h:142
size_type size() const
Definition: tinystr.h:151
std::ostream & operator<<(std::ostream &os, const Message &sb)
Definition: gtest-message.h:224
size_type capacity
Definition: tinystr.h:227
size_type find(char tofind, size_type offset) const
Definition: tinystr.h:181
char * finish() const
Definition: tinystr.h:223
char str[1]
Definition: tinystr.h:228
size_t size_type
Definition: tinystr.h:71
void quit()
Definition: tinystr.h:253
size_type capacity() const
Definition: tinystr.h:157
void reserve(size_type cap)
Definition: tinystr.cpp:42
void clear()
Definition: tinystr.h:192
char * start() const
Definition: tinystr.h:222
char & operator[](size_type index) const
Definition: tinystr.h:168
void init(size_type sz, size_type cap)
Definition: tinystr.h:231
Rep * rep_
Definition: tinystr.h:263
bool operator==(const TiXmlString &a, const TiXmlString &b)
Definition: tinystr.h:269
void init(size_type sz)
Definition: tinystr.h:220
TiXmlString(const TiXmlString ©)
Definition: tinystr.h:83
TiXmlString & operator=(const char *copy)
Definition: tinystr.h:110
static const size_type npos
Definition: tinystr.h:74
bool operator>=(const TiXmlString &a, const TiXmlString &b)
Definition: tinystr.h:282
void set_size(size_type sz)
Definition: tinystr.h:221
const char * data() const
Definition: tinystr.h:145
bool operator!=(const TiXmlString &a, const TiXmlString &b)
Definition: tinystr.h:279
Definition: tinystr.h:298
#define TIXML_EXPLICIT
Definition: tinystr.h:56
Definition: tinystr.h:225
bool operator<=(const TiXmlString &a, const TiXmlString &b)
Definition: tinystr.h:281
TIXML_EXPLICIT TiXmlString(const char *str, size_type len)
Definition: tinystr.h:97
static Rep nullrep_
Definition: tinystr.h:264