40 typedef size_t size_type;
41 static const size_type npos;
47 String(
const char*,
size_t);
49 String& operator=(
const char*);
53 String& operator+=(
const char*);
57 bool operator==(
const char*)
const;
58 bool operator==(
const String&)
const;
62 size_type
size()
const {
return size_; }
63 size_type
length()
const {
return size_; }
65 size_type capacity()
const {
return allocated_-1; }
67 bool empty()
const {
return size_ == 0; }
69 const char*
c_str()
const {
return p; }
88 void resize( size_type n,
char c);
93 String substr(
const size_type pos, size_type
length)
const;
96 char& operator[](
const size_type i) {
return p[i]; }
97 char operator[](
const size_type i)
const {
return p[i]; }
99 char at(
const size_type i)
const;
108 String& append_raw(
const char*, size_type);
111 void append_int(
int);
113 int compare( size_type pos, size_type len,
const String& str )
const;
114 int compare( size_type pos, size_type len,
const char* str )
const;
116 int find_last_of(
char c)
const;
118 static uint8_t* convert_integer_to_array(int64_t value, uint8_t &
size,
const uint8_t *array = NULL,
const uint32_t array_size = 0);
119 static int64_t convert_array_to_integer(
const uint8_t *value,
const uint32_t size);
148 void new_realloc( size_type n);
149 char* strdup(
const char* other);
151 friend class ::Test_M2MString;
158 void reverse(
char s[], uint32_t
length);
160 uint32_t itoa_c (int64_t n,
char s[]);
164 #endif // M2M_STRING_H String & append(const char *str, size_type n)
Append n characters of a string.
const char * c_str() const
raw data
Definition: m2mstring.h:69
void reserve(size_type n)
Definition: m2mstring.h:33
size_type size() const
size without terminating NULL
Definition: m2mstring.h:62
size_type length() const
as size()
Definition: m2mstring.h:63
String & erase(size_type pos, size_type len)
erase len characters at position pos
void swap(String &)
swap contents
static bool convert_ascii_to_int(const char *value, size_t length, int64_t &conversion_result)
Namespace defined as replace for components defined under std namespace.
Definition: m2mstring.h:22