7#ifndef CATCH_STRINGREF_H_INCLUDED
8#define CATCH_STRINGREF_H_INCLUDED
33 char* m_data =
nullptr;
37 static constexpr char const*
const s_empty =
"";
45 : m_start( other.m_start ),
46 m_size( other.m_size )
50 : m_start( other.m_start ),
51 m_size( other.m_size ),
52 m_data( other.m_data )
54 other.m_data =
nullptr;
57 StringRef(
char const* rawChars )
noexcept;
60 : m_start( rawChars ),
65 : m_start( stdString.c_str() ),
66 m_size( stdString.size() )
76 m_start = other.m_start;
77 m_size = other.m_size;
81 operator std::string()
const;
92 auto empty() const noexcept ->
bool {
100 auto
c_str() const ->
char const*;
110 auto isOwned() const noexcept ->
bool;
111 auto isSubstring() const noexcept ->
bool;
115 auto operator + (
StringRef const& lhs,
char const* rhs ) ->
std::
string;
116 auto operator + (
char const* lhs,
StringRef const& rhs ) ->
std::
string;
118 auto operator += (
std::
string& lhs,
StringRef const& sr ) ->
std::
string&;
122 inline auto operator "" _sr(
char const* rawChars,
std::
size_t size ) noexcept ->
StringRef {
128inline auto operator "" _catch_sr(
char const* rawChars, std::size_t size )
noexcept ->
Catch::StringRef {
auto operator=(StringRef const &other) noexcept -> StringRef &
auto c_str() const -> char const *
auto substr(size_type start, size_type size) const noexcept -> StringRef
StringRef(StringRef const &other) noexcept
StringRef(char const *rawChars, size_type size) noexcept
StringRef(StringRef &&other) noexcept
auto operator[](size_type index) const noexcept -> char
auto numberOfCharacters() const noexcept -> size_type
StringRef(std::string const &stdString) noexcept
void swap(StringRef &other) noexcept
auto operator!=(StringRef const &other) const noexcept -> bool
auto operator==(StringRef const &other) const noexcept -> bool
auto empty() const noexcept -> bool
auto size() const noexcept -> size_type
auto currentData() const noexcept -> char const *
GenericStringRef< CharType > StringRef(const CharType *str)
Mark a character pointer as constant string.