kblib 0.2.3
General utilities library for modern C++
Catch::StringRef Class Reference

#include <catch/catch.hpp>

Public Types

using size_type = std::size_t
 
using const_iterator = const char *
 
using size_type = std::size_t
 
using const_iterator = const char *
 

Public Member Functions

constexpr StringRef () noexcept=default
 
 StringRef (char const *rawChars) noexcept
 
constexpr StringRef (char const *rawChars, size_type size) noexcept
 
 StringRef (std::string const &stdString) noexcept
 
 operator std::string () const
 
auto operator== (StringRef const &other) const noexcept -> bool
 
auto operator!= (StringRef const &other) const noexcept -> bool
 
auto operator[] (size_type index) const noexcept -> char
 
constexpr auto empty () const noexcept -> bool
 
constexpr auto size () const noexcept -> size_type
 
auto c_str () const -> char const *
 
auto substr (size_type start, size_type length) const noexcept -> StringRef
 
auto data () const noexcept -> char const *
 
constexpr auto isNullTerminated () const noexcept -> bool
 
constexpr const_iterator begin () const
 
constexpr const_iterator end () const
 
constexpr StringRef () noexcept=default
 
 StringRef (char const *rawChars) noexcept
 
constexpr StringRef (char const *rawChars, size_type size) noexcept
 
 StringRef (std::string const &stdString) noexcept
 
 operator std::string () const
 
auto operator== (StringRef const &other) const noexcept -> bool
 
auto operator!= (StringRef const &other) const noexcept -> bool
 
auto operator[] (size_type index) const noexcept -> char
 
constexpr auto empty () const noexcept -> bool
 
constexpr auto size () const noexcept -> size_type
 
auto c_str () const -> char const *
 
auto substr (size_type start, size_type length) const noexcept -> StringRef
 
auto data () const noexcept -> char const *
 
constexpr auto isNullTerminated () const noexcept -> bool
 
constexpr const_iterator begin () const
 
constexpr const_iterator end () const
 

Detailed Description

A non-owning string class (similar to the forthcoming std::string_view) Note that, because a StringRef may be a substring of another string, it may not be null terminated.

Definition at line 606 of file catch.hpp.

Member Typedef Documentation

◆ const_iterator [1/2]

using Catch::StringRef::const_iterator = const char*

Definition at line 609 of file catch.hpp.

◆ const_iterator [2/2]

using Catch::StringRef::const_iterator = const char*

Definition at line 609 of file catch.hpp.

◆ size_type [1/2]

using Catch::StringRef::size_type = std::size_t

Definition at line 608 of file catch.hpp.

◆ size_type [2/2]

using Catch::StringRef::size_type = std::size_t

Definition at line 608 of file catch.hpp.

Constructor & Destructor Documentation

◆ StringRef() [1/8]

constexpr Catch::StringRef::StringRef ( )
constexprdefaultnoexcept

◆ StringRef() [2/8]

Catch::StringRef::StringRef ( char const *  rawChars)
noexcept

◆ StringRef() [3/8]

constexpr Catch::StringRef::StringRef ( char const *  rawChars,
size_type  size 
)
inlineconstexprnoexcept

Definition at line 622 of file catch.hpp.

◆ StringRef() [4/8]

Catch::StringRef::StringRef ( std::string const &  stdString)
inlinenoexcept

Definition at line 627 of file catch.hpp.

◆ StringRef() [5/8]

constexpr Catch::StringRef::StringRef ( )
constexprdefaultnoexcept

◆ StringRef() [6/8]

Catch::StringRef::StringRef ( char const *  rawChars)
noexcept

◆ StringRef() [7/8]

constexpr Catch::StringRef::StringRef ( char const *  rawChars,
size_type  size 
)
inlineconstexprnoexcept

Definition at line 622 of file catch.hpp.

◆ StringRef() [8/8]

Catch::StringRef::StringRef ( std::string const &  stdString)
inlinenoexcept

Definition at line 627 of file catch.hpp.

Member Function Documentation

◆ begin() [1/2]

constexpr const_iterator Catch::StringRef::begin ( ) const
inlineconstexpr

Definition at line 673 of file catch.hpp.

◆ begin() [2/2]

constexpr const_iterator Catch::StringRef::begin ( ) const
inlineconstexpr

Definition at line 673 of file catch.hpp.

◆ c_str() [1/2]

auto Catch::StringRef::c_str ( ) const -> char const *

◆ c_str() [2/2]

auto Catch::StringRef::c_str ( ) const -> char const *

◆ data() [1/2]

auto Catch::StringRef::data ( ) const -> char const *
noexcept

◆ data() [2/2]

auto Catch::StringRef::data ( ) const -> char const *
noexcept

◆ empty() [1/2]

constexpr auto Catch::StringRef::empty ( ) const -> bool
inlineconstexprnoexcept

Definition at line 648 of file catch.hpp.

◆ empty() [2/2]

constexpr auto Catch::StringRef::empty ( ) const -> bool
inlineconstexprnoexcept

Definition at line 648 of file catch.hpp.

◆ end() [1/2]

constexpr const_iterator Catch::StringRef::end ( ) const
inlineconstexpr

Definition at line 674 of file catch.hpp.

◆ end() [2/2]

constexpr const_iterator Catch::StringRef::end ( ) const
inlineconstexpr

Definition at line 674 of file catch.hpp.

◆ isNullTerminated() [1/2]

constexpr auto Catch::StringRef::isNullTerminated ( ) const -> bool
inlineconstexprnoexcept

Definition at line 668 of file catch.hpp.

◆ isNullTerminated() [2/2]

constexpr auto Catch::StringRef::isNullTerminated ( ) const -> bool
inlineconstexprnoexcept

Definition at line 668 of file catch.hpp.

◆ operator std::string() [1/2]

Catch::StringRef::operator std::string ( ) const
inlineexplicit

Definition at line 632 of file catch.hpp.

◆ operator std::string() [2/2]

Catch::StringRef::operator std::string ( ) const
inlineexplicit

Definition at line 632 of file catch.hpp.

◆ operator!=() [1/2]

auto Catch::StringRef::operator!= ( StringRef const &  other) const -> bool
inlinenoexcept

Definition at line 638 of file catch.hpp.

◆ operator!=() [2/2]

auto Catch::StringRef::operator!= ( StringRef const &  other) const -> bool
inlinenoexcept

Definition at line 638 of file catch.hpp.

◆ operator==() [1/2]

auto Catch::StringRef::operator== ( StringRef const &  other) const -> bool
noexcept

◆ operator==() [2/2]

auto Catch::StringRef::operator== ( StringRef const &  other) const -> bool
noexcept

◆ operator[]() [1/2]

auto Catch::StringRef::operator[] ( size_type  index) const -> char
inlinenoexcept

Definition at line 642 of file catch.hpp.

◆ operator[]() [2/2]

auto Catch::StringRef::operator[] ( size_type  index) const -> char
inlinenoexcept

Definition at line 642 of file catch.hpp.

◆ size() [1/2]

constexpr auto Catch::StringRef::size ( ) const -> size_type
inlineconstexprnoexcept

Definition at line 651 of file catch.hpp.

◆ size() [2/2]

constexpr auto Catch::StringRef::size ( ) const -> size_type
inlineconstexprnoexcept

Definition at line 651 of file catch.hpp.

◆ substr() [1/2]

auto Catch::StringRef::substr ( size_type  start,
size_type  length 
) const -> StringRef
noexcept

◆ substr() [2/2]

auto Catch::StringRef::substr ( size_type  start,
size_type  length 
) const -> StringRef
noexcept

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