27 #ifndef TIXML_STRING_INCLUDED 28 #define TIXML_STRING_INCLUDED 37 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 39 #define TIXML_EXPLICIT explicit 40 #elif defined(__GNUC__) && (__GNUC__ >= 3) 42 #define TIXML_EXPLICIT explicit 44 #define TIXML_EXPLICIT 62 static const size_type
npos;
80 init(static_cast<size_type>( strlen(copy)));
88 memcpy(
start(), str, len);
99 return assign(copy, (size_type) strlen(copy));
111 return append(suffix, static_cast<size_type>( strlen(suffix)));
117 return append(&single, 1);
153 const char &
at(size_type index)
const 167 size_type
find(
char lookup)
const 169 return find(lookup, 0);
173 size_type
find(
char tofind, size_type offset)
const 178 for (
const char *p =
c_str() + offset; *p !=
'\0'; ++p)
181 {
return static_cast< size_type
>( p -
c_str()); }
232 void init(size_type sz, size_type cap)
241 const size_type bytesNeeded =
sizeof(
Rep) + cap;
242 const size_type intsNeeded = (bytesNeeded +
sizeof(int) - 1) /
sizeof(int);
243 rep_ =
reinterpret_cast<Rep *
>(
new int[intsNeeded] );
260 delete[] (
reinterpret_cast<int *
>(
rep_ ));
282 {
return !(a == b); }
294 {
return strcmp(a.
c_str(), b) == 0; }
300 {
return !(a == b); }
303 {
return !(b == a); }
336 #endif // TIXML_STRING_INCLUDED 337 #endif // TIXML_USE_STL static const size_type npos
bool operator>(const TiXmlString &a, const TiXmlString &b)
void swap(TiXmlString &other)
size_type find(char tofind, size_type offset) const
TiXmlString operator+(const TiXmlString &a, const TiXmlString &b)
const char & at(size_type index) const
bool operator<(const TiXmlString &a, const TiXmlString &b)
TiXmlString(const TiXmlString ©)
size_type capacity() const
TiXmlString & operator+=(const char *suffix)
TIXML_EXPLICIT TiXmlString(const char *str, size_type len)
TiXmlString & assign(const char *str, size_type len)
TiXmlString & operator=(const char *copy)
void reserve(size_type cap)
char & operator[](size_type index) const
size_type find(char lookup) const
void set_size(size_type sz)
const char * c_str() const
bool operator==(const TiXmlString &a, const TiXmlString &b)
TiXmlString & append(const char *str, size_type len)
bool operator>=(const TiXmlString &a, const TiXmlString &b)
TIXML_EXPLICIT TiXmlString(const char *copy)
const char * data() const
bool operator!=(const TiXmlString &a, const TiXmlString &b)
TiXmlOutStream & operator<<(const char *in)
TiXmlString & operator+=(char single)
TiXmlOutStream & operator<<(const TiXmlString &in)
bool operator<=(const TiXmlString &a, const TiXmlString &b)
void init(size_type sz, size_type cap)
TiXmlString & operator+=(const TiXmlString &suffix)
TiXmlString & operator=(const TiXmlString ©)