35 template<
size_t L>
class Str
42 inline Str(std::string::const_iterator& itor,
43 std::string::const_iterator& endi){ this->
Assign(itor, endi); }
50 inline int Compare(
const char* str)
const {
return std::strncmp(
m_buffer, str, L); }
56 inline Str&
Assign(std::string::const_iterator& itor,
57 std::string::const_iterator& endi) { this->
Clear(); this->
Append(itor, endi);
return *
this; }
60 inline Str&
Append(
float f) {
char buf[50]; std::snprintf(buf, 50,
"%f", f); this->
Append(buf);
return *
this; }
61 inline Str&
Append(
int i) {
char buf[50]; std::snprintf(buf, 50,
"%d", i); this->
Append(buf);
return *
this; }
62 inline Str&
Append(
size_t z) {
char buf[50]; std::snprintf(buf, 50,
"%lu",
static_cast<unsigned long>(
z)); this->
Append(buf);
return *
this; }
63 inline Str&
Append(
char c) {
char buf[2] = {}; buf[0] = c; this->
Append(buf);
return *
this; }
64 inline Str&
Append(std::string::const_iterator& itor,
65 std::string::const_iterator& endi) {
for(;itor!=endi;++itor) { this->
Append(*itor); }
return *
this; }
68 inline operator const char*()
const {
return this->
ToCStr(); }