20 #ifndef __STRINGPIECE_H__
21 #define __STRINGPIECE_H__
75 : ptr_(str.data()), length_(static_cast<
int32_t>(str.size())) { }
111 const char*
data()
const {
return ptr_; }
188 #endif // __STRINGPIECE_H__
void clear()
Sets to an empty string.
StringPiece()
Default constructor, creates an empty StringPiece.
int32_t size() const
Returns the string length.
StringPiece(const char *offset, int32_t len)
Constructs from a const char * pointer and a specified length.
A string-like object that points to a sized piece of memory.
const char * data() const
Returns the string pointer.
int32_t length() const
Returns the string length.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
UBool empty() const
Returns whether the string is empty.
#define NULL
Define NULL if necessary, to 0 for C++ and to ((void *)0) for C.
C++ API: Central ICU header for including the C++ standard <string> header and for related definition...
UMemory is the common ICU base class.
C++ API: Common ICU base class UObject.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API If the compiler doesn't support namespaces...
#define U_STD_NSQ
Define the namespace qualifier to use for standard C++ (STL) classes.
void remove_prefix(int32_t n)
Removes the first n string units.
Basic definitions for ICU, for both C and C++ APIs.
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside...
StringPiece substr(int32_t pos, int32_t len=npos) const
Returns a substring of this StringPiece.
void remove_suffix(int32_t n)
Removes the last n string units.
signed int int32_t
Define 64 bit limits.
int8_t UBool
The ICU boolean type.