Golias Engine
A C++ 20 'game engine' built with SDL3 with wide platform support.
Public Member Functions | Static Public Member Functions | List of all members
String Class Reference

#include <str.h>

Inheritance diagram for String:

Public Member Functions

 String (const std::string &str)
 
 String (std::string &&str)
 
size_t length () const
 
bool is_empty () const
 
String to_lower () const
 
String to_upper () const
 
String substr (size_t from, size_t len=std::string::npos) const
 
int find (const String &what, int from=0) const
 
int find (char what, int from=0) const
 
int rfind (const String &what) const
 
int findn (const String &what, int from=0) const
 
bool begins_with (const String &text) const
 
bool ends_with (const String &text) const
 
bool contains (const String &what) const
 
String replace (const String &what, const String &forwhat) const
 
String replacen (const String &what, const String &forwhat) const
 
String strip_edges () const
 
String lstrip (const String &chars=" \t\n\r") const
 
String rstrip (const String &chars=" \t\n\r") const
 
Vector< Stringsplit (const char delimiter) const
 
String join (const Vector< String > &parts) const
 
String insert (size_t position, const String &what) const
 
String reverse () const
 
size_t hash () const
 
String operator+ (const String &other) const
 
String operator+ (const char *other) const
 

Static Public Member Functions

template<typename... Args>
static String format (const char *fmt, Args... args)
 

Constructor & Destructor Documentation

◆ String() [1/2]

String::String ( const std::string &  str)
inline

◆ String() [2/2]

String::String ( std::string &&  str)
inline

Member Function Documentation

◆ begins_with()

bool String::begins_with ( const String text) const

◆ contains()

bool String::contains ( const String what) const

◆ ends_with()

bool String::ends_with ( const String text) const

◆ find() [1/2]

int String::find ( char  what,
int  from = 0 
) const

◆ find() [2/2]

int String::find ( const String what,
int  from = 0 
) const

◆ findn()

int String::findn ( const String what,
int  from = 0 
) const

◆ format()

template<typename... Args>
String String::format ( const char *  fmt,
Args...  args 
)
inlinestatic

◆ hash()

size_t String::hash ( ) const

◆ insert()

String String::insert ( size_t  position,
const String what 
) const

◆ is_empty()

bool String::is_empty ( ) const
inline

◆ join()

String String::join ( const Vector< String > &  parts) const

◆ length()

size_t String::length ( ) const
inline

◆ lstrip()

String String::lstrip ( const String chars = " \t\n\r") const

◆ operator+() [1/2]

String String::operator+ ( const char *  other) const

◆ operator+() [2/2]

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

◆ replace()

String String::replace ( const String what,
const String forwhat 
) const

◆ replacen()

String String::replacen ( const String what,
const String forwhat 
) const

◆ reverse()

String String::reverse ( ) const

◆ rfind()

int String::rfind ( const String what) const

◆ rstrip()

String String::rstrip ( const String chars = " \t\n\r") const

◆ split()

Vector< String > String::split ( const char  delimiter) const

◆ strip_edges()

String String::strip_edges ( ) const

◆ substr()

String String::substr ( size_t  from,
size_t  len = std::string::npos 
) const

◆ to_lower()

String String::to_lower ( ) const

◆ to_upper()

String String::to_upper ( ) const

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