tvm
|
Reference to string objects. More...
#include <string.h>
Public Member Functions | |
String () | |
Construct an empty string. More... | |
String (std::string other) | |
Construct a new String object. More... | |
String (const char *other) | |
Construct a new String object. More... | |
String (std::nullptr_t) | |
Construct a new null object. More... | |
String & | operator= (std::string other) |
Change the value the reference object points to. More... | |
String & | operator= (const char *other) |
Change the value the reference object points to. More... | |
int | compare (const String &other) const |
Compares this String object to other. More... | |
int | compare (const std::string &other) const |
Compares this String object to other. More... | |
int | compare (const char *other) const |
Compares this to other. More... | |
const char * | c_str () const |
Returns a pointer to the char array in the string. More... | |
size_t | size () const |
Return the length of the string. More... | |
size_t | length () const |
Return the length of the string. More... | |
bool | empty () const |
Retun if the string is empty. More... | |
char | at (size_t pos) const |
Read an element. More... | |
const char * | data () const |
Return the data pointer. More... | |
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS (String, ObjectRef, StringObj) | |
Public Member Functions inherited from tvm::runtime::ObjectRef | |
ObjectRef ()=default | |
default constructor More... | |
ObjectRef (ObjectPtr< Object > data) | |
Constructor from existing object ptr. More... | |
bool | same_as (const ObjectRef &other) const |
Comparator. More... | |
bool | operator== (const ObjectRef &other) const |
Comparator. More... | |
bool | operator!= (const ObjectRef &other) const |
Comparator. More... | |
bool | operator< (const ObjectRef &other) const |
Comparator. More... | |
bool | defined () const |
const Object * | get () const |
const Object * | operator-> () const |
bool | unique () const |
int | use_count () const |
template<typename ObjectType , typename = std::enable_if_t<std::is_base_of_v<Object, ObjectType>>> | |
const ObjectType * | as () const |
Try to downcast the internal Object to a raw pointer of a corresponding type. More... | |
template<typename ObjectRefType , typename = std::enable_if_t<std::is_base_of_v<ObjectRef, ObjectRefType>>> | |
Optional< ObjectRefType > | as () const |
Try to downcast the ObjectRef to a Optional<T> of the requested type. More... | |
Static Public Member Functions | |
static bool | CanConvertFrom (const TVMArgValue &val) |
Check if a TVMArgValue can be converted to String, i.e. it can be std::string or String. More... | |
static uint64_t | StableHashBytes (const char *data, size_t size) |
Hash the binary bytes. More... | |
Friends | |
struct | tvm::runtime::ObjectEqual |
String | operator+ (const String &lhs, const String &rhs) |
String | operator+ (const String &lhs, const std::string &rhs) |
String | operator+ (const std::string &lhs, const String &rhs) |
String | operator+ (const String &lhs, const char *rhs) |
String | operator+ (const char *lhs, const String &rhs) |
Additional Inherited Members | |
Public Types inherited from tvm::runtime::ObjectRef | |
using | ContainerType = Object |
type indicate the container type. More... | |
Static Public Attributes inherited from tvm::runtime::ObjectRef | |
static constexpr bool | _type_is_nullable = true |
Protected Member Functions inherited from tvm::runtime::ObjectRef | |
Object * | get_mutable () const |
Static Protected Member Functions inherited from tvm::runtime::ObjectRef | |
template<typename T > | |
static T | DowncastNoCheck (ObjectRef ref) |
Internal helper function downcast a ref without check. More... | |
static void | FFIClearAfterMove (ObjectRef *ref) |
Clear the object ref data field without DecRef after we successfully moved the field. More... | |
template<typename ObjectType > | |
static ObjectPtr< ObjectType > | GetDataPtr (const ObjectRef &ref) |
Internal helper function get data_ as ObjectPtr of ObjectType. More... | |
Protected Attributes inherited from tvm::runtime::ObjectRef | |
ObjectPtr< Object > | data_ |
Internal pointer that backs the reference. More... | |
Reference to string objects.
|
inline |
Construct an empty string.
|
inline |
Construct a new String object.
other | The moved/copied std::string object |
|
inline |
Construct a new String object.
other | a char array. |
|
inline |
Construct a new null object.
|
inline |
Read an element.
pos | The position at which to read the character. |
|
inline |
Returns a pointer to the char array in the string.
|
inlinestatic |
Check if a TVMArgValue can be converted to String, i.e. it can be std::string or String.
val | The value to be checked |
|
inline |
Compares this to other.
other | The character array to compare with. |
|
inline |
Compares this String object to other.
other | The string to compare with. |
|
inline |
|
inline |
Return the data pointer.
|
inline |
Retun if the string is empty.
|
inline |
Return the length of the string.
|
inline |
Change the value the reference object points to.
other | The value for the new String |
|
inline |
Change the value the reference object points to.
other | The value for the new String |
|
inline |
Return the length of the string.
|
inlinestatic |
Hash the binary bytes.
data | The data pointer |
size | The size of the bytes. |
|
friend |