§tiro::string

Refers to a string value.

#include "tiropp/objects.hpp"

Inherits from handle

§Public Functions

Name
string(handle h)
string(const string & ) =default
string(string && ) =default
string &operator=(const string & ) =default
string &operator=(string && ) =default
std::string_viewview() const
Returns an unowned view into the string's storage without performing a copy.
std::stringvalue() const
Returns a copy of the string's content, converted to a std::string.

§Additional inherited members

Protected Classes inherited from handle

Name
structcheck_kind_t

Public Functions inherited from handle

Name
template <typename T >
T
as() const
Converts this value to the target type.
template <typename T >
T
as()
Converts this value to the target type.
handle(tiro_vm_t raw_vm)
Constructs a new handle instance.
handle(const handle & other)
Constructs a new handle and initialize is it with the same value as other.
handle(handle && other) =default
Move constructs a handle.
~handle() =default
boolvalid() const
Returns true if this handle points to an object (i.e. it was not moved from).
value_kindkind() const
Returns the kind of the value currently held by this handle.
template <typename T >
bool
is() const
Returns true if this value is of the target type.
typetype_of() const
Returns the type of the value currently held by this handle.
stringto_string() const
Returns a string that represents the current value.
tiro_vm_traw_vm() const
Returns the raw vm instance associated with this handle.
tiro_handle_traw_handle() const
Returns the raw handle instance (nullptr for invalid handles).

Protected Functions inherited from handle

Name
handle(check_kind_t , handle && other, value_kind expected)

Protected Attributes inherited from handle

Name
constexpr check_kind_tcheck_kind

§Public Functions Documentation

§function string

inline explicit string(
handle h
)

§function string

string(
const string &
) =default

§function string

string(
string &&
) =default

§function operator=

string & operator=(
const string &
) =default

§function operator=

string & operator=(
string &&
) =default

§function view

inline std::string_view view() const

Returns an unowned view into the string's storage without performing a copy.

Warning: The view points into the string's current storage. Because objects may move on the heap (e.g. because of garbage collection) this data may be invalidated. The data may only be used immediately after calling this function, before any other vm function might allocate and therefore might trigger a garbage collection cycle.

The view is not zero terminated.

§function value

inline std::string value() const

Returns a copy of the string's content, converted to a std::string.


Updated on 2022-02-27 at 21:17:13 +0100