ADTF
|
Class that represents string pieces. More...
Classes | |
class | cStringPiecePrivate |
Public Member Functions | |
cStringPiece () | |
Default constructor. | |
cStringPiece (const cStringPiece &i_oOther) | |
Copy constructor. More... | |
cStringPiece & | operator= (const cStringPiece &i_oOther) |
Copy assignment. More... | |
cStringPiece (const tChar *str) | |
Constructor. More... | |
cStringPiece (const cString &str) | |
Constructor. More... | |
cStringPiece (const tChar *offset, tInt len) | |
Constructor. More... | |
const tChar * | GetPtr () const |
Retrieve character pointer. More... | |
tInt | GetSize () const |
Retrieve the size of the string piece. More... | |
tBool | IsEmpty () const |
Check if string piece is empty. More... | |
tVoid | Clear () |
Clears the string piece. | |
tVoid | Set (const tChar *buffer, tInt len) |
Assigns the buffer to the string piece. More... | |
tVoid | Set (const tChar *str) |
Assigns the string to the string piece. More... | |
tVoid | Set (const tVoid *buffer, tInt len) |
Assigns the buffer to the string piece. More... | |
tChar | operator[] (tInt i) const |
Retrieve character at the given position. More... | |
tVoid | RemovePrefix (tInt n) |
Remove prefix of given length. More... | |
tVoid | RemoveSuffix (tInt n) |
Remove suffix of given length. More... | |
tBool | operator== (const cStringPiece &x) const |
Compare two string pieces for equality. More... | |
tBool | operator!= (const cStringPiece &x) const |
Compare two string pieces for inequality. More... | |
STRINGPIECE_BINARY_PREDICATE (<,<) | |
Compare two string pieces. More... | |
STRINGPIECE_BINARY_PREDICATE (<=,<) | |
Compare two string pieces. More... | |
STRINGPIECE_BINARY_PREDICATE (>=, >) | |
Compare two string pieces. More... | |
STRINGPIECE_BINARY_PREDICATE (>, >) | |
Compare two string pieces. More... | |
tInt | Compare (const cStringPiece &x) const |
Compare two string pieces. More... | |
cString | AsString () const |
Return string piece as standard string. More... | |
tVoid | CopyToString (cString *target) const |
Return string piece as standard string. More... | |
tBool | StartsWith (const cStringPiece &x) const |
Check if this string piece starts with the given string piece. More... | |
Private Attributes | |
const tChar * | ptr_ |
Character pointer. | |
tInt | length_ |
Length of string. | |
Class that represents string pieces.
Definition at line 18 of file regularexpression_helper.h.
|
inline |
Copy constructor.
i_oOther | Other string piece object to copy from |
Definition at line 51 of file regularexpression_helper.h.
|
inline |
Constructor.
str | [in] Character pointer. |
Definition at line 79 of file regularexpression_helper.h.
|
inline |
|
inline |
Constructor.
offset | [in] Character pointer. |
len | [in] Length of string. |
Definition at line 102 of file regularexpression_helper.h.
|
inline |
Return string piece as standard string.
Definition at line 332 of file regularexpression_helper.h.
References string_base< cStackString >::Empty.
|
inline |
Compare two string pieces.
x | [in] String piece to compare with. |
Definition at line 310 of file regularexpression_helper.h.
References cStringPiece::length_, cMemoryBlock::MemCmp(), and cStringPiece::ptr_.
Return string piece as standard string.
target | [out] Resulting standard string. |
Definition at line 350 of file regularexpression_helper.h.
References string_base< storageT >::Set().
|
inline |
Retrieve character pointer.
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. Use "as_string().c_str()" if you really need to do this. Or better yet, change your routine so it does not rely on NUL termination.
Definition at line 119 of file regularexpression_helper.h.
Referenced by cStringPiece::operator=(), and cStringPiece::StartsWith().
|
inline |
Retrieve the size of the string piece.
Definition at line 129 of file regularexpression_helper.h.
Referenced by cStringPiece::operator=().
|
inline |
Check if string piece is empty.
Definition at line 139 of file regularexpression_helper.h.
|
inline |
Compare two string pieces for inequality.
x | [in] String piece to compare with. |
Definition at line 263 of file regularexpression_helper.h.
|
inline |
Copy assignment.
i_oOther | Other string piece object to copy from |
Definition at line 63 of file regularexpression_helper.h.
References cStringPiece::GetPtr(), and cStringPiece::GetSize().
|
inline |
Compare two string pieces for equality.
x | [in] String piece to compare with. |
Definition at line 251 of file regularexpression_helper.h.
References cStringPiece::length_, cMemoryBlock::MemCmp(), and cStringPiece::ptr_.
Retrieve character at the given position.
i | [in] Position to retrieve. |
Definition at line 205 of file regularexpression_helper.h.
Remove prefix of given length.
n | [in] Length of prefix to remove. |
Definition at line 221 of file regularexpression_helper.h.
Remove suffix of given length.
n | [in] Length of suffix to remove. |
Definition at line 236 of file regularexpression_helper.h.
Assigns the buffer to the string piece.
buffer | [in] Buffer. |
len | [in] Length of buffer. |
Definition at line 160 of file regularexpression_helper.h.
Assigns the string to the string piece.
str | [in] Null terminated string. |
Definition at line 172 of file regularexpression_helper.h.
References cStringUtil::GetLength().
Assigns the buffer to the string piece.
buffer | [in] Buffer. |
len | [in] Length of buffer. |
Definition at line 188 of file regularexpression_helper.h.
|
inline |
Check if this string piece starts with the given string piece.
x | [in] String piece to compare with. |
Definition at line 367 of file regularexpression_helper.h.
References cStringPiece::GetPtr(), cStringPiece::length_, cMemoryBlock::MemCmp(), cStringPiece::ptr_, and tFalse.
STRINGPIECE_BINARY_PREDICATE | ( | ) |
Compare two string pieces.
STRINGPIECE_BINARY_PREDICATE | ( | <= | ) |
Compare two string pieces.
STRINGPIECE_BINARY_PREDICATE | ( | ) |
Compare two string pieces.
STRINGPIECE_BINARY_PREDICATE | ( | >= | ) |
Compare two string pieces.