YAHAL
Yet Another Hardware Abstraction Library
Loading...
Searching...
No Matches
YAHAL::String Class Reference

Public Member Functions

 String (const char *ptr="")
 
 String (const String &)
 
 String (char, uint16_t=1)
 
Stringoperator= (const char *)
 
Stringoperator= (const String &)
 
Stringoperator= (char)
 
 String (String &&)
 
Stringoperator= (String &&)
 
const char & operator[] (uint16_t) const
 
char & operator[] (uint16_t)
 
const char * c_str () const
 
bool operator== (const String &r) const
 
bool operator!= (const String &r) const
 
bool empty () const
 
uint16_t size () const
 
void reserve (uint16_t)
 
uint16_t capacity () const
 
void shrink_to_fit ()
 
void clear ()
 
Stringoperator+= (const String &)
 
String substr (uint16_t pos=0, uint16_t n=npos) const
 
uint16_t find (char c, uint16_t pos=0) const
 
String fill_left (uint16_t width, const char c=' ')
 
String fill_right (uint16_t width, const char c=' ')
 

Static Public Attributes

static const uint16_t npos = -1
 

Protected Member Functions

void reserve_only (uint16_t bytes)
 

Protected Attributes

uint16_t _len
 
uint16_t _cap
 
char * _ptr
 

Detailed Description

Definition at line 26 of file yahal_String.h.

Constructor & Destructor Documentation

◆ String() [1/4]

YAHAL::String::String ( const char * ptr = "")

Definition at line 21 of file yahal_String.cpp.

◆ String() [2/4]

YAHAL::String::String ( const String & s)

Definition at line 26 of file yahal_String.cpp.

◆ String() [3/4]

YAHAL::String::String ( char c,
uint16_t n = 1 )

Definition at line 31 of file yahal_String.cpp.

◆ ~String()

YAHAL::String::~String ( )
virtual

Definition at line 38 of file yahal_String.cpp.

◆ String() [4/4]

YAHAL::String::String ( String && s)

Definition at line 66 of file yahal_String.cpp.

Member Function Documentation

◆ c_str()

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

Definition at line 52 of file yahal_String.h.

◆ capacity()

uint16_t YAHAL::String::capacity ( ) const
inline

Definition at line 64 of file yahal_String.h.

◆ clear()

void YAHAL::String::clear ( )

Definition at line 127 of file yahal_String.cpp.

◆ empty()

bool YAHAL::String::empty ( ) const
inline

Definition at line 59 of file yahal_String.h.

◆ fill_left()

String YAHAL::String::fill_left ( uint16_t width,
const char c = ' ' )

Definition at line 159 of file yahal_String.cpp.

◆ fill_right()

String YAHAL::String::fill_right ( uint16_t width,
const char c = ' ' )

Definition at line 167 of file yahal_String.cpp.

◆ find()

uint16_t YAHAL::String::find ( char c,
uint16_t pos = 0 ) const

Definition at line 151 of file yahal_String.cpp.

◆ operator!=()

bool YAHAL::String::operator!= ( const String & r) const

Definition at line 102 of file yahal_String.cpp.

◆ operator+=()

String & YAHAL::String::operator+= ( const String & s)

Definition at line 132 of file yahal_String.cpp.

◆ operator=() [1/4]

String & YAHAL::String::operator= ( char c)

Definition at line 58 of file yahal_String.cpp.

◆ operator=() [2/4]

String & YAHAL::String::operator= ( const char * ptr)

Definition at line 43 of file yahal_String.cpp.

◆ operator=() [3/4]

String & YAHAL::String::operator= ( const String & s)

Definition at line 51 of file yahal_String.cpp.

◆ operator=() [4/4]

String & YAHAL::String::operator= ( String && s)

Definition at line 73 of file yahal_String.cpp.

◆ operator==()

bool YAHAL::String::operator== ( const String & r) const

Definition at line 92 of file yahal_String.cpp.

◆ operator[]() [1/2]

char & YAHAL::String::operator[] ( uint16_t pos)

Definition at line 87 of file yahal_String.cpp.

◆ operator[]() [2/2]

const char & YAHAL::String::operator[] ( uint16_t pos) const

Definition at line 82 of file yahal_String.cpp.

◆ reserve()

void YAHAL::String::reserve ( uint16_t size)

Definition at line 107 of file yahal_String.cpp.

◆ reserve_only()

void YAHAL::String::reserve_only ( uint16_t bytes)
protected

Definition at line 179 of file yahal_String.cpp.

◆ shrink_to_fit()

void YAHAL::String::shrink_to_fit ( )

Definition at line 117 of file yahal_String.cpp.

◆ size()

uint16_t YAHAL::String::size ( ) const
inline

Definition at line 60 of file yahal_String.h.

◆ substr()

String YAHAL::String::substr ( uint16_t pos = 0,
uint16_t n = npos ) const

Definition at line 140 of file yahal_String.cpp.

Member Data Documentation

◆ _cap

uint16_t YAHAL::String::_cap
protected

Definition at line 97 of file yahal_String.h.

◆ _len

uint16_t YAHAL::String::_len
protected

Definition at line 96 of file yahal_String.h.

◆ _ptr

char* YAHAL::String::_ptr
protected

Definition at line 98 of file yahal_String.h.

◆ npos

const uint16_t YAHAL::String::npos = -1
static

Definition at line 30 of file yahal_String.h.


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