CString Class Reference

Class to manage a NUL-terminated C-style string When storing persistent strings in RAM the regular String class can become inefficient, so using a regular char* can be preferable. This class provides that with additional methods to simplify lifetime management and provide some interoperability with Wiring String objects. More...

#include <CString.h>

Inheritance diagram for CString:
Collaboration diagram for CString:

Public Member Functions

 CString ()=default
 
 CString (const CString &src)
 
 CString (const String &src)
 
 CString (const char *src)
 
void assign (const String &src)
 
void assign (const char *src)
 
void assign (const char *src, size_t len)
 
CStringoperator= (const CString &src)
 
CStringoperator= (const String &src)
 
CStringoperator= (const char *src)
 
char * begin ()
 
const char * c_str () const
 
bool equals (const CString &other) const
 
bool equals (const String &other) const
 
bool equals (const char *other) const
 
bool equalsIgnoreCase (const CString &other) const
 
bool equalsIgnoreCase (const String &other) const
 
bool equalsIgnoreCase (const char *other) const
 
bool operator== (const CString &other) const
 
bool operator== (const String &other) const
 
bool operator== (const char *other) const
 
size_t length () const
 
 operator String () const
 

Detailed Description

Class to manage a NUL-terminated C-style string When storing persistent strings in RAM the regular String class can become inefficient, so using a regular char* can be preferable. This class provides that with additional methods to simplify lifetime management and provide some interoperability with Wiring String objects.

Constructor & Destructor Documentation

◆ CString() [1/4]

CString::CString ( )
default

◆ CString() [2/4]

CString::CString ( const CString src)
inline

◆ CString() [3/4]

CString::CString ( const String src)
inline

◆ CString() [4/4]

CString::CString ( const char *  src)
inline

Member Function Documentation

◆ assign() [1/3]

void CString::assign ( const char *  src)
inline

◆ assign() [2/3]

void CString::assign ( const char *  src,
size_t  len 
)
inline

◆ assign() [3/3]

void CString::assign ( const String src)
inline

◆ begin()

char* CString::begin ( )
inline

◆ c_str()

const char* CString::c_str ( ) const
inline

◆ equals() [1/3]

bool CString::equals ( const char *  other) const
inline

◆ equals() [2/3]

bool CString::equals ( const CString other) const
inline

◆ equals() [3/3]

bool CString::equals ( const String other) const
inline

◆ equalsIgnoreCase() [1/3]

bool CString::equalsIgnoreCase ( const char *  other) const
inline

◆ equalsIgnoreCase() [2/3]

bool CString::equalsIgnoreCase ( const CString other) const
inline

◆ equalsIgnoreCase() [3/3]

bool CString::equalsIgnoreCase ( const String other) const
inline

◆ length()

size_t CString::length ( ) const
inline

◆ operator String()

CString::operator String ( ) const
inlineexplicit

◆ operator=() [1/3]

CString& CString::operator= ( const char *  src)
inline

◆ operator=() [2/3]

CString& CString::operator= ( const CString src)
inline

◆ operator=() [3/3]

CString& CString::operator= ( const String src)
inline

◆ operator==() [1/3]

bool CString::operator== ( const char *  other) const
inline

◆ operator==() [2/3]

bool CString::operator== ( const CString other) const
inline

◆ operator==() [3/3]

bool CString::operator== ( const String other) const
inline

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