Go to the documentation of this file. 1 #ifndef OGLPLUS_GLSL_STRING_REF_HPP
9 #define OGLPLUS_GLSL_STRING_REF_HPP
14 namespace eagine::oglp {
28 : _src_str(
static_cast<const char_type*
>(src_str))
29 , _length(
int_type(n == 0 ? 0 : (src_str[n - 1] ==
'\0' ? n - 1 : n))) {}
45 mutable const char_type* _src_str{
nullptr};
55 template <span_
size_t N>
62 static inline auto operator"" _glsl(
const char* src_str, std::size_t n) noexcept
69 #endif // OGLPLUS_GLSL_STRING_REF_HPP
GLchar char_type
String character type.
Definition: config.hpp:46
Class referencing a set of GLSL source code strings.
Definition: source_ref.hpp:20
std::ptrdiff_t span_size_t
Signed span size type used by eagine.
Definition: types.hpp:36
static constexpr auto span_size(T v) noexcept
Converts argument to span size type.
Definition: types.hpp:59
GLint int_type
Signed integer type.
Definition: config.hpp:70
glsl_string_ref(memory::const_block blk) noexcept
Explicit construction from a memory const_block.
Definition: string_ref.hpp:36
gl_types::char_type char_type
Alias for string character type.
Definition: string_ref.hpp:21
glsl_string_ref(const char *src_str, span_size_t n) noexcept
Construction from a C-string and a length value.
Definition: string_ref.hpp:27
Non-owning view of a contiguous range of memory with ValueType elements.
Definition: flatten_fwd.hpp:16
Reference to a GLSL source code string.
Definition: string_ref.hpp:18
Wrapper class for a GLSL string literal, convertible to glsl_source_ref.
Definition: string_ref.hpp:52
glsl_literal(const char(&src_str)[N]) noexcept
Construction from a zero-terminated string literal.
Definition: string_ref.hpp:56
glsl_string_ref(string_view str) noexcept
Explicit construction from a string_view.
Definition: string_ref.hpp:32
gl_types::int_type int_type
Alias for signed intever type.
Definition: string_ref.hpp:24
static constexpr auto as_chars(block blk) noexcept
Converts a block into a span of characters.
Definition: block.hpp:48