Lines Matching defs:StringPiece
25 * \brief C++ API: StringPiece: Read-only byte string wrapper class.
40 * in a "const char*" or a "string" wherever a "StringPiece" is
43 * Functions or methods may use const StringPiece& parameters to accept either
45 * a StringPiece.
47 * Systematic usage of StringPiece is encouraged as it will reduce unnecessary
52 class U_COMMON_API StringPiece : public UMemory {
59 * Default constructor, creates an empty StringPiece.
62 StringPiece() : ptr_(NULL), length_(0) { }
68 StringPiece(const char* str);
74 StringPiece(const U_STD_NSQ string& str)
83 StringPiece(const char* offset, int32_t len) : ptr_(offset), length_(len) { }
85 * Substring of another StringPiece.
86 * @param x the other StringPiece
90 StringPiece(const StringPiece& x, int32_t pos);
92 * Substring of another StringPiece.
93 * @param x the other StringPiece
99 StringPiece(const StringPiece& x, int32_t pos, int32_t len);
174 * Returns a substring of this StringPiece.
178 * @return the substring StringPiece
181 StringPiece substr(int32_t pos, int32_t len = npos) const {
182 return StringPiece(*this, pos, len);