1 #ifndef OST_SMALL_STRING_HH
2 #define OST_SMALL_STRING_HH
12 template <
size_t LENGTH>
16 ::memset(bytes_, 0, LENGTH+1);
29 return strlen(bytes_);
33 return this->length();
45 return !strcmp(bytes_, rhs.c_str());
52 return !strcmp(bytes_, rhs.bytes_);
66 template <
typename DS>
73 char*
data() {
return bytes_; }
74 const char*
data()
const {
return bytes_; }
76 void assign(
const String& str) {
77 assert(str.length()<=LENGTH);
78 strcpy(bytes_, str.c_str());
81 void assign(
const char* str) {
82 assert(strlen(str)<=LENGTH);
85 char bytes_[LENGTH+1];