arduino-audio-tools
Loading...
Searching...
No Matches
Str Class Reference

Str which keeps the data on the heap. We grow the allocated memory only if the copy source is not fitting. More...

#include <CodecOpusOgg.h>

Inheritance diagram for Str:
StrView StrView

Public Member Functions

 Str ()=default
 Str ()=default
 Str (const char *str)
 Str (const char *str)
 Str (int initialAllocatedLength)
 Str (int initialAllocatedLength)
 Str (Str &&obj)
 Move constructor.
 Str (Str &&obj)
 Move constructor.
 Str (Str &source)
 Copy constructor.
 Str (Str &source)
 Copy constructor.
 Str (StrView &source)
 Convert StrView to Str.
 Str (StrView &source)
 Convert StrView to Str.
 ~Str ()
 Destructor.
 ~Str ()
 Destructor.
virtual void add (const char *append)
 adds a string
virtual void add (const char *append)
 adds a string
virtual void add (const char c)
 adds a character
virtual void add (const char c)
 adds a character
virtual void add (double value, int precision=2, int withd=0)
 adds a double value
virtual void add (double value, int precision=2, int withd=0)
 adds a double value
virtual void add (int value)
 adds a int value
virtual void add (int value)
 adds a int value
void allocate (int len=-1)
void allocate (int len=-1)
virtual const char * c_str ()
 provides the string value as const char*
virtual const char * c_str ()
 provides the string value as const char*
size_t capacity ()
size_t capacity ()
void clear () override
 clears and resizes to 0
void clear () override
 clears and resizes to 0
void clear (bool resize)
void clear (bool resize)
virtual bool contains (const char *str)
 checks if the string contains a substring
virtual bool contains (const char *str)
 checks if the string contains a substring
bool containsNumber ()
bool containsNumber ()
void copyFrom (const char *source, int len, int maxlen=0)
 assigns a memory buffer
void copyFrom (const char *source, int len, int maxlen=0)
 assigns a memory buffer
virtual int count (char c, int startPos)
 count number of indicated characters as position
virtual int count (char c, int startPos)
 count number of indicated characters as position
virtual bool endsWith (const char *str)
 checks if the string ends with the indicated substring
virtual bool endsWith (const char *str)
 checks if the string ends with the indicated substring
virtual bool endsWithIgnoreCase (const char *str)
 checks if the string ends with the indicated substring
virtual bool endsWithIgnoreCase (const char *str)
 checks if the string ends with the indicated substring
virtual bool equals (const char *str)
 checks if the string equals indicated parameter string
virtual bool equals (const char *str)
 checks if the string equals indicated parameter string
virtual bool equalsIgnoreCase (const char *alt)
 Compares the string ignoring the case.
virtual bool equalsIgnoreCase (const char *alt)
 Compares the string ignoring the case.
virtual int indexOf (const char *cont, int start=0)
virtual int indexOf (const char *cont, int start=0)
virtual int indexOf (const char c, int start=0)
virtual int indexOf (const char c, int start=0)
virtual void insert (int pos, const char *str)
 inserts a substring into the string
virtual void insert (int pos, const char *str)
 inserts a substring into the string
bool isConst () override
 checks if the string is a constant that must not be changed
bool isConst () override
 checks if the string is a constant that must not be changed
virtual bool isEmpty ()
 checks if the string is empty
virtual bool isEmpty ()
 checks if the string is empty
bool isInteger ()
 Returns true if the string is an integer.
bool isInteger ()
 Returns true if the string is an integer.
bool isNumber ()
bool isNumber ()
bool isOnHeap () override
 checks if the string is on the heap
bool isOnHeap () override
 checks if the string is on the heap
virtual int lastIndexOf (const char *cont)
 provides the position of the last occurrence of the indicated substring
virtual int lastIndexOf (const char *cont)
 provides the position of the last occurrence of the indicated substring
virtual int length ()
virtual int length ()
virtual void ltrim ()
 remove leading spaces
virtual void ltrim ()
 remove leading spaces
virtual bool matches (const char *pattern)
virtual bool matches (const char *pattern)
virtual int maxLength ()
 provides the maximum length of the string
virtual int maxLength ()
 provides the maximum length of the string
virtual int nIndexOf (const char *cont, int n)
 searches for the nth occurence of the indicated character
virtual int nIndexOf (const char *cont, int n)
 searches for the nth occurence of the indicated character
virtual int nIndexOf (const char c, int n)
 searches for the nth occurence of the indicated character
virtual int nIndexOf (const char c, int n)
 searches for the nth occurence of the indicated character
int numberOfDecimals ()
 Determines the number of decimals in the number string.
int numberOfDecimals ()
 Determines the number of decimals in the number string.
virtual bool operator!= (const char *alt) const
 checks if the indicated string is different from the current string
virtual bool operator!= (const char *alt) const
 checks if the indicated string is different from the current string
virtual bool operator!= (const StrView &alt) const
 checks if the indicated string is different from the current string
virtual bool operator!= (const StrView &alt) const
 checks if the indicated string is different from the current string
virtual void operator+= (const char *str)
 adds a substring at the end of the string
virtual void operator+= (const char *str)
 adds a substring at the end of the string
virtual void operator+= (const char value)
 adds a character
virtual void operator+= (const char value)
 adds a character
virtual void operator+= (double value)
 adds a double at the end of the string
virtual void operator+= (double value)
 adds a double at the end of the string
virtual void operator+= (int value)
 adds a int at the end of the string
virtual void operator+= (int value)
 adds a int at the end of the string
virtual void operator<< (int n)
 shift characters to the left -> we just move the pointer
virtual void operator<< (int n)
 shift characters to the left -> we just move the pointer
void operator= (char *str) override
 we can assign a char*
void operator= (char *str) override
 we can assign a char*
void operator= (const char *str) override
 we can assign a const char*
void operator= (const char *str) override
 we can assign a const char*
void operator= (double v) override
 we can assign a double
void operator= (double v) override
 we can assign a double
void operator= (int v) override
 we can assign an int
void operator= (int v) override
 we can assign an int
Str & operator= (Str &&obj)
 Move assignment.
Str & operator= (Str &&obj)
 Move assignment.
Str & operator= (Str &obj)
 Copy assingment.
Str & operator= (Str &obj)
 Copy assingment.
virtual bool operator== (const char *alt) const
 checks if the indicated string is equal to the current string
virtual bool operator== (const char *alt) const
 checks if the indicated string is equal to the current string
virtual bool operator== (const StrView &alt) const
 checks if the indicated string is equal to the current string
virtual bool operator== (const StrView &alt) const
 checks if the indicated string is equal to the current string
virtual char operator[] (int index)
virtual char operator[] (int index)
virtual const char * printf (const char *fmt,...)
virtual const char * printf (const char *fmt,...)
virtual void remove (const char *toRemove)
 removes the indicated substring from the string
virtual void remove (const char *toRemove)
 removes the indicated substring from the string
virtual void removeAll (const char *toRemove)
 removes the indicated substring from the string
virtual void removeAll (const char *toRemove)
 removes the indicated substring from the string
virtual bool replace (const char *toReplace, const char *replaced)
 Replaces the first instance of toReplace with replaced.
virtual bool replace (const char *toReplace, const char *replaced)
 Replaces the first instance of toReplace with replaced.
virtual bool replaceAll (const char *toReplace, const char *replaced)
 Replaces all instances of toReplace with replaced.
virtual bool replaceAll (const char *toReplace, const char *replaced)
 Replaces all instances of toReplace with replaced.
virtual void rtrim ()
 remove trailing spaces
virtual void rtrim ()
 remove trailing spaces
virtual void set (char chars[], int maxlen, int len=0, bool isConst=false)
 assigns a memory buffer
virtual void set (char chars[], int maxlen, int len=0, bool isConst=false)
 assigns a memory buffer
virtual void set (const char *alt)
 assigs a value
virtual void set (const char *alt)
 assigs a value
virtual void set (const char c)
virtual void set (const char c)
virtual void set (const StrView &alt)
 assigs from another Str value
virtual void set (const StrView &alt)
 assigs from another Str value
virtual void set (double value, int precision=2, int withd=0)
virtual void set (double value, int precision=2, int withd=0)
virtual void set (int value)
virtual void set (int value)
void setCapacity (size_t newLen)
void setCapacity (size_t newLen)
void setChars (char c, int len)
 Fills the string with len chars.
void setChars (char c, int len)
 Fills the string with len chars.
virtual void setLength (int len, bool addZero=true)
 limits the length of the string (by adding a delimiting 0)
virtual void setLength (int len, bool addZero=true)
 limits the length of the string (by adding a delimiting 0)
virtual void setLengthUndo ()
 undo the last setLength call
virtual void setLengthUndo ()
 undo the last setLength call
virtual bool startsWith (const char *str)
 checks if the string starts with the indicated substring
virtual bool startsWith (const char *str)
 checks if the string starts with the indicated substring
virtual void substring (const char *from, int start, int end)
 copies a substring into the current string
virtual void substring (const char *from, int start, int end)
 copies a substring into the current string
virtual void substring (StrView &from, int start, int end)
 copies a substring into the current string
virtual void substring (StrView &from, int start, int end)
 copies a substring into the current string
void swap (Str &other)
void swap (Str &other)
virtual void swap (StrView &str)
double toDouble ()
 Converts the string to a double.
double toDouble ()
 Converts the string to a double.
float toFloat ()
 Converts the string to a float.
float toFloat ()
 Converts the string to a float.
int toInt ()
 Converts the string to an int.
int toInt ()
 Converts the string to an int.
long toLong ()
 Converts the string to an long.
long toLong ()
 Converts the string to an long.
void toLowerCase ()
 Converts the string to lowercase letters.
void toLowerCase ()
 Converts the string to lowercase letters.
void toUpperCase ()
 Converts the string to uppercase letters.
void toUpperCase ()
 Converts the string to uppercase letters.
virtual void trim ()
 remove leading and traling spaces
virtual void trim ()
 remove leading and traling spaces
void urlDecode ()
 decodes a url encoded string
void urlDecode ()
 decodes a url encoded string
void urlEncode ()
 url encode the string
void urlEncode ()
 url encode the string

Static Public Member Functions

static const char * toBinary (void const *const ptr, size_t const size)
 provides a binary string represntation
static const char * toBinary (void const *const ptr, size_t const size)
 provides a binary string represntation

Protected Member Functions

char charToInt (char ch)
char charToInt (char ch)
bool grow (int newMaxLen) override
 only supported in subclasses
bool grow (int newMaxLen) override
 only supported in subclasses
Str & move (Str &other)
Str & move (Str &other)
char strToBin (char *pString)
char strToBin (char *pString)
void urlEncodeChar (char c, char *result, int maxLen)
void urlEncodeChar (char c, char *result, int maxLen)

Static Protected Member Functions

static char * floatToString (char *outstr, double val, int precision, int widthp)
static char * floatToString (char *outstr, double val, int precision, int widthp)
static char * itoa (int n, char s[])
static char * itoa (int n, char s[])
static bool matchesGlob (const char *line, const char *pattern)
static bool matchesGlob (const char *line, const char *pattern)
static void reverse (char s[])
static void reverse (char s[])
static int strncmp_i (const char *s1, const char *s2, int n)
static int strncmp_i (const char *s1, const char *s2, int n)

Protected Attributes

char * chars = nullptr
bool is_const = false
int len = 0
int maxlen = 0
char savedChar
int savedLen = -1
Vector< char > vector

Detailed Description

Str which keeps the data on the heap. We grow the allocated memory only if the copy source is not fitting.

While it should be avoided to use a lot of heap allocatioins in embedded devices it is sometimes more convinent to allocate a string once on the heap and have the insurance that it might grow if we need to process an unexpected size.

We also need to use this if we want to manage a vecor of strings.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ Str() [1/12]

Str ( )
default

◆ Str() [2/12]

Str ( int initialAllocatedLength)
inline

◆ Str() [3/12]

Str ( const char * str)
inline

◆ Str() [4/12]

Str ( StrView & source)
inline

Convert StrView to Str.

◆ Str() [5/12]

Str ( Str & source)
inline

Copy constructor.

◆ Str() [6/12]

Str ( Str && obj)
inline

Move constructor.

◆ ~Str() [1/2]

~Str ( )
inline

Destructor.

◆ Str() [7/12]

Str ( )
default

◆ Str() [8/12]

Str ( int initialAllocatedLength)
inline

◆ Str() [9/12]

Str ( const char * str)
inline

◆ Str() [10/12]

Str ( StrView & source)
inline

Convert StrView to Str.

◆ Str() [11/12]

Str ( Str & source)
inline

Copy constructor.

◆ Str() [12/12]

Str ( Str && obj)
inline

Move constructor.

◆ ~Str() [2/2]

~Str ( )
inline

Destructor.

Member Function Documentation

◆ add() [1/8]

virtual void add ( const char * append)
inlinevirtualinherited

adds a string

◆ add() [2/8]

virtual void add ( const char * append)
inlinevirtualinherited

adds a string

◆ add() [3/8]

virtual void add ( const char c)
inlinevirtualinherited

adds a character

◆ add() [4/8]

virtual void add ( const char c)
inlinevirtualinherited

adds a character

◆ add() [5/8]

virtual void add ( double value,
int precision = 2,
int withd = 0 )
inlinevirtualinherited

adds a double value

◆ add() [6/8]

virtual void add ( double value,
int precision = 2,
int withd = 0 )
inlinevirtualinherited

adds a double value

◆ add() [7/8]

virtual void add ( int value)
inlinevirtualinherited

adds a int value

◆ add() [8/8]

virtual void add ( int value)
inlinevirtualinherited

adds a int value

◆ allocate() [1/2]

void allocate ( int len = -1)
inline

◆ allocate() [2/2]

void allocate ( int len = -1)
inline

◆ c_str() [1/2]

virtual const char * c_str ( )
inlinevirtualinherited

provides the string value as const char*

◆ c_str() [2/2]

virtual const char * c_str ( )
inlinevirtualinherited

provides the string value as const char*

◆ capacity() [1/2]

size_t capacity ( )
inline

◆ capacity() [2/2]

size_t capacity ( )
inline

◆ charToInt() [1/2]

char charToInt ( char ch)
inlineprotected

◆ charToInt() [2/2]

char charToInt ( char ch)
inlineprotected

◆ clear() [1/4]

void clear ( )
inlineoverridevirtual

clears and resizes to 0

Reimplemented from StrView.

◆ clear() [2/4]

void clear ( )
inlineoverridevirtual

clears and resizes to 0

Reimplemented from StrView.

◆ clear() [3/4]

void clear ( bool resize)
inline

◆ clear() [4/4]

void clear ( bool resize)
inline

◆ contains() [1/2]

virtual bool contains ( const char * str)
inlinevirtualinherited

checks if the string contains a substring

◆ contains() [2/2]

virtual bool contains ( const char * str)
inlinevirtualinherited

checks if the string contains a substring

◆ containsNumber() [1/2]

bool containsNumber ( )
inlineinherited

◆ containsNumber() [2/2]

bool containsNumber ( )
inlineinherited

◆ copyFrom() [1/2]

void copyFrom ( const char * source,
int len,
int maxlen = 0 )
inline

assigns a memory buffer

◆ copyFrom() [2/2]

void copyFrom ( const char * source,
int len,
int maxlen = 0 )
inline

assigns a memory buffer

◆ count() [1/2]

virtual int count ( char c,
int startPos )
inlinevirtualinherited

count number of indicated characters as position

◆ count() [2/2]

virtual int count ( char c,
int startPos )
inlinevirtualinherited

count number of indicated characters as position

◆ endsWith() [1/2]

virtual bool endsWith ( const char * str)
inlinevirtualinherited

checks if the string ends with the indicated substring

◆ endsWith() [2/2]

virtual bool endsWith ( const char * str)
inlinevirtualinherited

checks if the string ends with the indicated substring

◆ endsWithIgnoreCase() [1/2]

virtual bool endsWithIgnoreCase ( const char * str)
inlinevirtualinherited

checks if the string ends with the indicated substring

◆ endsWithIgnoreCase() [2/2]

virtual bool endsWithIgnoreCase ( const char * str)
inlinevirtualinherited

checks if the string ends with the indicated substring

◆ equals() [1/2]

virtual bool equals ( const char * str)
inlinevirtualinherited

checks if the string equals indicated parameter string

◆ equals() [2/2]

virtual bool equals ( const char * str)
inlinevirtualinherited

checks if the string equals indicated parameter string

◆ equalsIgnoreCase() [1/2]

virtual bool equalsIgnoreCase ( const char * alt)
inlinevirtualinherited

Compares the string ignoring the case.

◆ equalsIgnoreCase() [2/2]

virtual bool equalsIgnoreCase ( const char * alt)
inlinevirtualinherited

Compares the string ignoring the case.

◆ floatToString() [1/2]

char * floatToString ( char * outstr,
double val,
int precision,
int widthp )
inlinestaticprotectedinherited

compute the rounding factor and fractional multiplier

print the decimal point

generate space padding

◆ floatToString() [2/2]

char * floatToString ( char * outstr,
double val,
int precision,
int widthp )
inlinestaticprotectedinherited

compute the rounding factor and fractional multiplier

print the decimal point

generate space padding

◆ grow() [1/2]

bool grow ( int newMaxLen)
inlineoverrideprotectedvirtual

only supported in subclasses

Reimplemented from StrView.

◆ grow() [2/2]

bool grow ( int newMaxLen)
inlineoverrideprotectedvirtual

only supported in subclasses

Reimplemented from StrView.

◆ indexOf() [1/4]

virtual int indexOf ( const char * cont,
int start = 0 )
inlinevirtualinherited

provides the position of the the indicated substring after the indicated start position

◆ indexOf() [2/4]

virtual int indexOf ( const char * cont,
int start = 0 )
inlinevirtualinherited

provides the position of the the indicated substring after the indicated start position

◆ indexOf() [3/4]

virtual int indexOf ( const char c,
int start = 0 )
inlinevirtualinherited

provides the position of the the indicated character after the indicated start position

◆ indexOf() [4/4]

virtual int indexOf ( const char c,
int start = 0 )
inlinevirtualinherited

provides the position of the the indicated character after the indicated start position

◆ insert() [1/2]

virtual void insert ( int pos,
const char * str )
inlinevirtualinherited

inserts a substring into the string

◆ insert() [2/2]

virtual void insert ( int pos,
const char * str )
inlinevirtualinherited

inserts a substring into the string

◆ isConst() [1/2]

bool isConst ( )
inlineoverridevirtual

checks if the string is a constant that must not be changed

Reimplemented from StrView.

◆ isConst() [2/2]

bool isConst ( )
inlineoverridevirtual

checks if the string is a constant that must not be changed

Reimplemented from StrView.

◆ isEmpty() [1/2]

virtual bool isEmpty ( )
inlinevirtualinherited

checks if the string is empty

◆ isEmpty() [2/2]

virtual bool isEmpty ( )
inlinevirtualinherited

checks if the string is empty

◆ isInteger() [1/2]

bool isInteger ( )
inlineinherited

Returns true if the string is an integer.

◆ isInteger() [2/2]

bool isInteger ( )
inlineinherited

Returns true if the string is an integer.

◆ isNumber() [1/2]

bool isNumber ( )
inlineinherited

◆ isNumber() [2/2]

bool isNumber ( )
inlineinherited

◆ isOnHeap() [1/2]

bool isOnHeap ( )
inlineoverridevirtual

checks if the string is on the heap

Reimplemented from StrView.

◆ isOnHeap() [2/2]

bool isOnHeap ( )
inlineoverridevirtual

checks if the string is on the heap

Reimplemented from StrView.

◆ itoa() [1/2]

char * itoa ( int n,
char s[] )
inlinestaticprotectedinherited

◆ itoa() [2/2]

char * itoa ( int n,
char s[] )
inlinestaticprotectedinherited

◆ lastIndexOf() [1/2]

virtual int lastIndexOf ( const char * cont)
inlinevirtualinherited

provides the position of the last occurrence of the indicated substring

◆ lastIndexOf() [2/2]

virtual int lastIndexOf ( const char * cont)
inlinevirtualinherited

provides the position of the last occurrence of the indicated substring

◆ length() [1/2]

virtual int length ( )
inlinevirtualinherited

provides the current length (filled with characters) of the string - excluding the terminating 0

◆ length() [2/2]

virtual int length ( )
inlinevirtualinherited

provides the current length (filled with characters) of the string - excluding the terminating 0

◆ ltrim() [1/2]

virtual void ltrim ( )
inlinevirtualinherited

remove leading spaces

◆ ltrim() [2/2]

virtual void ltrim ( )
inlinevirtualinherited

remove leading spaces

◆ matches() [1/2]

virtual bool matches ( const char * pattern)
inlinevirtualinherited

file matching supporting * and ?, with multiple alternative patterns separated by ',', ';' or '|' (e.g. "*.mp3;*.MP3;*.wav") - returns true if the string matches any one of the alternatives. Replaces regex, which is not supported in all environments.

◆ matches() [2/2]

virtual bool matches ( const char * pattern)
inlinevirtualinherited

file matching supporting * and ?, with multiple alternative patterns separated by ',', ';' or '|' (e.g. "*.mp3;*.MP3;*.wav") - returns true if the string matches any one of the alternatives. Replaces regex, which is not supported in all environments.

◆ matchesGlob() [1/2]

bool matchesGlob ( const char * line,
const char * pattern )
inlinestaticprotectedinherited

matches a single glob pattern (supporting * and ?, no alternatives) against the given line.

returns 1 (true) if there is a match returns 0 if the pattern is not whitin the line

the line is ended but char was expected

try to restart the mask on the rest

◆ matchesGlob() [2/2]

bool matchesGlob ( const char * line,
const char * pattern )
inlinestaticprotectedinherited

matches a single glob pattern (supporting * and ?, no alternatives) against the given line.

returns 1 (true) if there is a match returns 0 if the pattern is not whitin the line

the line is ended but char was expected

try to restart the mask on the rest

◆ maxLength() [1/2]

virtual int maxLength ( )
inlinevirtualinherited

provides the maximum length of the string

◆ maxLength() [2/2]

virtual int maxLength ( )
inlinevirtualinherited

provides the maximum length of the string

◆ move() [1/2]

Str & move ( Str & other)
inlineprotected

◆ move() [2/2]

Str & move ( Str & other)
inlineprotected

◆ nIndexOf() [1/4]

virtual int nIndexOf ( const char * cont,
int n )
inlinevirtualinherited

searches for the nth occurence of the indicated character

◆ nIndexOf() [2/4]

virtual int nIndexOf ( const char * cont,
int n )
inlinevirtualinherited

searches for the nth occurence of the indicated character

◆ nIndexOf() [3/4]

virtual int nIndexOf ( const char c,
int n )
inlinevirtualinherited

searches for the nth occurence of the indicated character

◆ nIndexOf() [4/4]

virtual int nIndexOf ( const char c,
int n )
inlinevirtualinherited

searches for the nth occurence of the indicated character

◆ numberOfDecimals() [1/2]

int numberOfDecimals ( )
inlineinherited

Determines the number of decimals in the number string.

◆ numberOfDecimals() [2/2]

int numberOfDecimals ( )
inlineinherited

Determines the number of decimals in the number string.

◆ operator!=() [1/4]

virtual bool operator!= ( const char * alt) const
inlinevirtualinherited

checks if the indicated string is different from the current string

◆ operator!=() [2/4]

virtual bool operator!= ( const char * alt) const
inlinevirtualinherited

checks if the indicated string is different from the current string

◆ operator!=() [3/4]

virtual bool operator!= ( const StrView & alt) const
inlinevirtualinherited

checks if the indicated string is different from the current string

◆ operator!=() [4/4]

virtual bool operator!= ( const StrView & alt) const
inlinevirtualinherited

checks if the indicated string is different from the current string

◆ operator+=() [1/8]

virtual void operator+= ( const char * str)
inlinevirtualinherited

adds a substring at the end of the string

◆ operator+=() [2/8]

virtual void operator+= ( const char * str)
inlinevirtualinherited

adds a substring at the end of the string

◆ operator+=() [3/8]

virtual void operator+= ( const char value)
inlinevirtualinherited

adds a character

◆ operator+=() [4/8]

virtual void operator+= ( const char value)
inlinevirtualinherited

adds a character

◆ operator+=() [5/8]

virtual void operator+= ( double value)
inlinevirtualinherited

adds a double at the end of the string

◆ operator+=() [6/8]

virtual void operator+= ( double value)
inlinevirtualinherited

adds a double at the end of the string

◆ operator+=() [7/8]

virtual void operator+= ( int value)
inlinevirtualinherited

adds a int at the end of the string

◆ operator+=() [8/8]

virtual void operator+= ( int value)
inlinevirtualinherited

adds a int at the end of the string

◆ operator<<() [1/2]

virtual void operator<< ( int n)
inlinevirtualinherited

shift characters to the left -> we just move the pointer

◆ operator<<() [2/2]

virtual void operator<< ( int n)
inlinevirtualinherited

shift characters to the left -> we just move the pointer

◆ operator=() [1/12]

void operator= ( char * str)
inlineoverridevirtual

we can assign a char*

Reimplemented from StrView.

◆ operator=() [2/12]

void operator= ( char * str)
inlineoverridevirtual

we can assign a char*

Reimplemented from StrView.

◆ operator=() [3/12]

void operator= ( const char * str)
inlineoverridevirtual

we can assign a const char*

Reimplemented from StrView.

◆ operator=() [4/12]

void operator= ( const char * str)
inlineoverridevirtual

we can assign a const char*

Reimplemented from StrView.

◆ operator=() [5/12]

void operator= ( double val)
inlineoverridevirtual

we can assign a double

Reimplemented from StrView.

◆ operator=() [6/12]

void operator= ( double val)
inlineoverridevirtual

we can assign a double

Reimplemented from StrView.

◆ operator=() [7/12]

void operator= ( int value)
inlineoverridevirtual

we can assign an int

Reimplemented from StrView.

◆ operator=() [8/12]

void operator= ( int value)
inlineoverridevirtual

we can assign an int

Reimplemented from StrView.

◆ operator=() [9/12]

Str & operator= ( Str && obj)
inline

Move assignment.

◆ operator=() [10/12]

Str & operator= ( Str && obj)
inline

Move assignment.

◆ operator=() [11/12]

Str & operator= ( Str & obj)
inline

Copy assingment.

◆ operator=() [12/12]

Str & operator= ( Str & obj)
inline

Copy assingment.

◆ operator==() [1/4]

virtual bool operator== ( const char * alt) const
inlinevirtualinherited

checks if the indicated string is equal to the current string

◆ operator==() [2/4]

virtual bool operator== ( const char * alt) const
inlinevirtualinherited

checks if the indicated string is equal to the current string

◆ operator==() [3/4]

virtual bool operator== ( const StrView & alt) const
inlinevirtualinherited

checks if the indicated string is equal to the current string

◆ operator==() [4/4]

virtual bool operator== ( const StrView & alt) const
inlinevirtualinherited

checks if the indicated string is equal to the current string

◆ operator[]() [1/2]

virtual char operator[] ( int index)
inlinevirtualinherited

◆ operator[]() [2/2]

virtual char operator[] ( int index)
inlinevirtualinherited

◆ printf() [1/2]

virtual const char * printf ( const char * fmt,
... )
inlinevirtualinherited

replaces the content with the result of a printf-style formatted string and returns the resulting c-string - e.g. for direct use in Print::println(). If the resulting text does not fit into the available capacity it is truncated (like snprintf).

◆ printf() [2/2]

virtual const char * printf ( const char * fmt,
... )
inlinevirtualinherited

replaces the content with the result of a printf-style formatted string and returns the resulting c-string - e.g. for direct use in Print::println(). If the resulting text does not fit into the available capacity it is truncated (like snprintf).

◆ remove() [1/2]

virtual void remove ( const char * toRemove)
inlinevirtualinherited

removes the indicated substring from the string

◆ remove() [2/2]

virtual void remove ( const char * toRemove)
inlinevirtualinherited

removes the indicated substring from the string

◆ removeAll() [1/2]

virtual void removeAll ( const char * toRemove)
inlinevirtualinherited

removes the indicated substring from the string

◆ removeAll() [2/2]

virtual void removeAll ( const char * toRemove)
inlinevirtualinherited

removes the indicated substring from the string

◆ replace() [1/2]

virtual bool replace ( const char * toReplace,
const char * replaced )
inlinevirtualinherited

Replaces the first instance of toReplace with replaced.

◆ replace() [2/2]

virtual bool replace ( const char * toReplace,
const char * replaced )
inlinevirtualinherited

Replaces the first instance of toReplace with replaced.

◆ replaceAll() [1/2]

virtual bool replaceAll ( const char * toReplace,
const char * replaced )
inlinevirtualinherited

Replaces all instances of toReplace with replaced.

◆ replaceAll() [2/2]

virtual bool replaceAll ( const char * toReplace,
const char * replaced )
inlinevirtualinherited

Replaces all instances of toReplace with replaced.

◆ reverse() [1/2]

void reverse ( char s[])
inlinestaticprotectedinherited

◆ reverse() [2/2]

void reverse ( char s[])
inlinestaticprotectedinherited

◆ rtrim() [1/2]

virtual void rtrim ( )
inlinevirtualinherited

remove trailing spaces

◆ rtrim() [2/2]

virtual void rtrim ( )
inlinevirtualinherited

remove trailing spaces

◆ set() [1/12]

virtual void set ( char chars[],
int maxlen,
int len = 0,
bool isConst = false )
inlinevirtualinherited

assigns a memory buffer

◆ set() [2/12]

virtual void set ( char chars[],
int maxlen,
int len = 0,
bool isConst = false )
inlinevirtualinherited

assigns a memory buffer

◆ set() [3/12]

virtual void set ( const char * alt)
inlinevirtualinherited

assigs a value

if the Str is a const we replace the pointer

if the Str is an external buffer we need to copy: clamp to the available capacity so a source longer than maxlen can't overflow it

◆ set() [4/12]

virtual void set ( const char * alt)
inlinevirtualinherited

assigs a value

if the Str is a const we replace the pointer

if the Str is an external buffer we need to copy: clamp to the available capacity so a source longer than maxlen can't overflow it

◆ set() [5/12]

virtual void set ( const char c)
inlinevirtualinherited

◆ set() [6/12]

virtual void set ( const char c)
inlinevirtualinherited

◆ set() [7/12]

virtual void set ( const StrView & alt)
inlinevirtualinherited

assigs from another Str value

if the Str is a const we replace the pointer

if the Str is an external buffer we need to copy: clamp to the available capacity so a source longer than maxlen can't overflow it

◆ set() [8/12]

virtual void set ( const StrView & alt)
inlinevirtualinherited

assigs from another Str value

if the Str is a const we replace the pointer

if the Str is an external buffer we need to copy: clamp to the available capacity so a source longer than maxlen can't overflow it

◆ set() [9/12]

virtual void set ( double value,
int precision = 2,
int withd = 0 )
inlinevirtualinherited

◆ set() [10/12]

virtual void set ( double value,
int precision = 2,
int withd = 0 )
inlinevirtualinherited

◆ set() [11/12]

virtual void set ( int value)
inlinevirtualinherited

◆ set() [12/12]

virtual void set ( int value)
inlinevirtualinherited

◆ setCapacity() [1/2]

void setCapacity ( size_t newLen)
inline

◆ setCapacity() [2/2]

void setCapacity ( size_t newLen)
inline

◆ setChars() [1/2]

void setChars ( char c,
int len )
inline

Fills the string with len chars.

◆ setChars() [2/2]

void setChars ( char c,
int len )
inline

Fills the string with len chars.

◆ setLength() [1/2]

virtual void setLength ( int len,
bool addZero = true )
inlinevirtualinherited

limits the length of the string (by adding a delimiting 0)

◆ setLength() [2/2]

virtual void setLength ( int len,
bool addZero = true )
inlinevirtualinherited

limits the length of the string (by adding a delimiting 0)

◆ setLengthUndo() [1/2]

virtual void setLengthUndo ( )
inlinevirtualinherited

undo the last setLength call

◆ setLengthUndo() [2/2]

virtual void setLengthUndo ( )
inlinevirtualinherited

undo the last setLength call

◆ startsWith() [1/2]

virtual bool startsWith ( const char * str)
inlinevirtualinherited

checks if the string starts with the indicated substring

◆ startsWith() [2/2]

virtual bool startsWith ( const char * str)
inlinevirtualinherited

checks if the string starts with the indicated substring

◆ strncmp_i() [1/2]

int strncmp_i ( const char * s1,
const char * s2,
int n )
inlinestaticprotectedinherited

◆ strncmp_i() [2/2]

int strncmp_i ( const char * s1,
const char * s2,
int n )
inlinestaticprotectedinherited

◆ strToBin() [1/2]

char strToBin ( char * pString)
inlineprotected

◆ strToBin() [2/2]

char strToBin ( char * pString)
inlineprotected

◆ substring() [1/4]

virtual void substring ( const char * from,
int start,
int end )
inlinevirtualinherited

copies a substring into the current string

◆ substring() [2/4]

virtual void substring ( const char * from,
int start,
int end )
inlinevirtualinherited

copies a substring into the current string

◆ substring() [3/4]

virtual void substring ( StrView & from,
int start,
int end )
inlinevirtualinherited

copies a substring into the current string

◆ substring() [4/4]

virtual void substring ( StrView & from,
int start,
int end )
inlinevirtualinherited

copies a substring into the current string

◆ swap() [1/3]

void swap ( Str & other)
inline

◆ swap() [2/3]

void swap ( Str & other)
inline

◆ swap() [3/3]

virtual void swap ( StrView & str)
inlinevirtualinherited

◆ toBinary() [1/2]

const char * toBinary ( void const *const ptr,
size_t const size )
inlinestaticinherited

provides a binary string represntation

◆ toBinary() [2/2]

const char * toBinary ( void const *const ptr,
size_t const size )
inlinestaticinherited

provides a binary string represntation

◆ toDouble() [1/2]

double toDouble ( )
inlineinherited

Converts the string to a double.

◆ toDouble() [2/2]

double toDouble ( )
inlineinherited

Converts the string to a double.

◆ toFloat() [1/2]

float toFloat ( )
inlineinherited

Converts the string to a float.

◆ toFloat() [2/2]

float toFloat ( )
inlineinherited

Converts the string to a float.

◆ toInt() [1/2]

int toInt ( )
inlineinherited

Converts the string to an int.

◆ toInt() [2/2]

int toInt ( )
inlineinherited

Converts the string to an int.

◆ toLong() [1/2]

long toLong ( )
inlineinherited

Converts the string to an long.

◆ toLong() [2/2]

long toLong ( )
inlineinherited

Converts the string to an long.

◆ toLowerCase() [1/2]

void toLowerCase ( )
inlineinherited

Converts the string to lowercase letters.

◆ toLowerCase() [2/2]

void toLowerCase ( )
inlineinherited

Converts the string to lowercase letters.

◆ toUpperCase() [1/2]

void toUpperCase ( )
inlineinherited

Converts the string to uppercase letters.

◆ toUpperCase() [2/2]

void toUpperCase ( )
inlineinherited

Converts the string to uppercase letters.

◆ trim() [1/2]

virtual void trim ( )
inlinevirtualinherited

remove leading and traling spaces

◆ trim() [2/2]

virtual void trim ( )
inlinevirtualinherited

remove leading and traling spaces

◆ urlDecode() [1/2]

void urlDecode ( )
inline

decodes a url encoded string

◆ urlDecode() [2/2]

void urlDecode ( )
inline

decodes a url encoded string

◆ urlEncode() [1/2]

void urlEncode ( )
inline

url encode the string

◆ urlEncode() [2/2]

void urlEncode ( )
inline

url encode the string

◆ urlEncodeChar() [1/2]

void urlEncodeChar ( char c,
char * result,
int maxLen )
inlineprotected

◆ urlEncodeChar() [2/2]

void urlEncodeChar ( char c,
char * result,
int maxLen )
inlineprotected

Member Data Documentation

◆ chars

char * chars = nullptr
protectedinherited

◆ is_const

bool is_const = false
protectedinherited

◆ len

int len = 0
protectedinherited

◆ maxlen

int maxlen = 0
protectedinherited

◆ savedChar

char savedChar
protectedinherited

◆ savedLen

int savedLen = -1
protectedinherited

◆ vector

Vector< char > vector
protected

The documentation for this class was generated from the following files: