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];
string class that uses an array of static size to hold the characters
const char * c_str() const
FixedString< LENGTH > & operator=(const String &rhs)
const char * data() const
FixedString(const char *str)
char operator[](size_t index) const
bool operator==(const String &rhs) const
bool operator!=(const FixedString< LENGTH > &rhs) const
char & operator[](size_t index)
bool operator==(const FixedString< LENGTH > &rhs) const
bool operator!=(const String &rhs) const
FixedString(const String &str)
bool DLLEXPORT_OST_GEOM operator==(const Line2 &l1, const Line2 &l2)
void RawSerialize(BinaryDataSink &sink, char *value, size_t size)