Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
doctest::String Class Reference

#include <doctest.h>

Classes

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

Public Member Functions

const char * c_str () const
 
char * c_str ()
 
unsigned capacity () const
 
int compare (const char *other, bool no_case=false) const
 
int compare (const String &other, bool no_case=false) const
 
String operator+ (const String &other) const
 
Stringoperator+= (const String &other)
 
Stringoperator= (const String &other)
 
Stringoperator= (String &&other)
 
char operator[] (unsigned i) const
 
char & operator[] (unsigned i)
 
unsigned size () const
 
 String ()
 
 String (const char *in)
 
 String (const char *in, unsigned in_size)
 
 String (const String &other)
 
 String (String &&other)
 
 ~String ()
 

Private Member Functions

void copy (const String &other)
 
bool isOnStack () const
 
void setLast (unsigned in=last)
 
void setOnHeap ()
 

Private Attributes

union {
   char   buf [len]
 
   view   data
 
}; 
 

Static Private Attributes

static const unsigned last = len - 1
 OCLINT avoid private static members. More...
 
static const unsigned len = 24
 

Detailed Description

Definition at line 444 of file doctest.h.

Constructor & Destructor Documentation

◆ String() [1/5]

doctest::String::String ( )

◆ ~String()

doctest::String::~String ( )

◆ String() [2/5]

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

◆ String() [3/5]

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

◆ String() [4/5]

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

◆ String() [5/5]

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

Member Function Documentation

◆ c_str() [1/2]

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

Definition at line 489 of file doctest.h.

◆ c_str() [2/2]

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

Definition at line 490 of file doctest.h.

◆ capacity()

unsigned 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

◆ isOnStack()

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

Definition at line 462 of file doctest.h.

◆ operator+()

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

◆ 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)

◆ operator[]() [1/2]

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

◆ operator[]() [2/2]

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

◆ setLast()

void doctest::String::setLast ( unsigned  in = last)
private

◆ setOnHeap()

void doctest::String::setOnHeap ( )
private

◆ size()

unsigned doctest::String::size ( ) const

Member Data Documentation

◆ @78

union { ... }

◆ buf

char doctest::String::buf[len]

Definition at line 458 of file doctest.h.

◆ data

view doctest::String::data

Definition at line 459 of file doctest.h.

◆ last

const unsigned doctest::String::last = len - 1
staticprivate

OCLINT avoid private static members.

Definition at line 447 of file doctest.h.

◆ len

const unsigned doctest::String::len = 24
staticprivate

Definition at line 446 of file doctest.h.


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


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:23