GeneralUtils¶
General utilities.
詳細情報¶
メンバー¶
base64Decode()¶
Decode a chunk of data that is encoded.
bool GeneralUtils::base64Decode(const std::string &in, std::string *out)
引数
- const&
in
The string to be decoded. - std::string*
out
The resulting data.
戻り値
bool
base64Encode()¶
Encode a string into base 64.
bool GeneralUtils::base64Encode(const std::string &in, std::string *out)
引数
- const&
in
- std::string*
out
戻り値
bool
dumpInfo()¶
Dump general info to the log. Data includes:
void GeneralUtils::dumpInfo()
endsWith()¶
Does the string end with a specific character?
bool GeneralUtils::endsWith(std::string str, char c)
引数
- std::string
str
The string to examine. - char
c
The character to look form.
戻り値
bool True if the string ends with the given character.
errorToString()¶
Convert an ESP error code to a string.
const char * GeneralUtils::errorToString(esp_err_t errCode)
引数
- esp_err_t
errCode
The errCode to be converted.
戻り値
constchar * A string representation of the error code.
wifiErrorToString()¶
Convert a wifi_err_reason_t code to a string.
const char * GeneralUtils::wifiErrorToString(uint8_t value)
引数
- uint8_t
value
戻り値
constchar * A string representation of the error code.
hexDump()¶
Dump a representation of binary data to the console.
void GeneralUtils::hexDump(const uint8_t *pData, uint32_t length)
引数
- const*
pData
Pointer to the start of data to be logged. - uint32_t
length
Length of the data (in bytes) to be logged.
ipToString()¶
Convert an IP address to string.
std::string GeneralUtils::ipToString(uint8_t *ip)
引数
- uint8_t*
ip
The 4 byte IP address.
戻り値
std::string A string representation of the IP address.
split()¶
Split a string into parts based on a delimiter.
std::vector< std::string > GeneralUtils::split(std::string source, char delimiter)
引数
- std::string
source
The source string to split. - char
delimiter
The delimiter characters.
戻り値
std::stringstd::vector< > A vector of strings that are the split of the input.
toLower()¶
Convert a string to lower case.
std::string GeneralUtils::toLower(std::string &value)
引数
- std::string&
value
The string to convert to lower case.
戻り値
std::string A lower case representation of the string.
trim()¶
Remove white space from a string.
std::string GeneralUtils::trim(const std::string &str)
引数
- const&
str
戻り値
std::string