C++ counterparts of SPL native functions that deal with string operations. More...
C++ counterparts of SPL native functions that deal with string operations.
|
inline |
Get the length of a string (the number of raw bytes).
str | Input string. |
|
inline |
Get the length of a string (the number of raw bytes).
str | Input string. |
|
inline |
Get the length of a string (the number of logical characters).
str | Input string. |
|
inline |
Convert a string to lowercase.
str | Input string. |
|
inline |
Convert a string to lowercase.
str | Input string. |
|
inline |
Convert a string to lowercase.
str | Input string. |
|
inline |
Convert a string to uppercase.
str | Input string. |
|
inline |
Convert a string to uppercase.
str | Input string. |
|
inline |
Convert a string to uppercase.
str | Input string. |
SPL::rstring SPL::Functions::String::trim | ( | const SPL::rstring & | str, |
const SPL::rstring & | t | ||
) |
Remove the leading and trailing characters from a string.
str | Input string. |
t | Characters to be removed from both sides of the input string. |
t
removed.
|
inline |
SPL::ustring SPL::Functions::String::trim | ( | const SPL::ustring & | str, |
const SPL::ustring & | t | ||
) |
Remove the leading and trailing characters from a string.
str | Input string. |
t | Characters to be removed from both sides of the input string. |
t
removed.SPL::rstring SPL::Functions::String::ltrim | ( | const SPL::rstring & | str, |
const SPL::rstring & | t | ||
) |
Remove the leading characters from a string.
str | Input string. |
t | Characters to be removed from the left side of the input string. |
t
removed.
|
inline |
Remove the leading characters from a string.
str | Input string. |
t | Characters to be removed from the left side of the input string. |
t
removed.SPL::ustring SPL::Functions::String::ltrim | ( | const SPL::ustring & | str, |
const SPL::ustring & | t | ||
) |
Remove the leading characters from a string.
str | Input string. |
t | Characters to be removed from the left side of the input string. |
t
removed.SPL::rstring SPL::Functions::String::rtrim | ( | const SPL::rstring & | str, |
const SPL::rstring & | t | ||
) |
Remove the trailing characters from a string.
str | Input string. |
t | Characters to be removed from the right side of the input string. |
t
removed.SPL::ustring SPL::Functions::String::rtrim | ( | const SPL::ustring & | str, |
const SPL::ustring & | t | ||
) |
Remove the trailing characters from a string.
str | Input string. |
t | Characters to be removed from the right side of the input string. |
t
removed.
|
inline |
Remove the trailing characters from a string.
str | Input string. |
t | Characters to be removed from the right side of the input string. |
t
removed.
|
inline |
Get a substring from a string.
str | Input string. |
sidx | Start index of the substring, where 0 is the first logical character in the input string. |
slen | Number of characters in the substring. |
|
inline |
Get a substring from a string.
str | Input string. |
sidx | Start index of the substring, where 0 is the first logical character in the input string. |
slen | Number of characters in the substring. |
|
inline |
Get a substring from a string.
str | Input string. |
sidx | Start index of the substring, where 0 is the first logical character in the input string. |
slen | Number of characters in the substring. |
|
inline |
Find a substring in a string.
str | Input string. |
ps | Substring to be found. |
sidx | Start index of the search, where 0 is the first logical character in the input string. |
|
inline |
Find a substring in a string.
str | Input string. |
ps | Substring to be found. |
sidx | Start index of the search, where 0 is the first logical character in the input string. |
|
inline |
Find a substring in a string.
str | Input string. |
ps | Substring to be found. |
sidx | Start index of the search, where 0 is the first logical character in the input string. |
|
inline |
Find a substring in a string.
str | Input string. |
ps | Substring to be found. |
sidx | Index of the last character to be considered, where 0 is the first logical character in the input string. |
|
inline |
Find a substring in a string.
str | Input string. |
ps | Substring to be found. |
sidx | Index of the last character to be considered, where 0 is the first logical character in the input string. |
|
inline |
Find a substring in a string.
str | Input string. |
ps | Substring to be found. |
sidx | Index of the last character to be considered, where 0 is the first logical character in the input string. |
|
inline |
Find a matching character in a string.
str | Input string. |
ps | List of characters to look for. |
sidx | Start index of the search. |
|
inline |
Find a matching character in a string.
str | Input string. |
ps | List of characters to look for. |
sidx | Start index of the search, where 0 is the first logical character in the input string. |
|
inline |
Find a matching character in a string.
str | Input string. |
ps | List of characters to look for. |
sidx | Start index of the search, where 0 is the first logical character in the input string. |
|
inline |
Find a matching character in a string.
str | Input string. |
ps | List of characters to look for. |
sidx | Index of the last character to be considered, where 0 is the first logical character in the input string. |
|
inline |
Find a matching character in a string.
str | Input string. |
ps | List of characters to look for. |
sidx | Index of the last character to be considered, where 0 is the first logical character in the input string. |
|
inline |
Find a matching character in a string.
str | Input string. |
ps | List of characters to look for. |
sidx | Index of the last character to be considered, where 0 is the first logical character in the input string. |
|
inline |
Find a non-matching character in a string.
str | Input string. |
ps | List of characters to look for. |
sidx | Start index of the search, where 0 is the first logical character in the input string. |
|
inline |
Find a non-matching character in a string.
str | Input string. |
ps | List of characters to look for. |
sidx | Start index of the search, where 0 is the first logical character in the input string. |
|
inline |
Find a non-matching character in a string.
str | Input string. |
ps | List of characters to look for. |
sidx | Start index of the search, where 0 is the first logical character in the input string. |
|
inline |
Find the last non-matching character in a string.
str | Input string. |
ps | List of characters to look for. |
sidx | Index of the last character to be considered, where 0 is the first logical character in the input string. |
|
inline |
Find the last non-matching character in a string.
str | Input string. |
ps | List of characters to look for. |
sidx | Index of the last character to be considered, where 0 is the first logical character in the input string. |
|
inline |
Find the last non-matching character in a string.
str | Input string. |
ps | List of characters to look for. |
sidx | Index of the last character to be considered, where 0 is the first logical character in the input string. |
const SPL::list<SPL::rstring> SPL::Functions::String::tokenize | ( | const SPL::rstring & | str, |
const SPL::rstring & | delim, | ||
const SPL::boolean | keepEmptyTokens | ||
) |
Tokenize a string.
str | Input string. |
delim | Delimiters to use. Each character in delim is a possible delimiter. |
keepEmptyTokens | Keep empty tokens in the result. |
const SPL::list<SPL::ustring> SPL::Functions::String::tokenize | ( | const SPL::ustring & | str, |
const SPL::ustring & | delim, | ||
const SPL::boolean | keepEmptyTokens | ||
) |
Tokenize a string.
str | Input string. |
delim | Delimiters to use. Each character in delim is a possible delimiter. |
keepEmptyTokens | Keep empty tokens in the result. |
void SPL::Functions::String::tokenize | ( | const SPL::rstring & | str, |
const SPL::rstring & | delim, | ||
SPL::boolean | keepEmptyTokens, | ||
SPL::boolean | multipleDelim, | ||
SPL::list< SPL::rstring > & | tokens | ||
) |
Tokenize a string.
str | Input string. |
delim | Delimiters to use. |
keepEmptyTokens | Keep empty tokens in the result. |
multipleDelim | If 'true', each character in delim is used to tokenize. If 'false', the string in delim is used as a delimiter. This parameter is important only if size(delim) > 1 . |
tokens | Output list of the tokens in the string. |
void SPL::Functions::String::tokenize | ( | const SPL::ustring & | str, |
const SPL::ustring & | delim, | ||
SPL::boolean | keepEmptyTokens, | ||
SPL::boolean | multipleDelim, | ||
SPL::list< SPL::ustring > & | tokens | ||
) |
Tokenize a string.
str | Input string. |
delim | Delimiters to use. |
keepEmptyTokens | Keep empty tokens in the result. |
multipleDelim | If 'true', each character in delim is used to tokenize. If 'false', the string in delim is used as a delimiter. This parameter is important only if size(delim) > 1 . |
tokens | Output list of the tokens in the string. |
const SPL::list<SPL::rstring> SPL::Functions::String::csvTokenize | ( | const SPL::rstring & | str | ) |
Tokenize a string containing comma-separated values.
str | Input string in comma-separated values format, like "string1","string2","string3",...,"stringN". |
interpretRStringLiteral()
or interpretUStringLiteral()
to interpret them).
|
inline |
Tokenize a string containing comma-separated values.
str | Input string in comma-separated values format, like "string1","string2","string3",...,"stringN". |
interpretRStringLiteral()
or interpretUStringLiteral()
to interpret them).
|
inline |
Interpret a string literal stored in a UTF-8 encoded string as an rstring
.
str | String to be interpreted. |
SPLRuntimeInvalidArgumentException | If the string is not enclosed within double quotes, or if the encoding has errors. |
|
inline |
Make a string literal from an rstring
.
str | The rstring to be converted into a string literal. |
|
inline |
Interpret a string literal stored in a UTF-8 encoded string as a ustring
.
str | String to be interpreted. |
SPLRuntimeInvalidArgumentException | If str is not enclosed within double quotes, or if the encoding has errors. |
|
inline |
Make a string literal from a ustring
.
str | The ustring to be converted into a string literal. |
SPL::list<SPL::rstring> SPL::Functions::String::regexMatch | ( | const SPL::rstring & | str, |
const SPL::rstring & | patt | ||
) |
Match a string with a regular expression, using POSIX Extended Regular Expressions (ERE), including sub-expression (capture group) matching using parentheses "()".
str | Input string. |
patt | Search pattern. |
SPLRuntimeInvalidArgumentException | If the search pattern is an invalid regular expression. |
SPL::list<SPL::ustring> SPL::Functions::String::regexMatch | ( | const SPL::ustring & | str, |
const SPL::ustring & | patt | ||
) |
Match a string with a regular expression, using POSIX Extended Regular Expressions (ERE), including sub-expression (capture group) matching using parentheses "()".
str | Input string. |
patt | Search pattern. |
SPLRuntimeInvalidArgumentException | If the search pattern is an invalid regular expression. |
SPL::rstring SPL::Functions::String::regexReplace | ( | const SPL::rstring & | str, |
const SPL::rstring & | searchPatt, | ||
const SPL::rstring & | substPatt, | ||
const SPL::boolean | global | ||
) |
Match and replace a string with a regular expression, using POSIX Extended Regular Expressions (ERE), including sub-expression (capture group) matching using parentheses "()".
str | Input string. |
searchPatt | Search pattern. |
substPatt | Replacement pattern (for the rstring version, matched sub-expressions can be specified through "\\n", as in "\\1"; for the ustring version, "$n", as in "$1", may be used). |
global | Whether replacement is to be done globally. |
SPLRuntimeInvalidArgumentException | If the search pattern is an invalid regular expression. |
SPL::ustring SPL::Functions::String::regexReplace | ( | const SPL::ustring & | str, |
const SPL::ustring & | searchPatt, | ||
const SPL::ustring & | substPatt, | ||
const SPL::boolean | global | ||
) |
Match and replace a string with a regular expression, using POSIX Extended Regular Expressions (ERE), including sub-expression (capture group) matching using parentheses "()".
str | Input string. |
searchPatt | Search pattern. |
substPatt | Replacement pattern (for the rstring version, matched sub-expressions can be specified through "\\n", as in "\\1"; for the ustring version, "$n", as in "$1", may be used). |
global | Whether replacement is to be done globally. |
SPLRuntimeInvalidArgumentException | If the search pattern is an invalid regular expression. |
SPL::list<SPL::rstring> SPL::Functions::String::regexMatchPerl | ( | const SPL::rstring & | str, |
const SPL::rstring & | patt | ||
) |
Match a string with a regular expression, using a Perl regular expression, including sub-expression (capture group) matching using parentheses "()".
str | Input string. |
patt | Search pattern (using Boost Perl regular expression syntax). |
SPLRuntimeInvalidArgumentException | If the search pattern is an invalid regular expression. |
SPL::list<SPL::ustring> SPL::Functions::String::regexMatchPerl | ( | const SPL::ustring & | str, |
const SPL::ustring & | patt | ||
) |
Match a string with a regular expression, using a Perl regular expression, including sub-expression (capture group) matching using parentheses "()".
str | Input string. |
patt | Search pattern (using Boost Perl regular expression syntax). |
SPLRuntimeInvalidArgumentException | If the search pattern is an invalid regular expression. |
SPL::rstring SPL::Functions::String::regexReplacePerl | ( | const SPL::rstring & | str, |
const SPL::rstring & | searchPatt, | ||
const SPL::rstring & | substPatt, | ||
const SPL::boolean | global | ||
) |
Match and replace a string with a regular expression, using a Perl regular expression, including sub-expression (capture group) matching using parentheses "()".
str | Input string. |
searchPatt | Search pattern (using Boost Perl regular expression syntax). |
substPatt | Replacement pattern (matched sub-expressions can be specified through "\\n", as in "\\1"). |
global | Whether replacement is to be done globally. |
SPLRuntimeInvalidArgumentException | If the search pattern is an invalid regular expression. |
SPL::ustring SPL::Functions::String::regexReplacePerl | ( | const SPL::ustring & | str, |
const SPL::ustring & | searchPatt, | ||
const SPL::ustring & | substPatt, | ||
const SPL::boolean | global | ||
) |
Match and replace a string with a regular expression, using a Perl regular expression, including sub-expression (capture group) matching using parentheses "()".
str | Input string. |
searchPatt | Search pattern (using Boost Perl regular expression syntax). |
substPatt | Replacement pattern (matched sub-expressions can be specified through "\\n", as in "\\1"). |
global | Whether replacement is to be done globally. |
SPLRuntimeInvalidArgumentException | If the search pattern is an invalid regular expression. |
SPL::rstring SPL::Functions::String::convertToUtf8 | ( | const SPL::list< SPL::uint8 > & | val, |
const SPL::rstring & | enc | ||
) |
Convert data given as raw bytes with a specified encoding into a UTF-8 encoded string.
val | Input data. |
enc | Input data encoding scheme (eg "UTF-16"). |
|
inline |
Convert data given as raw bytes with a specified encoding into a UTF-8 encoded string.
val | Input data. |
enc | Input data encoding scheme (eg "UTF-16"). |
SPL::rstring SPL::Functions::String::convertToUtf8 | ( | const SPL::rstring & | val, |
const SPL::rstring & | enc | ||
) |
Convert data given as raw bytes with a specified encoding into a UTF-8 encoded string.
val | Input data. |
enc | Input data encoding scheme (eg "UTF-16"). |
SPL::list<SPL::uint8> SPL::Functions::String::convertFromUtf8 | ( | const SPL::rstring & | str, |
const SPL::rstring & | enc | ||
) |
Convert a UTF-8 encoded string into data as raw bytes with a specified encoding.
str | Input string (UTF-8 encoded). |
enc | Data encoding scheme (eg "UTF-16") for the output. |
SPL::rstring SPL::Functions::String::convertFromUtf8ToString | ( | const SPL::rstring & | str, |
const SPL::rstring & | enc | ||
) |
Convert a UTF-8 encoded string into a string with a specified encoding.
str | Input string (UTF-8 encoded). |
enc | Data encoding scheme (eg "UTF-16") for the output. |
rstring
with the specified encoding.
|
inline |
Convert the first character of a string to its corresponding ASCII code.
str | Input string. |
|
inline |
Convert the first character of a string to its corresponding ASCII code.
str | Input string. |
|
inline |
Convert the first character of a string to its corresponding Unicode code point.
str | Input string. |
|
inline |
Convert any SPL type to to a serialized string. For example, strings are quoted, and characters escaped.
v | Value to be converted. |
SPLRuntimeInvalidArgumentException | If conversion fails. |
|
inline |
Convert any SPL type to to a serialized string. For example, strings are quoted, and characters escaped.
v | Value to be converted. |
SPLRuntimeInvalidArgumentException | If conversion fails. |
SPL::rstring SPL::Functions::String::subSlice | ( | const SPL::rstring & | s, |
uint32_t | lower, | ||
uint32_t | upper | ||
) |
Return a slice from a string [lower..upper-1].
s | Input string. |
lower | First index to be included. |
upper | Last index (not included in result). |
SPLRuntimeInvalidArgumentException | If lower > s.size(). |
SPL::rstring SPL::Functions::String::subSliceL | ( | const SPL::rstring & | s, |
uint32_t | upper | ||
) |
Return a slice from a string [0..upper-1].
s | Input string. |
upper | Last index (not included in result). |
SPL::rstring SPL::Functions::String::subSliceU | ( | const SPL::rstring & | s, |
uint32_t | lower | ||
) |
Return a slice from a string [lower..<end of string>].
s | Input string. |
lower | First index to be included. |
SPLRuntimeInvalidArgumentException | If lower > s.size(). |
SPL::bstring<msize> SPL::Functions::String::subSlice | ( | const SPL::bstring< msize > & | s, |
uint32_t | lower, | ||
uint32_t | upper | ||
) |
Return a slice from a bounded string [lower..upper-1].
s | Input string. |
lower | First index to be included. |
upper | Last index (not included in result). |
SPLRuntimeInvalidArgumentException | If lower > s.size(). |
SPL::bstring<msize> SPL::Functions::String::subSliceL | ( | const SPL::bstring< msize > & | s, |
uint32_t | upper | ||
) |
Return a slice from a bounded string [0..upper-1].
s | Input string. |
upper | Last index (not included in result). |
SPL::bstring<msize> SPL::Functions::String::subSliceU | ( | const SPL::bstring< msize > & | s, |
uint32_t | lower | ||
) |
Return a slice from a bounded string [lower..<end of string>].
s | Input string. |
lower | First index to be included. |
SPLRuntimeInvalidArgumentException | If lower > s.size(). |
SPL::ustring SPL::Functions::String::subSlice | ( | const SPL::ustring & | s, |
uint32_t | lower, | ||
uint32_t | upper | ||
) |
Return a slice from a string [lower..upper-1].
s | Input string. |
lower | First index to be included. |
upper | Last index (not included in result). |
SPLRuntimeInvalidArgumentException | If lower > s.size(). |
SPL::ustring SPL::Functions::String::subSliceL | ( | const SPL::ustring & | s, |
uint32_t | upper | ||
) |
Return a slice from a string [0..upper-1].
s | Input string. |
upper | Last index (not included in result). |
SPL::ustring SPL::Functions::String::subSliceU | ( | const SPL::ustring & | s, |
uint32_t | lower | ||
) |
Return a slice from a string [lower..<end of string>].
s | Input string. |
lower | First index to be included. |
SPLRuntimeInvalidArgumentException | If lower > s.size(). |
|
inline |
Concatenate two bounded rstring
strings, returning an rstring
.
lstr | Input bounded rstring . |
rstr | Input bounded rstring . |
lstr
to rstr
.
|
inline |
Concatenate an rstring
with a bounded rstring
, returning an rstring
.
lstr | Input rstring . |
rstr | Input bounded rstring . |
lstr
to rstr
.
|
inline |
Concatenate a bounded rstring
with an rstring
, returning an rstring
.
lstr | Input bounded rstring . |
rstr | Input rstring . |
lstr
to rstr
.
|
inline |
Concatenate two rstring
strings, returning an rstring
.
lstr | Input rstring . |
rstr | Input rstring . |
lstr
to rstr
.
|
inline |
Append a bounded rstring
to a bounded rstring
.
str | The bounded rstring to be appended to. |
value | The bounded rstring to be appended. |
|
inline |
Append an rstring
to a bounded rstring
.
str | The bounded rstring to be appended to. |
value | The rstring to be appended. |
|
inline |
Convert a blob
to an rstring
.
b | The blob to be converted. |
rstring
with the characters from the blob
.
|
inline |
Convert an rstring
to a blob
.
str | String to be converted. |
blob
with the characters from the rstring
.