41 typedef size_t size_type;
42 static const size_type npos;
48 String(
const char*,
size_t);
50 String& operator=(
const char*);
54 String& operator+=(
const char*);
58 bool operator==(
const char*)
const;
59 bool operator==(
const String&)
const;
63 size_type
size()
const {
return size_; }
64 size_type
length()
const {
return size_; }
66 size_type capacity()
const {
return allocated_-1; }
68 bool empty()
const {
return size_ == 0; }
70 const char*
c_str()
const {
return p; }
89 void resize( size_type n,
char c);
94 String substr(
const size_type pos, size_type
length)
const;
97 char& operator[](
const size_type i) {
return p[i]; }
98 char operator[](
const size_type i)
const {
return p[i]; }
100 char at(
const size_type i)
const;
109 String& append_raw(
const char*, size_type);
112 void append_int(
int);
114 int compare( size_type pos, size_type len,
const String& str )
const;
115 int compare( size_type pos, size_type len,
const char* str )
const;
117 int find_last_of(
char c)
const;
118 int find_first_of(
char c)
const;
120 static uint8_t* convert_integer_to_array(int64_t value, uint8_t &
size,
const uint8_t *array = NULL,
const uint32_t array_size = 0);
121 static int64_t convert_array_to_integer(
const uint8_t *value,
const uint32_t size);
164 void new_realloc( size_type n);
165 char* strdup(
const char* other);
167 friend class ::Test_M2MString;
174 void reverse(
char s[], uint32_t
length);
176 uint32_t itoa_c (int64_t n,
char s[]);
180 #endif // M2M_STRING_H String & append(const char *str, size_type n)
Append n characters of a string.
static bool convert_ascii_to_float(const char *value, size_t size, float &conversion_result)
const char * c_str() const
raw data
Definition: m2mstring.h:70
void reserve(size_type n)
Definition: m2mstring.h:34
size_type size() const
size without terminating NULL
Definition: m2mstring.h:63
size_type length() const
as size()
Definition: m2mstring.h:64
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:24