TiXmlString Class Reference
#include <tinystr.h>
List of all members.
Detailed Description
Definition at line 73 of file tinystr.h.
Member Typedef Documentation
Constructor & Destructor Documentation
TiXmlString::TiXmlString |
( |
|
) |
[inline] |
Definition at line 84 of file tinystr.h.
00084 : rep_(&nullrep_)
00085 {
00086 }
TiXmlString::TiXmlString |
( |
const TiXmlString & |
copy |
) |
[inline] |
TIXML_EXPLICIT TiXmlString::TiXmlString |
( |
const char * |
copy |
) |
[inline] |
Definition at line 96 of file tinystr.h.
References length().
00096 : rep_(0)
00097 {
00098 init( static_cast<size_type>( strlen(copy) ));
00099 memcpy(start(), copy, length());
00100 }
TIXML_EXPLICIT TiXmlString::TiXmlString |
( |
const char * |
str, |
|
|
size_type |
len | |
|
) |
| | [inline] |
Definition at line 103 of file tinystr.h.
00103 : rep_(0)
00104 {
00105 init(len);
00106 memcpy(start(), str, len);
00107 }
TiXmlString::~TiXmlString |
( |
|
) |
[inline] |
Definition at line 110 of file tinystr.h.
00111 {
00112 quit();
00113 }
Member Function Documentation
Definition at line 54 of file tinystr.cpp.
References capacity(), and swap().
Referenced by operator=().
00055 {
00056 size_type cap = capacity();
00057 if (len > cap || cap > 3*(len + 8))
00058 {
00059 TiXmlString tmp;
00060 tmp.init(len);
00061 memcpy(tmp.start(), str, len);
00062 swap(tmp);
00063 }
00064 else
00065 {
00066 memmove(start(), str, len);
00067 set_size(len);
00068 }
00069 return *this;
00070 }
const char& TiXmlString::at |
( |
size_type |
index |
) |
const [inline] |
Definition at line 167 of file tinystr.h.
References length().
00168 {
00169 assert( index < length() );
00170 return rep_->str[ index ];
00171 }
const char* TiXmlString::c_str |
( |
|
) |
const [inline] |
size_type TiXmlString::capacity |
( |
|
) |
const [inline] |
void TiXmlString::clear |
( |
|
) |
[inline] |
Definition at line 198 of file tinystr.h.
00199 {
00200
00201
00202
00203
00204 quit();
00205 init(0,0);
00206 }
const char* TiXmlString::data |
( |
|
) |
const [inline] |
bool TiXmlString::empty |
( |
|
) |
const [inline] |
Definition at line 160 of file tinystr.h.
00160 { return rep_->size == 0; }
size_type TiXmlString::find |
( |
char |
lookup |
) |
const [inline] |
size_type TiXmlString::length |
( |
|
) |
const [inline] |
TiXmlString& TiXmlString::operator+= |
( |
char |
single |
) |
[inline] |
TiXmlString& TiXmlString::operator+= |
( |
const char * |
suffix |
) |
[inline] |
Definition at line 129 of file tinystr.h.
References append().
00130 {
00131 return append(suffix, static_cast<size_type>( strlen(suffix) ));
00132 }
TiXmlString& TiXmlString::operator= |
( |
const char * |
copy |
) |
[inline] |
char& TiXmlString::operator[] |
( |
size_type |
index |
) |
const [inline] |
Definition at line 174 of file tinystr.h.
References length().
00175 {
00176 assert( index < length() );
00177 return rep_->str[ index ];
00178 }
size_type TiXmlString::size |
( |
|
) |
const [inline] |
Definition at line 157 of file tinystr.h.
00157 { return rep_->size; }
void TiXmlString::swap |
( |
TiXmlString & |
other |
) |
[inline] |
Definition at line 217 of file tinystr.h.
Referenced by assign(), and reserve().
00218 {
00219 Rep* r = rep_;
00220 rep_ = other.rep_;
00221 other.rep_ = r;
00222 }
Member Data Documentation
The documentation for this class was generated from the following files: