refactoredCPPNeuronMesher
doctest::String Class Reference

#include <doctest.h>

Collaboration diagram for doctest::String:

Classes

struct  view
 OCLINT avoid private static members. More...
 

Public Types

using size_type = unsigned
 

Public Member Functions

 String () noexcept
 
 ~String ()
 
 String (const char *in)
 
 String (const char *in, size_type in_size)
 
 String (std::istream &in, size_type in_size)
 
 String (const String &other)
 
Stringoperator= (const String &other)
 
Stringoperator+= (const String &other)
 
 String (String &&other) noexcept
 
Stringoperator= (String &&other) noexcept
 
char operator[] (size_type i) const
 
char & operator[] (size_type i)
 
const char * c_str () const
 
char * c_str ()
 
size_type size () const
 
size_type capacity () const
 
String substr (size_type pos, size_type cnt=npos) &&
 
String substr (size_type pos, size_type cnt=npos) const &
 
size_type find (char ch, size_type pos=0) const
 
size_type rfind (char ch, size_type pos=npos) const
 
int compare (const char *other, bool no_case=false) const
 
int compare (const String &other, bool no_case=false) const
 

Static Public Attributes

static constexpr size_type npos = static_cast<size_type>(-1)
 

Private Member Functions

char * allocate (size_type sz)
 
bool isOnStack () const noexcept
 
void setOnHeap () noexcept
 
void setLast (size_type in=last) noexcept
 
void setSize (size_type sz) noexcept
 
void copy (const String &other)
 

Private Attributes

union {
   char   buf [len]
 
   view   data
 
}; 
 

Static Private Attributes

static constexpr size_type len = 24
 
static constexpr size_type last = len - 1
 OCLINT avoid private static members. More...
 

Friends

std::ostreamoperator<< (std::ostream &s, const String &in)
 

Member Typedef Documentation

◆ size_type

using doctest::String::size_type = unsigned

Constructor & Destructor Documentation

◆ String() [1/6]

doctest::String::String ( )
noexcept

◆ ~String()

doctest::String::~String ( )

◆ String() [2/6]

doctest::String::String ( const char *  in)

◆ String() [3/6]

doctest::String::String ( const char *  in,
size_type  in_size 
)

◆ String() [4/6]

doctest::String::String ( std::istream in,
size_type  in_size 
)

◆ String() [5/6]

doctest::String::String ( const String other)

◆ String() [6/6]

doctest::String::String ( String &&  other)
noexcept

Member Function Documentation

◆ allocate()

char* doctest::String::allocate ( size_type  sz)
private

◆ c_str() [1/2]

char* doctest::String::c_str ( )
inline

◆ c_str() [2/2]

const char* doctest::String::c_str ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ capacity()

size_type doctest::String::capacity ( ) const

◆ compare() [1/2]

int doctest::String::compare ( const char *  other,
bool  no_case = false 
) const

◆ compare() [2/2]

int doctest::String::compare ( const String other,
bool  no_case = false 
) const

◆ copy()

void doctest::String::copy ( const String other)
private

◆ find()

size_type doctest::String::find ( char  ch,
size_type  pos = 0 
) const
Here is the caller graph for this function:

◆ isOnStack()

bool doctest::String::isOnStack ( ) const
inlineprivatenoexcept

◆ operator+=()

String& doctest::String::operator+= ( const String other)

◆ operator=() [1/2]

String& doctest::String::operator= ( const String other)

◆ operator=() [2/2]

String& doctest::String::operator= ( String &&  other)
noexcept

◆ operator[]() [1/2]

char& doctest::String::operator[] ( size_type  i)

◆ operator[]() [2/2]

char doctest::String::operator[] ( size_type  i) const

◆ rfind()

size_type doctest::String::rfind ( char  ch,
size_type  pos = npos 
) const

◆ setLast()

void doctest::String::setLast ( size_type  in = last)
privatenoexcept

◆ setOnHeap()

void doctest::String::setOnHeap ( )
privatenoexcept

◆ setSize()

void doctest::String::setSize ( size_type  sz)
privatenoexcept

◆ size()

size_type doctest::String::size ( ) const
Here is the caller graph for this function:

◆ substr() [1/2]

String doctest::String::substr ( size_type  pos,
size_type  cnt = npos 
) &&
Here is the caller graph for this function:

◆ substr() [2/2]

String doctest::String::substr ( size_type  pos,
size_type  cnt = npos 
) const &

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream s,
const String in 
)
friend

Member Data Documentation

◆ 

union { ... }

◆ buf

char doctest::String::buf[len]

◆ data

view doctest::String::data

◆ last

constexpr size_type doctest::String::last = len - 1
staticconstexprprivate

OCLINT avoid private static members.

◆ len

constexpr size_type doctest::String::len = 24
staticconstexprprivate

◆ npos

constexpr size_type doctest::String::npos = static_cast<size_type>(-1)
staticconstexpr

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