Class to manage a double null-terminated list of strings, such as "one\0two\0three\0".
More...
#include <CStringArray.h>
Class to manage a double null-terminated list of strings, such as "one\0two\0three\0".
◆ CStringArray() [1/5]
CStringArray::CStringArray |
( |
const String & |
str | ) |
|
|
inline |
◆ CStringArray() [2/5]
CStringArray::CStringArray |
( |
const char * |
cstr = nullptr | ) |
|
|
inline |
◆ CStringArray() [3/5]
CStringArray::CStringArray |
( |
const char * |
cstr, |
|
|
unsigned int |
length |
|
) |
| |
|
inline |
◆ CStringArray() [4/5]
◆ CStringArray() [5/5]
◆ add() [1/2]
bool CStringArray::add |
( |
const char * |
str, |
|
|
int |
length = -1 |
|
) |
| |
Append a new string (or array of strings) to the end of the array.
- Parameters
-
str | |
length | Length of new string in array (default is length of str) |
- Return values
-
bool | false on memory allocation error |
- Note
- If str contains any NUL characters it will be handled as an array
◆ add() [2/2]
Append a new string (or array of strings) to the end of the array.
- Parameters
-
- Return values
-
bool | false on memory allocation error |
- Note
- If str contains any NUL characters it will be handled as an array
◆ begin()
◆ clear()
void CStringArray::clear |
( |
| ) |
|
|
inline |
◆ contains() [1/2]
bool CStringArray::contains |
( |
const char * |
str, |
|
|
bool |
ignoreCase = true |
|
) |
| const |
|
inline |
Check if array contains a string.
- Parameters
-
str | String to search for |
ignoreCase | Whether search is case-sensitive or not |
- Return values
-
bool | True if string exists in array |
- Note
- Search is not case-sensitive
◆ contains() [2/2]
bool CStringArray::contains |
( |
const String & |
str, |
|
|
bool |
ignoreCase = true |
|
) |
| const |
|
inline |
Check if array contains a string.
- Parameters
-
str | String to search for |
ignoreCase | Whether search is case-sensitive or not |
- Return values
-
bool | True if string exists in array |
- Note
- Search is not case-sensitive
◆ count()
unsigned CStringArray::count |
( |
| ) |
const |
Get quantity of strings in array.
- Return values
-
unsigned | Quantity of strings |
◆ end()
◆ getValue()
const char* CStringArray::getValue |
( |
unsigned |
index | ) |
const |
Get string at the given position.
- Parameters
-
index | 0-based index of string to obtain |
- Return values
-
const | char* nullptr if index is not valid |
◆ indexOf() [1/2]
int CStringArray::indexOf |
( |
const char * |
str, |
|
|
bool |
ignoreCase = true |
|
) |
| const |
Find the given string and return its index.
- Parameters
-
str | String to find |
ignoreCase | Whether search is case-sensitive or not |
- Return values
-
int | index of given string, -1 if not found |
- Note
- Comparison is not case-sensitive
◆ indexOf() [2/2]
int CStringArray::indexOf |
( |
const String & |
str, |
|
|
bool |
ignoreCase = true |
|
) |
| const |
|
inline |
Find the given string and return its index.
- Parameters
-
str | String to find |
ignoreCase | Whether search is case-sensitive or not |
- Return values
-
int | index of given string, -1 if not found |
- Note
- Comparison is not case-sensitive
◆ operator+=() [1/3]
◆ operator+=() [2/3]
◆ operator+=() [3/3]
Append numbers, etc. to the array.
- Parameters
-
value | char, int, float, etc. as supported by String |
◆ operator=()
◆ operator[]()
const char* CStringArray::operator[] |
( |
unsigned |
index | ) |
const |
|
inline |
Get string at the given position.
- Parameters
-
index | 0-based index of string to obtain |
- Return values
-
const | char* nullptr if index is not valid |
The documentation for this class was generated from the following file: