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 77 static const size_type
npos;
93 init(static_cast< size_type >(strlen(copy)));
101 memcpy(
start(), str, len);
109 return assign(copy, (size_type)strlen(copy));
119 return append(suffix, static_cast< size_type >(strlen(suffix)));
149 const char&
at(size_type index)
const {
161 size_type
find(
char lookup)
const {
return find(lookup, 0); }
165 size_type
find(
char tofind, size_type offset)
const {
168 for (
const char* p =
c_str() + offset; *p !=
'\0'; ++p) {
169 if (*p == tofind)
return static_cast< size_type
>(p -
c_str());
212 void init(size_type sz, size_type cap) {
219 const size_type bytesNeeded =
sizeof(
Rep) + cap;
220 const size_type intsNeeded = (bytesNeeded +
sizeof(int) - 1) /
sizeof(int);
221 rep_ =
reinterpret_cast< Rep*
>(
new int[intsNeeded]);
235 delete[](
reinterpret_cast< int*
>(
rep_));
263 return strcmp(a.
c_str(), b) == 0;
292 #endif // TIXML_STRING_INCLUDED 293 #endif // TIXML_USE_STL static const size_type npos
bool operator>(const TiXmlString &a, const TiXmlString &b)
size_type find(char tofind, size_type offset) const
void swap(TiXmlString &other)
TiXmlString operator+(const TiXmlString &a, const TiXmlString &b)
bool operator<(const TiXmlString &a, const TiXmlString &b)
TiXmlString(const TiXmlString ©)
TiXmlString & operator+=(const char *suffix)
TIXML_EXPLICIT TiXmlString(const char *str, size_type len)
size_type capacity() const
char & operator[](size_type index) const
TiXmlString & assign(const char *str, size_type len)
const char & at(size_type index) const
TiXmlString & operator=(const char *copy)
void reserve(size_type cap)
void set_size(size_type sz)
size_type find(char lookup) const
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)
bool operator!=(const TiXmlString &a, const TiXmlString &b)
TiXmlOutStream & operator<<(const char *in)
TiXmlString & operator+=(char single)
TiXmlOutStream & operator<<(const TiXmlString &in)
const char * data() const
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 ©)