Blender
V3.3
|
#include <BLI_string_ref.hh>
Public Member Functions | |
#StringRef Inline Methods | |
constexpr | StringRef () |
constexpr | StringRef (StringRefNull other) |
constexpr | StringRef (const char *str) |
constexpr | StringRef (const char *str, int64_t length) |
constexpr | StringRef (const char *begin, const char *one_after_end) |
constexpr | StringRef (std::string_view view) |
StringRef (const std::string &str) | |
constexpr StringRef | drop_prefix (int64_t n) const |
constexpr StringRef | drop_known_prefix (StringRef prefix) const |
constexpr StringRef | drop_suffix (int64_t n) const |
constexpr char | operator[] (int64_t index) const |
![]() | |
constexpr int64_t | size () const |
constexpr bool | is_empty () const |
constexpr const char * | data () const |
constexpr | operator Span< char > () const |
operator std::string () const | |
constexpr | operator std::string_view () const |
constexpr const char * | begin () const |
constexpr const char * | end () const |
constexpr IndexRange | index_range () const |
void | unsafe_copy (char *dst) const |
void | copy (char *dst, int64_t dst_size) const |
template<size_t N> | |
void | copy (char(&dst)[N]) const |
constexpr bool | startswith (StringRef prefix) const |
constexpr bool | endswith (StringRef suffix) const |
constexpr StringRef | substr (int64_t start, int64_t size) const |
constexpr const char & | front () const |
constexpr const char & | back () const |
constexpr int64_t | find (char c, int64_t pos=0) const |
constexpr int64_t | find (StringRef str, int64_t pos=0) const |
constexpr int64_t | rfind (char c, int64_t pos=INT64_MAX) const |
constexpr int64_t | rfind (StringRef str, int64_t pos=INT64_MAX) const |
constexpr int64_t | find_first_of (StringRef chars, int64_t pos=0) const |
constexpr int64_t | find_first_of (char c, int64_t pos=0) const |
constexpr int64_t | find_last_of (StringRef chars, int64_t pos=INT64_MAX) const |
constexpr int64_t | find_last_of (char c, int64_t pos=INT64_MAX) const |
constexpr int64_t | find_first_not_of (StringRef chars, int64_t pos=0) const |
constexpr int64_t | find_first_not_of (char c, int64_t pos=0) const |
constexpr int64_t | find_last_not_of (StringRef chars, int64_t pos=INT64_MAX) const |
constexpr int64_t | find_last_not_of (char c, int64_t pos=INT64_MAX) const |
constexpr StringRef | trim () const |
constexpr StringRef | trim (StringRef characters_to_remove) const |
constexpr StringRef | trim (char character_to_remove) const |
Additional Inherited Members | |
![]() | |
static constexpr int64_t | not_found = -1 |
![]() | |
constexpr | StringRefBase (const char *data, int64_t size) |
![]() | |
const char * | data_ |
int64_t | size_ |
References a const char array. It might not be null terminated.
Definition at line 123 of file BLI_string_ref.hh.
|
constexpr |
Definition at line 492 of file BLI_string_ref.hh.
Referenced by drop_prefix(), and drop_suffix().
|
constexpr |
StringRefNull can be converted into StringRef, but not the other way around.
Definition at line 499 of file BLI_string_ref.hh.
|
constexpr |
Create a StringRef from a null-terminated c-string.
Definition at line 506 of file BLI_string_ref.hh.
|
constexpr |
Definition at line 511 of file BLI_string_ref.hh.
|
constexpr |
Create a StringRef from a start and end pointer. This invokes undefined behavior when the second point points to a smaller address than the first one.
Definition at line 562 of file BLI_string_ref.hh.
References blender::StringRefBase::begin(), and BLI_assert.
|
constexpr |
Definition at line 577 of file BLI_string_ref.hh.
|
inline |
Reference a std::string. Remember that when the std::string is destructed, the StringRef will point to uninitialized memory.
Definition at line 572 of file BLI_string_ref.hh.
Return a new StringRef with the given prefix being skipped. This invokes undefined behavior if the string does not begin with the given prefix.
Definition at line 531 of file BLI_string_ref.hh.
References BLI_assert, drop_prefix(), blender::StringRefBase::size(), and blender::StringRefBase::startswith().
Referenced by blender::tests::TEST(), and version_node_socket_id_delim().
Returns a new StringRef that does not contain the first n chars. This invokes undefined behavior when n is negative.
Definition at line 519 of file BLI_string_ref.hh.
References BLI_assert, blender::StringRefBase::data_, min, blender::StringRefBase::size_, and StringRef().
Referenced by drop_known_prefix(), blender::string_search::extract_normalized_words(), blender::bke::cryptomatte::manifest::from_manifest(), blender::bke::cryptomatte::manifest::skip_whitespaces_(), and blender::tests::TEST().
Return a new StringRef that does not contain the last n chars. This invokes undefined behavior when n is negative.
Definition at line 541 of file BLI_string_ref.hh.
References BLI_assert, blender::StringRefBase::data_, blender::StringRefBase::size_, and StringRef().
Referenced by blender::tests::TEST().
|
constexpr |
Get the char at the given index.
Definition at line 551 of file BLI_string_ref.hh.
References BLI_assert, blender::StringRefBase::data_, and blender::StringRefBase::size_.