Namespace gfΒΆ
-
namespace
gf Typedefs
-
typedef Str<8>
Str8 tiny
-
typedef Str<16>
Str16 small
-
typedef Str<32>
Str32 medium
-
typedef Str<64>
Str64 big
-
typedef Str<128>
Str128 huge
-
template<size_t
LEN>
classStr - #include <str.hpp>
String implementation that keeps the data on the stack to avoid memory fragmentation.
Public Functions
-
Str() Construct an empty string
-
Str(const char *str) Construct string
- Parameters
str: preset text
-
Str(const char chr) Construct string from character
- Parameters
chr: preset character
-
~Str() Desctructor
-
bool
set(const char *str) - Return
if it worked
- Parameters
str: new content string
-
bool
set(const char chr) - Return
if it worked
- Parameters
chr: new content character
-
bool
clear() - Return
if clearing worked
-
const char *
operator*()
-
const char *
c_str() - Return
pointer to character array
-
size_t
size() - Return
designated size of character array
-
size_t
length() - Return
length of content
-
size_t
left() - Return
how many space is left
-
bool
operator!()
-
bool
empty() - Return
true if length() == 0
-
bool
operator==(const char *str)
-
bool
operator!=(const char *str)
-
bool
equals(const char *str) - Return
if same content
- Parameters
str: other string
-
bool
operator==(const char chr)
-
bool
operator!=(const char chr)
-
bool
equals(const char chr) - Return
if same content
- Parameters
chr: some character
-
template<size_t
SLEN>
boolstarts_with(Str<SLEN> str) - Return
if it starts with other string
- Parameters
str: other string
-
bool
starts_with(const char *str) - Return
if it starts with other string
- Parameters
str: other string
-
bool
starts_with(const char chr) - Return
if it starts with some character
- Parameters
chr: some character
-
template<size_t
SLEN>
boolends_with(Str<SLEN> str) - Return
if it ends with other string
- Parameters
str: other string
-
bool
ends_with(const char *str) - Return
if it ends with other string
- Parameters
str: other string
-
bool
ends_with(const char chr) - Return
if it ends with some character
- Parameters
chr: some character
-
bool
append(const char *str) - Return
if it worked
- Parameters
str: other string
-
bool
append(const char chr) - Return
if it worked
- Parameters
chr: some character
-
bool
prepend(const char *str) - Return
if it worked
- Parameters
str: other string
-
bool
prepend(const char chr) - Return
if it worked
- Parameters
chr: some character
-
void
upper()
-
void
lower()
Private Members
-
char
_str[1 +LEN] = {_NIL} internal buffer
-
-
typedef Str<8>