|
Blender V5.3
|
#include <BLI_string_ref.hh>
Public Types | |
| using | value_type = char |
Public Member Functions | |
| 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 | copy_utf8_truncated (char *dst, int64_t dst_size) const |
| template<size_t N> | |
| void | copy_utf8_truncated (char(&dst)[N]) const |
| void | copy_bytes_truncated (char *dst, int64_t dst_size) const |
| template<size_t N> | |
| void | copy_bytes_truncated (char(&dst)[N]) const |
| void | copy_unsafe (char *dst) 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 |
| constexpr StringRef | trim_left () const |
| constexpr StringRef | trim_left (StringRef characters_to_remove) const |
| constexpr StringRef | trim_right () const |
| constexpr StringRef | trim_right (StringRef characters_to_remove) const |
Static Public Attributes | |
| static constexpr int64_t | not_found = -1 |
Protected Member Functions | |
| constexpr | StringRefBase (const char *data, int64_t size) |
Protected Attributes | |
| const char * | data_ |
| int64_t | size_ |
A common base class for StringRef and StringRefNull. This should never be used in other files. It only exists to avoid some code duplication.
Definition at line 49 of file BLI_string_ref.hh.
| using blender::StringRefBase::value_type = char |
Makes this type "string-like" for some libraries (e.g. fmt).
Definition at line 59 of file BLI_string_ref.hh.
|
constexprprotected |
|
constexpr |
|
constexpr |
| void blender::StringRefBase::copy_bytes_truncated | ( | char * | dst, |
| int64_t | dst_size ) const |
Copy the string into a char array. The copied string will be null-terminated. If it does not fit, it will be truncated.
| void blender::StringRefBase::copy_bytes_truncated | ( | char(&) | dst[N] | ) | const |
References N.
| void blender::StringRefBase::copy_unsafe | ( | char * | dst | ) | const |
Copy the string into a buffer. The buffer has to be one byte larger than the size of the string, because the copied string will be null-terminated. Only use this when you are absolutely sure that the buffer is large enough.
| void blender::StringRefBase::copy_utf8_truncated | ( | char * | dst, |
| int64_t | dst_size ) const |
Copy the string into a char array. The copied string will be null-terminated. If it does not fit, it will be truncated while keeping it valid UTF8 (assuming the StringRef itself is valid UTF8).
| void blender::StringRefBase::copy_utf8_truncated | ( | char(&) | dst[N] | ) | const |
References N.
|
constexpr |
Referenced by StringRefBase().
|
constexpr |
|
constexpr |
|
constexpr |
The behavior of those functions matches the standard library implementation of std::string_view.
|
constexpr |
References str.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
References INT64_MAX.
|
constexpr |
References INT64_MAX.
|
constexpr |
References INT64_MAX.
|
constexpr |
References INT64_MAX.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
| blender::StringRefBase::operator std::string | ( | ) | const |
|
constexpr |
|
constexpr |
References INT64_MAX.
|
constexpr |
|
constexpr |
Referenced by StringRefBase(), and substr().
|
constexpr |
|
constexpr |
References size().
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
protected |
Definition at line 52 of file BLI_string_ref.hh.
|
staticconstexpr |
Similar to #string_view::npos, but signed.
Definition at line 62 of file BLI_string_ref.hh.
Referenced by blender::rna_path_rename_fix().
|
protected |
Definition at line 53 of file BLI_string_ref.hh.