RigsofRods
Soft-body Physics Simulation
Public Member Functions | Private Attributes
RoR::Str< L > Class Template Reference

Wrapper for classic c-string (local buffer) Refresher: strlen() excludes '\0' terminator; strncat() Appends '\0' terminator. More...

#include <Str.h>

Public Member Functions

 Str ()
 
 Str (Str< L > const &src)
 
 Str (const char *src)
 
 Str (std::string::const_iterator &itor, std::string::const_iterator &endi)
 
const char * ToCStr () const
 
bool IsEmpty () const
 
char * GetBuffer ()
 
size_t GetCapacity () const
 
int Compare (const char *str) const
 
size_t GetLength () const
 
StrClear ()
 
StrAssign (const char *src)
 
StrAssign (std::string::const_iterator &itor, std::string::const_iterator &endi)
 
StrAppend (const char *src)
 
StrAppend (float f)
 
StrAppend (int i)
 
StrAppend (size_t z)
 
StrAppend (char c)
 
StrAppend (std::string::const_iterator &itor, std::string::const_iterator &endi)
 
 operator const char * () const
 
Stroperator= (const char *src)
 
Stroperator= (std::string const &str)
 
Stroperator<< (const char *src)
 
Stroperator<< (std::string const &str)
 
Stroperator<< (float f)
 
Stroperator<< (int i)
 
Stroperator<< (size_t z)
 
Stroperator<< (char c)
 
bool operator== (const char *other) const
 

Private Attributes

char m_buffer [L]
 
const size_t m_capacity = L
 

Detailed Description

template<size_t L>
class RoR::Str< L >

Wrapper for classic c-string (local buffer) Refresher: strlen() excludes '\0' terminator; strncat() Appends '\0' terminator.

Author
Petr Ohlidal, 2017

Definition at line 35 of file Str.h.

Constructor & Destructor Documentation

◆ Str() [1/4]

template<size_t L>
RoR::Str< L >::Str ( )
inline

Definition at line 39 of file Str.h.

◆ Str() [2/4]

template<size_t L>
RoR::Str< L >::Str ( Str< L > const &  src)
inline

Definition at line 40 of file Str.h.

◆ Str() [3/4]

template<size_t L>
RoR::Str< L >::Str ( const char *  src)
inline

Definition at line 41 of file Str.h.

◆ Str() [4/4]

template<size_t L>
RoR::Str< L >::Str ( std::string::const_iterator &  itor,
std::string::const_iterator &  endi 
)
inline

Definition at line 42 of file Str.h.

Member Function Documentation

◆ Append() [1/6]

template<size_t L>
Str& RoR::Str< L >::Append ( char  c)
inline

Definition at line 63 of file Str.h.

+ Here is the caller graph for this function:

◆ Append() [2/6]

template<size_t L>
Str& RoR::Str< L >::Append ( const char *  src)
inline

Definition at line 59 of file Str.h.

+ Here is the caller graph for this function:

◆ Append() [3/6]

template<size_t L>
Str& RoR::Str< L >::Append ( float  f)
inline

Definition at line 60 of file Str.h.

+ Here is the caller graph for this function:

◆ Append() [4/6]

template<size_t L>
Str& RoR::Str< L >::Append ( int  i)
inline

Definition at line 61 of file Str.h.

+ Here is the caller graph for this function:

◆ Append() [5/6]

template<size_t L>
Str& RoR::Str< L >::Append ( size_t  z)
inline

Definition at line 62 of file Str.h.

+ Here is the caller graph for this function:

◆ Append() [6/6]

template<size_t L>
Str& RoR::Str< L >::Append ( std::string::const_iterator &  itor,
std::string::const_iterator &  endi 
)
inline

Definition at line 64 of file Str.h.

◆ Assign() [1/2]

template<size_t L>
Str& RoR::Str< L >::Assign ( const char *  src)
inline

Definition at line 55 of file Str.h.

+ Here is the caller graph for this function:

◆ Assign() [2/2]

template<size_t L>
Str& RoR::Str< L >::Assign ( std::string::const_iterator &  itor,
std::string::const_iterator &  endi 
)
inline

Definition at line 56 of file Str.h.

◆ Clear()

template<size_t L>
Str& RoR::Str< L >::Clear ( )
inline

Definition at line 54 of file Str.h.

+ Here is the caller graph for this function:

◆ Compare()

template<size_t L>
int RoR::Str< L >::Compare ( const char *  str) const
inline

Definition at line 50 of file Str.h.

+ Here is the caller graph for this function:

◆ GetBuffer()

template<size_t L>
char* RoR::Str< L >::GetBuffer ( )
inline

Definition at line 48 of file Str.h.

+ Here is the caller graph for this function:

◆ GetCapacity()

template<size_t L>
size_t RoR::Str< L >::GetCapacity ( ) const
inline

Definition at line 49 of file Str.h.

+ Here is the caller graph for this function:

◆ GetLength()

template<size_t L>
size_t RoR::Str< L >::GetLength ( ) const
inline

Definition at line 51 of file Str.h.

+ Here is the caller graph for this function:

◆ IsEmpty()

template<size_t L>
bool RoR::Str< L >::IsEmpty ( ) const
inline

Definition at line 47 of file Str.h.

+ Here is the caller graph for this function:

◆ operator const char *()

template<size_t L>
RoR::Str< L >::operator const char * ( ) const
inline

Definition at line 68 of file Str.h.

◆ operator<<() [1/6]

template<size_t L>
Str& RoR::Str< L >::operator<< ( char  c)
inline

Definition at line 76 of file Str.h.

◆ operator<<() [2/6]

template<size_t L>
Str& RoR::Str< L >::operator<< ( const char *  src)
inline

Definition at line 71 of file Str.h.

◆ operator<<() [3/6]

template<size_t L>
Str& RoR::Str< L >::operator<< ( float  f)
inline

Definition at line 73 of file Str.h.

◆ operator<<() [4/6]

template<size_t L>
Str& RoR::Str< L >::operator<< ( int  i)
inline

Definition at line 74 of file Str.h.

◆ operator<<() [5/6]

template<size_t L>
Str& RoR::Str< L >::operator<< ( size_t  z)
inline

Definition at line 75 of file Str.h.

◆ operator<<() [6/6]

template<size_t L>
Str& RoR::Str< L >::operator<< ( std::string const &  str)
inline

Definition at line 72 of file Str.h.

◆ operator=() [1/2]

template<size_t L>
Str& RoR::Str< L >::operator= ( const char *  src)
inline

Definition at line 69 of file Str.h.

◆ operator=() [2/2]

template<size_t L>
Str& RoR::Str< L >::operator= ( std::string const &  str)
inline

Definition at line 70 of file Str.h.

◆ operator==()

template<size_t L>
bool RoR::Str< L >::operator== ( const char *  other) const
inline

Definition at line 77 of file Str.h.

◆ ToCStr()

template<size_t L>
const char* RoR::Str< L >::ToCStr ( ) const
inline

Definition at line 46 of file Str.h.

+ Here is the caller graph for this function:

Field Documentation

◆ m_buffer

template<size_t L>
char RoR::Str< L >::m_buffer[L]
private

Definition at line 80 of file Str.h.

◆ m_capacity

template<size_t L>
const size_t RoR::Str< L >::m_capacity = L
private

Definition at line 81 of file Str.h.


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