webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
#include <stringpiece.h>
Static Public Attributes | |
static const int32_t | npos |
A string-like object that points to a sized piece of memory.
We provide non-explicit singleton constructors so users can pass in a "const char*" or a "string" wherever a "StringPiece" is expected.
Functions or methods may use const StringPiece& parameters to accept either a "const char*" or a "string" value that will be implicitly converted to a StringPiece.
Systematic usage of StringPiece is encouraged as it will reduce unnecessary conversions from "const char*" to "string" and back again.
ICU 4.2
|
inline |
Default constructor, creates an empty StringPiece. ICU 4.2
StringPiece::StringPiece | ( | const char * | str | ) |
Constructs from a NUL-terminated const char * pointer.
str | a NUL-terminated const char * pointer ICU 4.2 |
|
inline |
Constructs from a const char * pointer and a specified length.
offset | a const char * pointer (need not be terminated) |
len | the length of the string; must be non-negative ICU 4.2 |
StringPiece::StringPiece | ( | const StringPiece & | x, |
int32_t | pos | ||
) |
Substring of another StringPiece.
x | the other StringPiece |
pos | start position in x; must be non-negative and <= x.length(). ICU 4.2 |
StringPiece::StringPiece | ( | const StringPiece & | x, |
int32_t | pos, | ||
int32_t | len | ||
) |
Substring of another StringPiece.
x | the other StringPiece |
pos | start position in x; must be non-negative and <= x.length(). |
len | length of the substring; must be non-negative and will be pinned to at most x.length() - pos. ICU 4.2 |
|
inline |
Default constructor, creates an empty StringPiece. ICU 4.2
StringPiece::StringPiece | ( | const char * | str | ) |
Constructs from a NUL-terminated const char * pointer.
str | a NUL-terminated const char * pointer ICU 4.2 |
|
inline |
Constructs from a const char * pointer and a specified length.
offset | a const char * pointer (need not be terminated) |
len | the length of the string; must be non-negative ICU 4.2 |
StringPiece::StringPiece | ( | const StringPiece & | x, |
int32_t | pos | ||
) |
Substring of another StringPiece.
x | the other StringPiece |
pos | start position in x; must be non-negative and <= x.length(). ICU 4.2 |
StringPiece::StringPiece | ( | const StringPiece & | x, |
int32_t | pos, | ||
int32_t | len | ||
) |
Substring of another StringPiece.
x | the other StringPiece |
pos | start position in x; must be non-negative and <= x.length(). |
len | length of the substring; must be non-negative and will be pinned to at most x.length() - pos. ICU 4.2 |
|
inline |
Default constructor, creates an empty StringPiece. ICU 4.2
StringPiece::StringPiece | ( | const char * | str | ) |
Constructs from a NUL-terminated const char * pointer.
str | a NUL-terminated const char * pointer ICU 4.2 |
|
inline |
Constructs from a const char * pointer and a specified length.
offset | a const char * pointer (need not be terminated) |
len | the length of the string; must be non-negative ICU 4.2 |
StringPiece::StringPiece | ( | const StringPiece & | x, |
int32_t | pos | ||
) |
Substring of another StringPiece.
x | the other StringPiece |
pos | start position in x; must be non-negative and <= x.length(). ICU 4.2 |
StringPiece::StringPiece | ( | const StringPiece & | x, |
int32_t | pos, | ||
int32_t | len | ||
) |
Substring of another StringPiece.
x | the other StringPiece |
pos | start position in x; must be non-negative and <= x.length(). |
len | length of the substring; must be non-negative and will be pinned to at most x.length() - pos. ICU 4.2 |
|
inline |
Sets to an empty string. ICU 4.2
|
inline |
Sets to an empty string. ICU 4.2
|
inline |
Sets to an empty string. ICU 4.2
|
inline |
Returns the string pointer. May be NULL if it is empty.
data() may return a pointer to a buffer with embedded NULs, and the returned buffer may or may not be null terminated. Therefore it is typically a mistake to pass data() to a routine that expects a NUL terminated string.
|
inline |
Returns the string pointer. May be NULL if it is empty.
data() may return a pointer to a buffer with embedded NULs, and the returned buffer may or may not be null terminated. Therefore it is typically a mistake to pass data() to a routine that expects a NUL terminated string.
|
inline |
Returns the string pointer. May be NULL if it is empty.
data() may return a pointer to a buffer with embedded NULs, and the returned buffer may or may not be null terminated. Therefore it is typically a mistake to pass data() to a routine that expects a NUL terminated string.
|
inline |
Returns whether the string is empty.
|
inline |
Returns whether the string is empty.
|
inline |
Returns whether the string is empty.
Returns the string length. Same as size().
Returns the string length. Same as size().
Returns the string length. Same as size().
Removes the first n string units.
n | prefix length, must be non-negative and <=length() ICU 4.2 |
Removes the first n string units.
n | prefix length, must be non-negative and <=length() ICU 4.2 |
Removes the first n string units.
n | prefix length, must be non-negative and <=length() ICU 4.2 |
Removes the last n string units.
n | suffix length, must be non-negative and <=length() ICU 4.2 |
Removes the last n string units.
n | suffix length, must be non-negative and <=length() ICU 4.2 |
Removes the last n string units.
n | suffix length, must be non-negative and <=length() ICU 4.2 |
Reset the stringpiece to refer to new data.
xdata | pointer the new string data. Need not be nul terminated. |
len | the length of the new data ICU 4.8 |
Reset the stringpiece to refer to new data.
xdata | pointer the new string data. Need not be nul terminated. |
len | the length of the new data ICU 4.8 |
Reset the stringpiece to refer to new data.
xdata | pointer the new string data. Need not be nul terminated. |
len | the length of the new data ICU 4.8 |
void StringPiece::set | ( | const char * | str | ) |
Reset the stringpiece to refer to new data.
str | a pointer to a NUL-terminated string. ICU 4.8 |
void StringPiece::set | ( | const char * | str | ) |
Reset the stringpiece to refer to new data.
str | a pointer to a NUL-terminated string. ICU 4.8 |
void StringPiece::set | ( | const char * | str | ) |
Reset the stringpiece to refer to new data.
str | a pointer to a NUL-terminated string. ICU 4.8 |
|
inline |
Returns the string length. Same as length().
|
inline |
Returns the string length. Same as length().
|
inline |
Returns the string length. Same as length().
|
inline |
Returns a substring of this StringPiece.
pos | start position; must be non-negative and <= length(). |
len | length of the substring; must be non-negative and will be pinned to at most length() - pos. |
|
inline |
Returns a substring of this StringPiece.
pos | start position; must be non-negative and <= length(). |
len | length of the substring; must be non-negative and will be pinned to at most length() - pos. |
|
inline |
Returns a substring of this StringPiece.
pos | start position; must be non-negative and <= length(). |
len | length of the substring; must be non-negative and will be pinned to at most length() - pos. |
|
static |
Maximum integer, used as a default value for substring methods. ICU 4.2