Go to the documentation of this file.
54 CUDF_HOST_DEVICE [[nodiscard]]
inline size_type
size_bytes()
const {
return _bytes; }
58 __device__ [[nodiscard]]
inline size_type
length()
const;
62 CUDF_HOST_DEVICE [[nodiscard]]
inline const char*
data()
const {
return _data; }
67 CUDF_HOST_DEVICE [[nodiscard]]
inline bool empty()
const {
return size_bytes() == 0; }
74 using difference_type = ptrdiff_t;
78 using iterator_category = std::input_iterator_tag;
98 __device__
inline char_utf8 operator*()
const;
99 [[nodiscard]] __device__
inline size_type position()
const;
100 [[nodiscard]] __device__
inline size_type byte_offset()
const;
105 size_type char_pos{};
106 size_type byte_pos{};
129 __device__ [[nodiscard]]
inline size_type
byte_offset(size_type pos)
const;
159 __device__
inline int compare(
const char* str, size_type bytes)
const;
198 size_type count = -1)
const;
210 __device__
inline size_type
find(
const char* str,
213 size_type count = -1)
const;
224 __device__ [[nodiscard]]
inline size_type
find(
char_utf8 character,
226 size_type count = -1)
const;
239 size_type count = -1)
const;
251 __device__
inline size_type
rfind(
const char* str,
254 size_type count = -1)
const;
265 __device__ [[nodiscard]]
inline size_type
rfind(
char_utf8 character,
267 size_type count = -1)
const;
325 mutable size_type _length{};
333 __device__ [[nodiscard]]
inline size_type character_offset(size_type bytepos)
const;
string_view substr(size_type start, size_type length) const
Return a sub-string of this string. The original string and device memory must still be maintained fo...
uint32_t char_utf8
UTF-8 characters are 1-4 bytes.
size_type byte_offset(size_type pos) const
Return the byte offset from data() for a given character position.
Type declarations for libcudf.
A non-owning, immutable view of device data that is a variable length char array representing a UTF-8...
CUDF_HOST_DEVICE size_type size_bytes() const
Return the number of bytes in this string.
bool operator<=(const string_view &rhs) const
Returns true if this string matches or is ordered before rhs.
char_utf8 operator[](size_type pos) const
Return single UTF-8 character at the given character position.
bool operator<(const string_view &rhs) const
Returns true if this string is ordered before rhs.
constexpr cudf::size_type UNKNOWN_STRING_LENGTH
The string length is initialized to this value as a place-holder.
bool operator>(const string_view &rhs) const
Returns true if rhs is ordered before this string.
size_type rfind(const string_view &str, size_type pos=0, size_type count=-1) const
Returns the character position of the last occurrence where the argument str is found in this string ...
CUDF_HOST_DEVICE string_view()
Default constructor represents an empty string.
int compare(const string_view &str) const
Comparing target string with this string. Each character is compared as a UTF-8 code-point value.
bool operator!=(const string_view &rhs) const
Returns true if rhs does not match this string.
Handy iterator for navigating through encoded characters.
const_iterator begin() const
Return new iterator pointing to the beginning of this string.
size_type length() const
Return the number of characters in this string.
const_iterator end() const
Return new iterator pointing past the end of this string.
static CUDF_HOST_DEVICE string_view max()
Return maximum value associated with the string type.
bool operator==(const string_view &rhs) const
Returns true if rhs matches this string exactly.
size_type find(const string_view &str, size_type pos=0, size_type count=-1) const
Returns the character position of the first occurrence where the argument str is found in this string...
CUDF_HOST_DEVICE bool empty() const
Return true if string has no characters.
CUDF_HOST_DEVICE const char * data() const
Return a pointer to the internal device array.
static CUDF_HOST_DEVICE string_view min()
Return minimum value associated with the string type.
bool operator>=(const string_view &rhs) const
Returns true if rhs matches or is ordered before this string.