Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MAX44000 PWM_Tone_Library nexpaq_mdk
Fork of LED_Demo by
String Class Reference
Simple C++ string class, used as replacement for std::string. More...
#include <m2mstring.h>
Public Member Functions | |
size_type | size () const |
size without terminating NULL | |
size_type | length () const |
as size() | |
const char * | c_str () const |
raw data | |
void | reserve (size_type n) |
Reserve internal string memory so that n characters can be put into the string (plus 1 for the NULL char). | |
void | resize (size_type n) |
Resize string. | |
void | resize (size_type n, char c) |
Resize string. | |
void | swap (String &) |
swap contents | |
String & | erase (size_type pos, size_type len) |
erase len characters at position pos | |
String & | append (const char *str, size_type n) |
Append n characters of a string. |
Detailed Description
Simple C++ string class, used as replacement for std::string.
Definition at line 31 of file m2mstring.h.
Member Function Documentation
String & append | ( | const char * | str, |
size_type | n | ||
) |
Append n characters of a string.
Definition at line 212 of file m2mstring.cpp.
const char* c_str | ( | ) | const |
raw data
Definition at line 66 of file m2mstring.h.
String & erase | ( | size_type | pos, |
size_type | len | ||
) |
erase len characters at position pos
Definition at line 188 of file m2mstring.cpp.
size_type length | ( | ) | const |
as size()
Definition at line 60 of file m2mstring.h.
void reserve | ( | size_type | n ) |
Reserve internal string memory so that n characters can be put into the string (plus 1 for the NULL char).
If there is already enough memory, nothing happens, if not, the memory will be realloated to exactly this amount.
Definition at line 300 of file m2mstring.cpp.
void resize | ( | size_type | n ) |
Resize string.
If n is less than the current size, the string will be truncated. If n is larger, the memory will be reallocated to exactly this amount, and the additional characters will be NULL characters.
Definition at line 307 of file m2mstring.cpp.
void resize | ( | size_type | n, |
char | c | ||
) |
Resize string.
If n is less than the current size, the string will be truncated. If n is larger, the memory will be reallocated to exactly this amount, and the additional characters will be c characters.
Definition at line 311 of file m2mstring.cpp.
size_type size | ( | ) | const |
size without terminating NULL
Definition at line 59 of file m2mstring.h.
void swap | ( | String & | s ) |
swap contents
Definition at line 325 of file m2mstring.cpp.
Generated on Tue Jul 12 2022 12:29:12 by
