Go to the documentation of this file.
20 #include <cuda_runtime.h>
63 CUDF_HOST_DEVICE [[nodiscard]]
inline const char*
data()
const {
return _data; }
70 CUDF_HOST_DEVICE [[nodiscard]]
inline bool empty()
const {
return size_bytes() == 0; }
78 using difference_type = ptrdiff_t;
82 using iterator_category = std::input_iterator_tag;
103 [[nodiscard]] __device__
inline size_type position()
const;
341 : _data(
data), _bytes(bytes), _length(UNKNOWN_STRING_LENGTH)
399 template <
bool forward>
400 __device__
inline size_type find_impl(
const char* str,
string_view & operator=(string_view &&)=default
Move assignment operator.
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...
const_iterator end() const
Return new iterator pointing past the end of this string.
uint32_t char_utf8
UTF-8 characters are 1-4 bytes.
CUDF_HOST_DEVICE fixed_point< Rep1, Rad1 > operator+(fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs)
int32_t size_type
Row index type for columns and tables.
size_type byte_offset(size_type pos) const
Return the byte offset from data() for a given character position.
Type declarations for libcudf.
string_view & operator=(const string_view &)=default
Copy assignment operator.
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.
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.
static cudf::size_type const npos
No-position value.
string_view(string_view &&)=default
Move constructor.
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.
CUDF_HOST_DEVICE fixed_point< Rep1, Rad1 > operator*(fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs)
const_iterator begin() const
Return new iterator pointing to the beginning of this string.
CUDF_HOST_DEVICE fixed_point< Rep1, Rad1 > operator-(fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs)
Handy iterator for navigating through encoded characters.
string_view(const string_view &)=default
Copy constructor.
size_type length() const
Return the number of characters in 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.