Blender V4.3
StringRefNull Class Reference

#include <BLI_string_ref.hh>

Inherits blender::StringRefBase.

Public Member Functions

#StringRefNull Inline Methods
constexpr StringRefNull ()
constexpr StringRefNull (const char *str, int64_t size)
 StringRefNull (const char *str)
 StringRefNull (const std::string &str)
constexpr char operator[] (int64_t index) const
constexpr const char * c_str () 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 Public Attributes inherited from blender::StringRefBase
static constexpr int64_t not_found = -1
constexpr StringRefBase (const char *data, int64_t size)
Protected Attributes inherited from blender::StringRefBase
const char * data_
int64_t size_

Detailed Description

References a null-terminated const char array.

StringRefNull can be compared with StringRef and StringRefNull.

Definition at line 111 of file BLI_string_ref.hh.

Constructor & Destructor Documentation

◆ StringRefNull() [1/4]

blender::StringRefNull::StringRefNull ( )
constexpr

Definition at line 430 of file BLI_string_ref.hh.

◆ StringRefNull() [2/4]

blender::StringRefNull::StringRefNull ( const char * str,
int64_t size )
constexpr

Construct a StringRefNull from a null terminated c-string. This invokes undefined behavior when the given size is not the correct size of the string.

Definition at line 436 of file BLI_string_ref.hh.

◆ StringRefNull() [3/4]

blender::StringRefNull::StringRefNull ( const char * str)
inline

Construct a StringRefNull from a null terminated c-string. The pointer must not point to NULL.

Definition at line 446 of file BLI_string_ref.hh.

◆ StringRefNull() [4/4]

blender::StringRefNull::StringRefNull ( const std::string & str)
inline

Reference a std::string. Remember that when the std::string is destructed, the StringRefNull will point to uninitialized memory.

Definition at line 456 of file BLI_string_ref.hh.

Member Function Documentation

◆ c_str()

const char * blender::StringRefNull::c_str ( ) const
constexpr

Returns the beginning of a null-terminated char array.

This is like ->data(), but can only be called on a StringRefNull.

Definition at line 477 of file BLI_string_ref.hh.

Referenced by count_active_texture_sampler(), and blender::gpu::GLShaderInterface::GLShaderInterface().

◆ operator[]()

char blender::StringRefNull::operator[] ( int64_t index) const
constexpr

Get the char at the given index.

Definition at line 464 of file BLI_string_ref.hh.


The documentation for this class was generated from the following file: