EHS
Loading...
Searching...
No Matches
ehs::Str< T, N > Class Template Reference

#include <Str.h>

Public Member Functions

 ~Str ()
 Frees any data created on the heap.
 
 Str ()
 Default members initialization.
 
 Str (const T *const str, const N size)
 
 Str (const T *const str)
 
 Str (const N size)
 
 Str (Str &&str) noexcept
 A move constructor.
 
 Str (const Str &str)
 
Stroperator= (Str &&str) noexcept
 
Stroperator= (const Str &str)
 
Str< T, N > & operator= (const T *const str)
 
Str< T, N > & operator+= (const T *const str)
 
Str< T, N > & operator+= (const Str< T, N > &str)
 
Str< T, N > & operator+= (const SInt_64 num)
 
Str< T, N > & operator+= (const UInt_64 num)
 
Str< T, N > & operator+= (const SInt_32 num)
 
Str< T, N > & operator+= (const UInt_32 num)
 
Str< T, N > & operator+= (const SInt_16 num)
 
Str< T, N > & operator+= (const UInt_16 num)
 
Str< T, N > & operator+= (const SInt_8 num)
 
Str< T, N > & operator+= (const UInt_8 num)
 
Str< T, N > & operator+= (const float num)
 
Str< T, N > & operator+= (const double num)
 
Str< T, N > & operator+= (const long double num)
 
Str< T, N > operator+ (const T *const str) const
 
Str< T, N > operator+ (const Str< T, N > &str) const
 
Str< T, N > operator+ (const SInt_64 num) const
 
Str< T, N > operator+ (const UInt_64 num) const
 
Str< T, N > operator+ (const SInt_32 num) const
 
Str< T, N > operator+ (const UInt_32 num) const
 
Str< T, N > operator+ (const SInt_16 num) const
 
Str< T, N > operator+ (const UInt_16 num) const
 
Str< T, N > operator+ (const SInt_8 num) const
 
Str< T, N > operator+ (const UInt_8 num) const
 
Str< T, N > operator+ (const float num) const
 
Str< T, N > operator+ (const double num) const
 
Str< T, N > operator+ (const long double num) const
 
bool operator== (T *str) const
 
bool operator== (const T *const str) const
 
bool operator== (const Str< T, N > &str) const
 
bool operator!= (const T *const str) const
 
bool operator!= (const Str< T, N > &str) const
 
 operator T* () const
 Retrieves the raw C-style string from casting a string object.
 
void Resize (const N newSize)
 
Size (bool inBytes=false) const
 
void ExactSize ()
 Finds the null terminator in the string and makes it the exact size if greater than.
 
void Copy (const N dstOffset, const Str< T, N > &src)
 
void Copy (const N dstOffset, const T *const src)
 
void Copy (const N dstOffset, const T *const src, const N srcSize)
 
void Insert (const N index, const Str &value)
 
void Insert (const N index, const T value)
 
Str Remove (const N start, const N end)
 
Remove (const N index)
 
void Push (const Str< T, N > &value)
 
void Push (const T *const value, const N size)
 
void Push (const T *const value)
 
void Push (const T value)
 
Pop ()
 
const ByteToBytes () const
 
ByteToBytes ()
 
void ToLower ()
 Converts all upper-case ASCII characters to lower-case.
 
Str< T, N > GetLower () const
 
void ToUpper ()
 Converts all lower-case ASCII characters to upper-case.
 
Str< T, N > GetUpper () const
 
void Reverse ()
 Reverses the entire string object.
 
Str< T, N > GetReverse ()
 
Str< T, N > Sub (const N index, const N size=0) const
 
Vector< Str< T, N >, N > Split (const Str< T, N > &delimeter, const N max=0) const
 
Str< T, N > RemoveAll (const Str< T, N > &delimeter) const
 
Str ReplaceAll (const Str &delimeter, const Str &replacer) const
 
bool Find (const Str< T, N > &delimeter, N *const index=nullptr, const SearchPattern pattern=SearchPattern::LEFT_RIGHT, const IndexResult result=IndexResult::BEGINNING) const
 
bool Contains (const Str< T, N > &delimeter, const SearchPattern pattern=SearchPattern::LEFT_RIGHT) const
 
Vector< StrParseArgs () const
 
bool IsNum () const
 
template<typename I = int>
HexToNum () const
 
template<typename I = N>
ToDecimal () const
 
float ToFloat () const
 
double ToDouble () const
 
long double ToLDouble () const
 
UInt_32 Hash_32 () const
 
UInt_64 Hash_64 () const
 

Static Public Member Functions

template<typename I = int>
static Str NumToHex (const I num)
 
template<typename I = int>
static I HexToNum (const Str &in)
 
static Str< T, N > FromNum (const SInt_64 num)
 
static Str< T, N > FromNum (const UInt_64 num)
 
static Str< T, N > FromNum (const SInt_32 num)
 
static Str< T, N > FromNum (const UInt_32 num)
 
static Str< T, N > FromNum (const SInt_16 num)
 
static Str< T, N > FromNum (const UInt_16 num)
 
static Str< T, N > FromNum (const SInt_8 num)
 
static Str< T, N > FromNum (const UInt_8 num)
 
static Str< T, N > FromNum (const float num, const UInt_8 maxDecimals=5)
 
static Str< T, N > FromNum (const double num, const UInt_8 maxDecimals=5)
 
static Str< T, N > FromNum (const long double num, const UInt_8 maxDecimals=5)
 
static UInt_32 Hash_32 (const Str< T, N > &str)
 
static UInt_64 Hash_64 (const Str< T, N > &str)
 
static N Len (const T *const str)
 
static bool Cmp (const T *const a, const T *const b)
 

Detailed Description

template<typename T = Char_8, typename N = UInt_64>
class ehs::Str< T, N >

A helper class for C-style strings.

Template Parameters
TThe character's data type to use.
NThe number data type to use.

Constructor & Destructor Documentation

◆ ~Str()

template<typename T = Char_8, typename N = UInt_64>
ehs::Str< T, N >::~Str ( )
inline

Frees any data created on the heap.

◆ Str() [1/6]

template<typename T = Char_8, typename N = UInt_64>
ehs::Str< T, N >::Str ( )
inline

Default members initialization.

◆ Str() [2/6]

template<typename T = Char_8, typename N = UInt_64>
ehs::Str< T, N >::Str ( const T *const str,
const N size )
inline

Initializes members with given C-style string.

Parameters
[in]strThe C-style string.
[in]sizeThe size of the given C-style string.

◆ Str() [3/6]

template<typename T = Char_8, typename N = UInt_64>
ehs::Str< T, N >::Str ( const T *const str)
inline

Initializes members with given C-style string.

Parameters
[in]strThe C-style string.

◆ Str() [4/6]

template<typename T = Char_8, typename N = UInt_64>
ehs::Str< T, N >::Str ( const N size)
inline

Initializes string with the given size.

Parameters
[in]sizeThe size.

◆ Str() [5/6]

template<typename T = Char_8, typename N = UInt_64>
ehs::Str< T, N >::Str ( Str< T, N > && str)
inlinenoexcept

A move constructor.

◆ Str() [6/6]

template<typename T = Char_8, typename N = UInt_64>
ehs::Str< T, N >::Str ( const Str< T, N > & str)
inline

Copies all members from the given string object.

Parameters
[in]strThe string object to copy from.

Member Function Documentation

◆ Cmp()

template<typename T = Char_8, typename N = UInt_64>
static bool ehs::Str< T, N >::Cmp ( const T *const a,
const T *const b )
inlinestatic

Compares two C-style string with each other.

Parameters
[in]aThe first C-style string to compare.
[in]bThe second C-style string to compare.
Returns
True if both C-style strings are equal.

◆ Contains()

template<typename T = Char_8, typename N = UInt_64>
bool ehs::Str< T, N >::Contains ( const Str< T, N > & delimeter,
const SearchPattern pattern = SearchPattern::LEFT_RIGHT ) const
inline

Checks if the current string contains the given ide.

Parameters
[in]delimeterThe given ide to check for.
[in]patternThe search pattern to use.
Returns
True if the current string does contain the ide.

◆ Copy() [1/3]

template<typename T = Char_8, typename N = UInt_64>
void ehs::Str< T, N >::Copy ( const N dstOffset,
const Str< T, N > & src )
inline

Copies a string object to the referenced string object.

Parameters
dstOffsetThe offset index to copy to.
srcThe source string object to copy from.

◆ Copy() [2/3]

template<typename T = Char_8, typename N = UInt_64>
void ehs::Str< T, N >::Copy ( const N dstOffset,
const T *const src )
inline

Copies a C-style string to the referenced string object.

Parameters
dstOffsetThe offset index to copy to.
srcThe source C-style string to copy from.

◆ Copy() [3/3]

template<typename T = Char_8, typename N = UInt_64>
void ehs::Str< T, N >::Copy ( const N dstOffset,
const T *const src,
const N srcSize )
inline

Copies a C-style string to the referenced string object.

Parameters
dstOffsetThe offset index to copy to.
srcThe source C-style string to copy from.
srcSizeThe size of the source C-style string.

◆ ExactSize()

template<typename T = Char_8, typename N = UInt_64>
void ehs::Str< T, N >::ExactSize ( )
inline

Finds the null terminator in the string and makes it the exact size if greater than.

◆ Find()

template<typename T = Char_8, typename N = UInt_64>
bool ehs::Str< T, N >::Find ( const Str< T, N > & delimeter,
N *const index = nullptr,
const SearchPattern pattern = SearchPattern::LEFT_RIGHT,
const IndexResult result = IndexResult::BEGINNING ) const
inline

Finds the first instance of the given string object.

Parameters
[in]delimeterThe string to look for.
[out]indexThe index of the string found. Can be a nullptr.
[in]patternThe search pattern for optimization.
[in]resultWhat index to return where the first instance is found.
Returns
The index where the instance was found with the result varying from the result parameter.

◆ FromNum() [1/11]

template<typename T = Char_8, typename N = UInt_64>
static Str< T, N > ehs::Str< T, N >::FromNum ( const double num,
const UInt_8 maxDecimals = 5 )
inlinestatic

Converts the given double floating point into a string.

Parameters
[in]numThe given double floating point to convert.
[in]maxDecimalsThe max decimal places to add.
Returns
The resulting string representation.

◆ FromNum() [2/11]

template<typename T = Char_8, typename N = UInt_64>
static Str< T, N > ehs::Str< T, N >::FromNum ( const float num,
const UInt_8 maxDecimals = 5 )
inlinestatic

Converts the given floating point into a string.

Parameters
[in]numThe given floating point to convert.
[in]maxDecimalsThe max decimal places to add.
Returns
The resulting string representation.

◆ FromNum() [3/11]

template<typename T = Char_8, typename N = UInt_64>
static Str< T, N > ehs::Str< T, N >::FromNum ( const long double num,
const UInt_8 maxDecimals = 5 )
inlinestatic

Converts the given long double floating point into a string.

Parameters
[in]numThe given long double floating point to convert.
[in]maxDecimalsThe max decimal places to add.
Returns
The resulting string representation.

◆ FromNum() [4/11]

template<typename T = Char_8, typename N = UInt_64>
static Str< T, N > ehs::Str< T, N >::FromNum ( const SInt_16 num)
inlinestatic

Converts the given number into a string.

Parameters
[in]numThe given number to convert.
Returns
The resulting string representation.

◆ FromNum() [5/11]

template<typename T = Char_8, typename N = UInt_64>
static Str< T, N > ehs::Str< T, N >::FromNum ( const SInt_32 num)
inlinestatic

Converts the given number into a string.

Parameters
[in]numThe given number to convert.
Returns
The resulting string representation.

◆ FromNum() [6/11]

template<typename T = Char_8, typename N = UInt_64>
static Str< T, N > ehs::Str< T, N >::FromNum ( const SInt_64 num)
inlinestatic

Converts the given number into a string.

Parameters
[in]numThe given number to convert.
Returns
The resulting string representation.

◆ FromNum() [7/11]

template<typename T = Char_8, typename N = UInt_64>
static Str< T, N > ehs::Str< T, N >::FromNum ( const SInt_8 num)
inlinestatic

Converts the given number into a string.

Parameters
[in]numThe given number to convert.
Returns
The resulting string representation.

◆ FromNum() [8/11]

template<typename T = Char_8, typename N = UInt_64>
static Str< T, N > ehs::Str< T, N >::FromNum ( const UInt_16 num)
inlinestatic

Converts the given number into a string.

Parameters
[in]numThe given number to convert.
Returns
The resulting string representation.

◆ FromNum() [9/11]

template<typename T = Char_8, typename N = UInt_64>
static Str< T, N > ehs::Str< T, N >::FromNum ( const UInt_32 num)
inlinestatic

Converts the given number into a string.

Parameters
[in]numThe given number to convert.
Returns
The resulting string representation.

◆ FromNum() [10/11]

template<typename T = Char_8, typename N = UInt_64>
static Str< T, N > ehs::Str< T, N >::FromNum ( const UInt_64 num)
inlinestatic

Converts the given number into a string.

Parameters
[in]numThe given number to convert.
Returns
The resulting string representation.

◆ FromNum() [11/11]

template<typename T = Char_8, typename N = UInt_64>
static Str< T, N > ehs::Str< T, N >::FromNum ( const UInt_8 num)
inlinestatic

Converts the given number into a string.

Parameters
[in]numThe given number to convert.
Returns
The resulting string representation.

◆ GetLower()

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > ehs::Str< T, N >::GetLower ( ) const
inline

Converts all upper-case ASCII characters to lower-case.

Returns
The resulting string object.

◆ GetReverse()

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > ehs::Str< T, N >::GetReverse ( )
inline

Reverses the entire string object.

Returns
The resulting string object.

◆ GetUpper()

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > ehs::Str< T, N >::GetUpper ( ) const
inline

Converts all lower-case ASCII characters to upper-case.

Returns
The resulting string object.

◆ Hash_32() [1/2]

template<typename T = Char_8, typename N = UInt_64>
UInt_32 ehs::Str< T, N >::Hash_32 ( ) const
inline

A 32-bit FNV-1a hash algorithm.

Returns
The resulting hash. Zero if string does not contain any characters.

◆ Hash_32() [2/2]

template<typename T = Char_8, typename N = UInt_64>
static UInt_32 ehs::Str< T, N >::Hash_32 ( const Str< T, N > & str)
inlinestatic

A 32-bit FNV-1a hash algorithm.

Parameters
[in]strThe string to hash.
Returns
The resulting hash. Zero if string does not contain any characters.

◆ Hash_64() [1/2]

template<typename T = Char_8, typename N = UInt_64>
UInt_64 ehs::Str< T, N >::Hash_64 ( ) const
inline

A 64-bit FNV-1a hash algorithm.

Returns
The resulting hash. Zero if string does not contain any characters.

◆ Hash_64() [2/2]

template<typename T = Char_8, typename N = UInt_64>
static UInt_64 ehs::Str< T, N >::Hash_64 ( const Str< T, N > & str)
inlinestatic

A 64-bit FNV-1a hash algorithm.

Parameters
[in]strThe string to hash.
Returns
The resulting hash. Zero if string does not contain any characters.

◆ HexToNum() [1/2]

template<typename T = Char_8, typename N = UInt_64>
template<typename I = int>
I ehs::Str< T, N >::HexToNum ( ) const
inline

Converts the current string from hexadecimal into a number.

Template Parameters
IThe data type of the number outputted.
Returns
The resulting number.

◆ HexToNum() [2/2]

template<typename T = Char_8, typename N = UInt_64>
template<typename I = int>
static I ehs::Str< T, N >::HexToNum ( const Str< T, N > & in)
inlinestatic

Converts a string hexadecimal into a number.

Template Parameters
IThe data type of the number outputted.
Parameters
[in]inThe string to convert.
Returns
The resulting number.

◆ Insert() [1/2]

template<typename T = Char_8, typename N = UInt_64>
void ehs::Str< T, N >::Insert ( const N index,
const Str< T, N > & value )
inline

Inserts a string at a specified index.

Parameters
[in]indexThe index to insert the string at.
[in]valueThe string to insert.

◆ Insert() [2/2]

template<typename T = Char_8, typename N = UInt_64>
void ehs::Str< T, N >::Insert ( const N index,
const T value )
inline

Inserts a character at a specified index.

Parameters
[in]indexThe index to insert the character at.
[in]valueThe character to insert.

◆ IsNum()

template<typename T = Char_8, typename N = UInt_64>
bool ehs::Str< T, N >::IsNum ( ) const
inline

Checks if the string represents a number. Must not have any alphabetical characters.

Returns
The result.

◆ Len()

template<typename T = Char_8, typename N = UInt_64>
static N ehs::Str< T, N >::Len ( const T *const str)
inlinestatic

Calculates the length of a C-Style string.

Parameters
[in]strThe C-Style string to calculate.
Returns
The character count.

◆ NumToHex()

template<typename T = Char_8, typename N = UInt_64>
template<typename I = int>
static Str ehs::Str< T, N >::NumToHex ( const I num)
inlinestatic

Converts a number into hexadecimal string representation.

Template Parameters
IThe data type of the number given.
Parameters
[in]numThe number to convert.
Returns
The resulting hexadecimal.

◆ operator T*()

template<typename T = Char_8, typename N = UInt_64>
ehs::Str< T, N >::operator T* ( ) const
inline

Retrieves the raw C-style string from casting a string object.

◆ operator!=() [1/2]

template<typename T = Char_8, typename N = UInt_64>
bool ehs::Str< T, N >::operator!= ( const Str< T, N > & str) const
inline

Compares with a string object. First comparing sizes.

Parameters
[in]strThe string to compare with.
Returns
Whether or not they are equal.

◆ operator!=() [2/2]

template<typename T = Char_8, typename N = UInt_64>
bool ehs::Str< T, N >::operator!= ( const T *const str) const
inline

Compares with a C-style string. First comparing sizes.

Parameters
[in]strThe C-style string to compare with.
Returns
Whether or not they are equal.

◆ operator+() [1/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > ehs::Str< T, N >::operator+ ( const double num) const
inline

Concatenates with the given number.

Parameters
[in]numThe given number to Concatenate.
Returns
The resulting string object.

◆ operator+() [2/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > ehs::Str< T, N >::operator+ ( const float num) const
inline

Concatenates with the given number.

Parameters
[in]numThe given number to Concatenate.
Returns
The resulting string object.

◆ operator+() [3/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > ehs::Str< T, N >::operator+ ( const long double num) const
inline

Concatenates with the given number.

Parameters
[in]numThe given number to Concatenate.
Returns
The resulting string object.

◆ operator+() [4/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > ehs::Str< T, N >::operator+ ( const SInt_16 num) const
inline

Concatenates with the given number.

Parameters
[in]numThe given number to Concatenate.
Returns
The resulting string object.

◆ operator+() [5/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > ehs::Str< T, N >::operator+ ( const SInt_32 num) const
inline

Concatenates with the given number.

Parameters
[in]numThe given number to Concatenate.
Returns
The resulting string object.

◆ operator+() [6/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > ehs::Str< T, N >::operator+ ( const SInt_64 num) const
inline

Concatenates with the given number.

Parameters
[in]numThe given number to Concatenate.
Returns
The resulting string object.

◆ operator+() [7/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > ehs::Str< T, N >::operator+ ( const SInt_8 num) const
inline

Concatenates with the given number.

Parameters
[in]numThe given number to Concatenate.
Returns
The resulting string object.

◆ operator+() [8/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > ehs::Str< T, N >::operator+ ( const Str< T, N > & str) const
inline

Concatenates with the given string object.

Parameters
[in]strThe given string object.
Returns
The resulting string object.

◆ operator+() [9/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > ehs::Str< T, N >::operator+ ( const T *const str) const
inline

Concatenates with the given C-style string.

Parameters
[in]strThe given C-style string.
Returns
The resulting string object.

◆ operator+() [10/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > ehs::Str< T, N >::operator+ ( const UInt_16 num) const
inline

Concatenates with the given number.

Parameters
[in]numThe given number to Concatenate.
Returns
The resulting string object.

◆ operator+() [11/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > ehs::Str< T, N >::operator+ ( const UInt_32 num) const
inline

Concatenates with the given number.

Parameters
[in]numThe given number to Concatenate.
Returns
The resulting string object.

◆ operator+() [12/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > ehs::Str< T, N >::operator+ ( const UInt_64 num) const
inline

Concatenates with the given number.

Parameters
[in]numThe given number to Concatenate.
Returns
The resulting string object.

◆ operator+() [13/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > ehs::Str< T, N >::operator+ ( const UInt_8 num) const
inline

Concatenates with the given number.

Parameters
[in]numThe given number to Concatenate.
Returns
The resulting string object.

◆ operator+=() [1/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > & ehs::Str< T, N >::operator+= ( const double num)
inline

Concatenates with the given number.

Parameters
[in]numThe given number to concatenate.
Returns
The resulting string object.

◆ operator+=() [2/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > & ehs::Str< T, N >::operator+= ( const float num)
inline

Concatenates with the given number.

Parameters
[in]numThe given number to concatenate.
Returns
The resulting string object.

◆ operator+=() [3/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > & ehs::Str< T, N >::operator+= ( const long double num)
inline

Concatenates with the given number.

Parameters
[in]numThe given number to concatenate.
Returns
The resulting string object.

◆ operator+=() [4/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > & ehs::Str< T, N >::operator+= ( const SInt_16 num)
inline

Concatenates with the given number.

Parameters
[in]numThe given number to concatenate.
Returns
The resulting string object.

◆ operator+=() [5/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > & ehs::Str< T, N >::operator+= ( const SInt_32 num)
inline

Concatenates with the given number.

Parameters
[in]numThe given number to concatenate.
Returns
The resulting string object.

◆ operator+=() [6/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > & ehs::Str< T, N >::operator+= ( const SInt_64 num)
inline

Concatenates with the given number.

Parameters
[in]numThe given number to concatenate.
Returns
The resulting string object.

◆ operator+=() [7/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > & ehs::Str< T, N >::operator+= ( const SInt_8 num)
inline

Concatenates with the given number.

Parameters
[in]numThe given number to concatenate.
Returns
The resulting string object.

◆ operator+=() [8/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > & ehs::Str< T, N >::operator+= ( const Str< T, N > & str)
inline

Concatenates with the given string object.

Parameters
[in]strThe given string object.
Returns
The resulting string object.

◆ operator+=() [9/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > & ehs::Str< T, N >::operator+= ( const T *const str)
inline

Concatenates with the given C-style string.

Parameters
[in]strThe given C-style string.
Returns
The resulting string object.

◆ operator+=() [10/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > & ehs::Str< T, N >::operator+= ( const UInt_16 num)
inline

Concatenates with the given number.

Parameters
[in]numThe given number to concatenate.
Returns
The resulting string object.

◆ operator+=() [11/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > & ehs::Str< T, N >::operator+= ( const UInt_32 num)
inline

Concatenates with the given number.

Parameters
[in]numThe given number to concatenate.
Returns
The resulting string object.

◆ operator+=() [12/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > & ehs::Str< T, N >::operator+= ( const UInt_64 num)
inline

Concatenates with the given number.

Parameters
[in]numThe given number to concatenate.
Returns
The resulting string object.

◆ operator+=() [13/13]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > & ehs::Str< T, N >::operator+= ( const UInt_8 num)
inline

Concatenates with the given number.

Parameters
[in]numThe given number to concatenate.
Returns
The resulting string object.

◆ operator=() [1/3]

template<typename T = Char_8, typename N = UInt_64>
Str & ehs::Str< T, N >::operator= ( const Str< T, N > & str)
inline

Copies all members from the given string object.

Parameters
[in]strThe string object to copy from.
Returns
The string that has been assigned to.

◆ operator=() [2/3]

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > & ehs::Str< T, N >::operator= ( const T *const str)
inline

Copies the given C-style string and retrieves the size.

Parameters
[in]strThe C-style string to copy from.
Returns
The string object that has been assigned to.

◆ operator=() [3/3]

template<typename T = Char_8, typename N = UInt_64>
Str & ehs::Str< T, N >::operator= ( Str< T, N > && str)
inlinenoexcept

◆ operator==() [1/3]

template<typename T = Char_8, typename N = UInt_64>
bool ehs::Str< T, N >::operator== ( const Str< T, N > & str) const
inline

Compares with a string object. First comparing sizes.

Parameters
[in]strThe string object to compare with.
Returns
Whether or not they are equal.

◆ operator==() [2/3]

template<typename T = Char_8, typename N = UInt_64>
bool ehs::Str< T, N >::operator== ( const T *const str) const
inline

Compares with a C-style string. First comparing sizes.

Parameters
[in]strThe C-style string to compare with.
Returns
Whether or not they are equal.

◆ operator==() [3/3]

template<typename T = Char_8, typename N = UInt_64>
bool ehs::Str< T, N >::operator== ( T * str) const
inline

Compares with a another string. First comparing sizes.

Parameters
[in]strThe string object to compare with.
Returns
Whether or not they are equal.

◆ ParseArgs()

template<typename T = Char_8, typename N = UInt_64>
Vector< Str > ehs::Str< T, N >::ParseArgs ( ) const
inline

◆ Pop()

template<typename T = Char_8, typename N = UInt_64>
T ehs::Str< T, N >::Pop ( )
inline

Removes the value at the end of the array.

Returns
The value that was popped.

◆ Push() [1/4]

template<typename T = Char_8, typename N = UInt_64>
void ehs::Str< T, N >::Push ( const Str< T, N > & value)
inline

Adds a value at the end of the string.

Parameters
[in]valueThe character to push to the end of the string.

◆ Push() [2/4]

template<typename T = Char_8, typename N = UInt_64>
void ehs::Str< T, N >::Push ( const T *const value)
inline

Adds a value at the end of the string.

Parameters
[in]valueThe C-style string to push to the end of the string.

◆ Push() [3/4]

template<typename T = Char_8, typename N = UInt_64>
void ehs::Str< T, N >::Push ( const T *const value,
const N size )
inline

Adds a value at the end of the string.

Parameters
[in]valueThe C-style string to push to the end of the string.
[in]sizeThe size of the given C-style string.

◆ Push() [4/4]

template<typename T = Char_8, typename N = UInt_64>
void ehs::Str< T, N >::Push ( const T value)
inline

Adds a value at the end of the string.

Parameters
[in]valueThe character to push to the end of the string.

◆ Remove() [1/2]

template<typename T = Char_8, typename N = UInt_64>
T ehs::Str< T, N >::Remove ( const N index)
inline

Removes a character at the given index.

Parameters
[in]indexThe index to remove a character.
Returns
The character removed.

◆ Remove() [2/2]

template<typename T = Char_8, typename N = UInt_64>
Str ehs::Str< T, N >::Remove ( const N start,
const N end )
inline

Removes characters withing the given range.

Parameters
[in]startThe index to start.
[in]endThe index to end.
Returns
The removed string object.

◆ RemoveAll()

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > ehs::Str< T, N >::RemoveAll ( const Str< T, N > & delimeter) const
inline

Removes all instances of the ide.

Parameters
[in]delimeterThe string to look for.
Returns
The resulting string object.

◆ ReplaceAll()

template<typename T = Char_8, typename N = UInt_64>
Str ehs::Str< T, N >::ReplaceAll ( const Str< T, N > & delimeter,
const Str< T, N > & replacer ) const
inline

Replaces all instances of ide with the replacer.

Parameters
[in]delimeterThe string to look for.
[in]replacerThe string placed.
Returns
The resulting string object.

◆ Resize()

template<typename T = Char_8, typename N = UInt_64>
void ehs::Str< T, N >::Resize ( const N newSize)
inline

Resizes the string.

Parameters
[in]newSizeThe size to change to.

◆ Reverse()

template<typename T = Char_8, typename N = UInt_64>
void ehs::Str< T, N >::Reverse ( )
inline

Reverses the entire string object.

◆ Size()

template<typename T = Char_8, typename N = UInt_64>
N ehs::Str< T, N >::Size ( bool inBytes = false) const
inline

Retrieves the size of the string.

Parameters
[in]inBytesTo retrieve the size in bytes.
Returns
The resulting size.

◆ Split()

template<typename T = Char_8, typename N = UInt_64>
Vector< Str< T, N >, N > ehs::Str< T, N >::Split ( const Str< T, N > & delimeter,
const N max = 0 ) const
inline

Splits a string into a Vector with the given separator.

Parameters
[in]delimeterThe given string as the separator.
[in]maxThe max amount of times to split the string.
Returns
The resulting string object.

◆ Sub()

template<typename T = Char_8, typename N = UInt_64>
Str< T, N > ehs::Str< T, N >::Sub ( const N index,
const N size = 0 ) const
inline

Clips the string at the given index and with the given size.

Parameters
[in]indexThe index to clip at.
[in]sizeThe size for the clip starting from the index.
Returns
The resulting string object.

◆ ToBytes() [1/2]

template<typename T = Char_8, typename N = UInt_64>
Byte * ehs::Str< T, N >::ToBytes ( )
inline

Retrieves the string in bytes for serialization.

Returns
The string in bytes.

◆ ToBytes() [2/2]

template<typename T = Char_8, typename N = UInt_64>
const Byte * ehs::Str< T, N >::ToBytes ( ) const
inline

Retrieves the string in bytes for serialization.

Returns
The string in bytes.

◆ ToDecimal()

template<typename T = Char_8, typename N = UInt_64>
template<typename I = N>
I ehs::Str< T, N >::ToDecimal ( ) const
inline

Converts the string into a number.

Template Parameters
IThe resulting number's data type.
Returns
The result.
Note
Use "IsNum" before this if the string object is not guaranteed to be a number.

◆ ToDouble()

template<typename T = Char_8, typename N = UInt_64>
double ehs::Str< T, N >::ToDouble ( ) const
inline

Converts the string into a double floating point number.

Returns
The resulting double.
Note
Use "IsNum" before this if the string object is not guaranteed to be a number.

◆ ToFloat()

template<typename T = Char_8, typename N = UInt_64>
float ehs::Str< T, N >::ToFloat ( ) const
inline

Converts the string into a floating point number.

Returns
The resulting float.
Note
Use "IsNum" before this if the string object is not guaranteed to be a number.

◆ ToLDouble()

template<typename T = Char_8, typename N = UInt_64>
long double ehs::Str< T, N >::ToLDouble ( ) const
inline

Converts the string into a long double floating point number.

Returns
The resulting long double.
Note
Use "IsNum" before this if the string object is not guaranteed to be a number.

◆ ToLower()

template<typename T = Char_8, typename N = UInt_64>
void ehs::Str< T, N >::ToLower ( )
inline

Converts all upper-case ASCII characters to lower-case.

◆ ToUpper()

template<typename T = Char_8, typename N = UInt_64>
void ehs::Str< T, N >::ToUpper ( )
inline

Converts all lower-case ASCII characters to upper-case.


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