47 constexpr operator const char* ()
const noexcept {
return c_str(); }
59 constexpr bool empty() const noexcept {
return ptr ==
nullptr; }
65 constexpr const char*
c_str() const noexcept {
return ptr ? (
ptr +
sizeof(size_t)) :
nullptr; }
#define COGSFOUNDATION_API
Definition: FoundationBase.h:31
Represents a non-copyable immutable string.
Definition: ImmutableString.h:22
COGSFOUNDATION_API void release()
Definition: ImmutableString.cpp:62
constexpr ImmutableString & operator=(ImmutableString &&other) noexcept
Take ownership of another string.
Definition: ImmutableString.h:38
constexpr void swap(ImmutableString &other) noexcept
Swap contents with another string.
Definition: ImmutableString.h:53
constexpr const char * c_str() const noexcept
Get the string as C-string.
Definition: ImmutableString.h:65
constexpr ImmutableString() noexcept=default
Create an empty string.
constexpr Cogs::StringView asView() const noexcept
Explicitly view the string as a string view.
Definition: ImmutableString.h:56
constexpr size_t size() const noexcept
Get the string length.
Definition: ImmutableString.h:68
constexpr bool empty() const noexcept
Check if string is empty.
Definition: ImmutableString.h:59
char * ptr
Definition: ImmutableString.h:74
~ImmutableString()
Destructor.
Definition: ImmutableString.h:44
void clear()
Set contents to the empty string.
Definition: ImmutableString.h:62
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Main Cogs namespace.
Definition: MortonCode.h:5