30 const TiXmlString::size_type TiXmlString::npos =
static_cast< TiXmlString::size_type
>(-1);
34 TiXmlString::Rep TiXmlString::nullrep_ = { 0, 0, {
'\0' } };
37 void TiXmlString::reserve (size_type cap)
42 tmp.init(length(), cap);
43 memcpy(tmp.start(), data(), length());
49 TiXmlString& TiXmlString::assign(
const char* str, size_type len)
51 size_type cap = capacity();
52 if (len > cap || cap > 3*(len + 8))
56 memcpy(tmp.start(), str, len);
61 memmove(start(), str, len);
68 TiXmlString& TiXmlString::append(
const char* str, size_type len)
70 size_type newsize = length() + len;
71 if (newsize > capacity())
73 reserve (newsize + capacity());
75 memmove(finish(), str, len);
84 tmp.reserve(a.length() + b.length());
93 TiXmlString::size_type b_len =
static_cast<TiXmlString::size_type
>( strlen(b) );
94 tmp.reserve(a.length() + b_len);
103 TiXmlString::size_type a_len =
static_cast<TiXmlString::size_type
>( strlen(a) );
104 tmp.reserve(a_len + b.length());
105 tmp.append(a, a_len);
111 #endif // TIXML_USE_STL