Dynalib Utils
Public Types | Public Member Functions | List of all members
Catch::StringRef Class Reference

#include <catch.hpp>

Public Types

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
 

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.

Member Typedef Documentation

◆ const_iterator

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

◆ size_type

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

Constructor & Destructor Documentation

◆ StringRef() [1/4]

constexpr Catch::StringRef::StringRef ( )
defaultnoexcept

◆ StringRef() [2/4]

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

◆ StringRef() [3/4]

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

◆ StringRef() [4/4]

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

Member Function Documentation

◆ begin()

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

◆ c_str()

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

◆ data()

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

◆ empty()

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

◆ end()

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

◆ isNullTerminated()

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

◆ operator std::string()

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

◆ operator!=()

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

◆ operator==()

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

◆ operator[]()

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

◆ size()

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

◆ substr()

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

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