TinyLib 0.1.1
Loading...
Searching...
No Matches
tl::String Class Reference

#include <String.h>

Public Member Functions

 String (const ascii *="")
 Create a new string from ascii array.
 
 String (u32)
 Create a new string from an unsigned number.
 
 String (s32)
 Create a new string from a signed number.
 
 ~String ()
 Clean up internal string data.
 
u16 length () const
 Get length of this string.
 
const asciicStr () const
 Get C-style string.
 
const ascii operator[] (u16 index) const
 
const asciioperator[] (u16 index)
 
 String (const String &other)
 String copy method.
 
Stringoperator= (const String &other)
 String assignment operator.
 
String operator+ (String other)
 Add two strings together.
 
void operator+= (String other)
 Quick way to add another string onto this one.
 
String operator+ (s32 num)
 Add number onto string.
 
void operator+= (s32 num)
 Quick way to add a number onto this string.
 
String operator+ (u32 num)
 Add number onto string.
 
void operator+= (u32 num)
 Quick way to add a number onto this string.
 

Detailed Description

Definition at line 8 of file String.h.

Constructor & Destructor Documentation

◆ String() [1/4]

tl::String::String ( const ascii * newText = "")

Create a new string from ascii array.

Parameters
newTextC-style string.

Definition at line 8 of file String.cpp.

◆ String() [2/4]

tl::String::String ( u32 num)

Create a new string from an unsigned number.

Parameters
numUnsigned number.

Definition at line 16 of file String.cpp.

◆ String() [3/4]

tl::String::String ( s32 num)

Create a new string from a signed number.

Parameters
numSigned number.

Definition at line 24 of file String.cpp.

◆ ~String()

tl::String::~String ( )

Clean up internal string data.

Definition at line 31 of file String.cpp.

◆ String() [4/4]

tl::String::String ( const String & other)

String copy method.

Parameters
otherString to copy.

Definition at line 59 of file String.cpp.

Member Function Documentation

◆ cStr()

const ascii * tl::String::cStr ( ) const

Get C-style string.

Returns
Character array of this string.

Definition at line 51 of file String.cpp.

◆ length()

u16 tl::String::length ( ) const

Get length of this string.

Returns
How many characters string contains.

Definition at line 43 of file String.cpp.

◆ operator+() [1/3]

String tl::String::operator+ ( s32 num)

Add number onto string.

Parameters
numThis number will go after the current string.
Returns
New string with number added.

Definition at line 131 of file String.cpp.

◆ operator+() [2/3]

String tl::String::operator+ ( String other)

Add two strings together.

Parameters
otherThis string will go after the current string.
Returns
Both strings combined into one.

Definition at line 96 of file String.cpp.

◆ operator+() [3/3]

String tl::String::operator+ ( u32 num)

Add number onto string.

Parameters
numThis number will go after the current string.
Returns
New string with number added.

Definition at line 148 of file String.cpp.

◆ operator+=() [1/3]

void tl::String::operator+= ( s32 num)

Quick way to add a number onto this string.

Parameters
numThis number will go after the current string.

Definition at line 139 of file String.cpp.

◆ operator+=() [2/3]

void tl::String::operator+= ( String other)

Quick way to add another string onto this one.

Parameters
otherThis string will go after the current string.

Definition at line 121 of file String.cpp.

◆ operator+=() [3/3]

void tl::String::operator+= ( u32 num)

Quick way to add a number onto this string.

Parameters
numThis number will go after the current string.

Definition at line 156 of file String.cpp.

◆ operator=()

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

String assignment operator.

Parameters
otherString to assign.

Definition at line 74 of file String.cpp.

◆ operator[]() [1/2]

const ascii & tl::String::operator[] ( u16 index)
inline

Definition at line 23 of file String.h.

◆ operator[]() [2/2]

const ascii tl::String::operator[] ( u16 index) const
inline

Definition at line 19 of file String.h.


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