SPH
Public Member Functions | Static Public Attributes | Friends | List of all members
String Class Reference

#include <String.h>

Public Member Functions

 String ()=default
 
 String (const String &other)
 
 String (String &&other)
 
 String (Array< char > &&buffer)
 
 String (const char *s)
 
Stringoperator= (const String &other)
 
Stringoperator= (String &&other)
 
Stringoperator+= (const String &other)
 
Stringoperator+= (const char c)
 
bool operator== (const String &other) const
 
bool operator!= (const String &other) const
 
const char * cStr () const
 
INLINE char operator[] (const Size idx) const
 
INLINE Size size () const
 
INLINE bool empty () const
 
Iterator< char > begin ()
 
Iterator< const char > begin () const
 
Iterator< char > end ()
 
Iterator< const char > end () const
 
Size find (const String &s, const Size pos=0) const
 
Size findAny (ArrayView< String > ss, const Size pos) const
 
Size findLast (const String &s) const
 
void replace (const Size pos, const Size n, const String &s)
 
void replace (const String &old, const String &s)
 
template<typename... TArgs>
void replace (const String &old, const String &s, TArgs &&... args)
 
String substr (const Size pos, const Size n=String::npos) const
 
String trim () const
 
String lower () const
 

Static Public Attributes

static Size npos = NumericLimits<Size>::max()
 

Friends

String operator+ (const String &s1, const String &s2)
 
std::ostream & operator<< (std::ostream &stream, const String &str)
 

Detailed Description

Definition at line 13 of file String.h.

Constructor & Destructor Documentation

◆ String() [1/5]

String::String ( )
default

◆ String() [2/5]

String::String ( const String other)
inline

Definition at line 20 of file String.h.

◆ String() [3/5]

String::String ( String &&  other)
inline

Definition at line 23 of file String.h.

◆ String() [4/5]

String::String ( Array< char > &&  buffer)
inline

Definition at line 28 of file String.h.

◆ String() [5/5]

String::String ( const char *  s)
inline

Definition at line 33 of file String.h.

Member Function Documentation

◆ begin() [1/2]

Iterator<char> String::begin ( )
inline

Iterators

Definition at line 100 of file String.h.

◆ begin() [2/2]

Iterator<const char> String::begin ( ) const
inline

Definition at line 104 of file String.h.

◆ cStr()

const char* String::cStr ( ) const
inline

Definition at line 81 of file String.h.

◆ empty()

INLINE bool String::empty ( ) const
inline

Definition at line 94 of file String.h.

◆ end() [1/2]

Iterator<char> String::end ( )
inline

Definition at line 108 of file String.h.

◆ end() [2/2]

Iterator<const char> String::end ( ) const
inline

Definition at line 112 of file String.h.

◆ find()

Size String::find ( const String s,
const Size  pos = 0 
) const

Definition at line 8 of file String.cpp.

◆ findAny()

Size String::findAny ( ArrayView< String ss,
const Size  pos 
) const

Definition at line 30 of file String.cpp.

◆ findLast()

Size String::findLast ( const String s) const

Definition at line 38 of file String.cpp.

◆ lower()

String String::lower ( ) const

Definition at line 117 of file String.cpp.

◆ operator!=()

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

Definition at line 77 of file String.h.

◆ operator+=() [1/2]

String& String::operator+= ( const char  c)
inline

Definition at line 66 of file String.h.

◆ operator+=() [2/2]

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

Definition at line 53 of file String.h.

◆ operator=() [1/2]

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

Definition at line 43 of file String.h.

◆ operator=() [2/2]

String& String::operator= ( String &&  other)
inline

Definition at line 48 of file String.h.

◆ operator==()

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

Definition at line 73 of file String.h.

◆ operator[]()

INLINE char String::operator[] ( const Size  idx) const
inline

Definition at line 85 of file String.h.

◆ replace() [1/3]

void String::replace ( const Size  pos,
const Size  n,
const String s 
)

Definition at line 60 of file String.cpp.

◆ replace() [2/3]

void String::replace ( const String old,
const String s 
)

Definition at line 76 of file String.cpp.

◆ replace() [3/3]

template<typename... TArgs>
void String::replace ( const String old,
const String s,
TArgs &&...  args 
)
inline

Definition at line 136 of file String.h.

◆ size()

INLINE Size String::size ( ) const
inline

Definition at line 90 of file String.h.

◆ substr()

String String::substr ( const Size  pos,
const Size  n = String::npos 
) const

Definition at line 84 of file String.cpp.

◆ trim()

String String::trim ( ) const

Definition at line 96 of file String.cpp.

Friends And Related Function Documentation

◆ operator+

String operator+ ( const String s1,
const String s2 
)
friend

Definition at line 60 of file String.h.

◆ operator<<

std::ostream& operator<< ( std::ostream &  stream,
const String str 
)
friend

Definition at line 116 of file String.h.

Member Data Documentation

◆ npos

NAMESPACE_SPH_BEGIN Size String::npos = NumericLimits<Size>::max()
static

Definition at line 123 of file String.h.


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