Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
StringSumHelper Class Reference
Inheritance diagram for StringSumHelper:
String

Public Member Functions

 StringSumHelper (const String &s)
 
 StringSumHelper (const char *p)
 
 StringSumHelper (char c)
 
 StringSumHelper (unsigned char num)
 
 StringSumHelper (int num)
 
 StringSumHelper (unsigned int num)
 
 StringSumHelper (long num)
 
 StringSumHelper (unsigned long num)
 
 StringSumHelper (float num)
 
 StringSumHelper (double num)
 
void setString (const char *cstr, int length=-1)
 
void setString (flash_string_t pstr, int length=-1)
 
bool reserve (unsigned int size)
 
bool setLength (unsigned int length)
 set the string length accordingly, expanding if necessary More...
 
unsigned int length (void) const
 
bool concat (const String &str)
 
bool concat (const char *cstr)
 
bool STRING_IRAM_ATTR concat (const char *cstr, unsigned int length)
 
bool concat (char c)
 
bool concat (unsigned char c)
 
bool concat (int num)
 
bool concat (unsigned int num)
 
bool concat (long num)
 
bool concat (unsigned long num)
 
bool concat (float num)
 
bool concat (double num)
 
Stringoperator+= (const String &rhs)
 
Stringoperator+= (const char *cstr)
 
Stringoperator+= (char c)
 
Stringoperator+= (unsigned char num)
 
Stringoperator+= (int num)
 
Stringoperator+= (unsigned int num)
 
Stringoperator+= (long num)
 
Stringoperator+= (unsigned long num)
 
Stringoperator+= (float num)
 
Stringoperator+= (double num)
 
 operator StringIfHelperType () const
 
int STRING_IRAM_ATTR compareTo (const String &s) const
 
bool STRING_IRAM_ATTR equals (const String &s) const
 
bool STRING_IRAM_ATTR equals (const char *cstr) const
 
bool equals (const FlashString &fstr) const
 
bool STRING_IRAM_ATTR operator== (const String &rhs) const
 
bool STRING_IRAM_ATTR operator== (const char *cstr) const
 
bool STRING_IRAM_ATTR operator== (const FlashString &fstr) const
 
bool STRING_IRAM_ATTR operator!= (const String &rhs) const
 
bool STRING_IRAM_ATTR operator!= (const char *cstr) const
 
bool operator< (const String &rhs) const
 
bool operator> (const String &rhs) const
 
bool operator<= (const String &rhs) const
 
bool operator>= (const String &rhs) const
 
bool equalsIgnoreCase (const char *cstr) const
 
bool equalsIgnoreCase (const String &s2) const
 
bool equalsIgnoreCase (const FlashString &fstr) const
 
bool startsWith (const String &prefix) const
 
bool startsWith (const String &prefix, unsigned int offset) const
 
bool endsWith (const String &suffix) const
 
char STRING_IRAM_ATTR charAt (unsigned int index) const
 
void STRING_IRAM_ATTR setCharAt (unsigned int index, char c)
 
char STRING_IRAM_ATTR operator[] (unsigned int index) const
 
char &STRING_IRAM_ATTR operator[] (unsigned int index)
 
unsigned int getBytes (unsigned char *buf, unsigned int bufsize, unsigned int index=0) const
 read contents of string into a buffer More...
 
void toCharArray (char *buf, unsigned int bufsize, unsigned int index=0) const
 
const char * c_str () const
 
char * begin ()
 
const char * begin () const
 
char * end ()
 
const char * end () const
 
int STRING_IRAM_ATTR indexOf (char ch) const
 
int indexOf (char ch, unsigned int fromIndex) const
 
int STRING_IRAM_ATTR indexOf (const String &str) const
 
int indexOf (const String &s2, unsigned int fromIndex) const
 
int lastIndexOf (char ch) const
 
int lastIndexOf (char ch, unsigned int fromIndex) const
 
int lastIndexOf (const String &s2) const
 
int lastIndexOf (const String &s2, unsigned int fromIndex) const
 
String substring (unsigned int beginIndex) const
 
String substring (unsigned int beginIndex, unsigned int endIndex) const
 
void replace (char find, char replace)
 
void replace (const String &find, const String &replace)
 
void remove (unsigned int index)
 
void remove (unsigned int index, unsigned int count)
 
void toLowerCase (void)
 
void toUpperCase (void)
 
void trim (void)
 
long toInt (void) const
 
float toFloat (void) const
 

Static Public Attributes

static const String nullstr
 A null string evaluates to false. More...
 
static const String empty
 An empty string evaluates to true. More...
 

Protected Member Functions

void STRING_IRAM_ATTR invalidate (void)
 
bool STRING_IRAM_ATTR changeBuffer (unsigned int maxStrLen)
 
Stringcopy (const char *cstr, unsigned int length)
 
Stringcopy (flash_string_t pstr, unsigned int length)
 
void move (String &rhs)
 

Protected Attributes

char * buffer = nullptr
 
uint16_t capacity = 0
 
uint16_t len = 0
 

Member Function Documentation

unsigned int String::getBytes ( unsigned char *  buf,
unsigned int  bufsize,
unsigned int  index = 0 
) const
inherited

read contents of string into a buffer

Parameters
bufbuffer to write data
bufsizesize of buffer in bytes
indexoffset to start
Return values
unsignednumber of bytes copied, excluding nul terminator
Note
Returned data always nul terminated so buffer size needs to take this into account
bool String::setLength ( unsigned int  length)
inherited

set the string length accordingly, expanding if necessary

Parameters
lengthrequired for string (nul terminator additional)
Return values
trueon success, false on failure
Note
extra characters are undefined

Member Data Documentation

const String String::empty
staticinherited

An empty string evaluates to true.

const String String::nullstr
staticinherited

A null string evaluates to false.