Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

template<typename T, s32>
class Geo::GeoFixedString

This is a simple string class template that always uses a fixed amount of memory for a single string.

If you attempt to set a longer string to it it'll simply crop it. FOR BACKWARDS COMPATABILITY ONLY. Given the lack of utility provided, you are much

...

Typedefs

NameDescription
T CharType

Make the template parameters visible properties, so users can create local objects to match.

Variables

NameDescription
const s32 MaxStringLength = MSL

Make the template parameters visible properties, so users can create local objects to match.

Functions

NameDescription
~GeoFixedString()

Destructor.

Clear()

Clear the string.

CropAfterLastChar(T)

This will remove the string beyond and including the last character specified if there is one.

CropBeforeLastChar(T)

This will remove the string up to and including the last character specified if there is one.

Empty()

Returns true if the string is empty.

FromUtf8(const char *)

Creates a new string of this format from a narrow string.

GeoFixedString()

Default constructor.

GeoFixedString(const T *)

Explicit constructor from a raw C string.

GeoFixedString(const T *, s32)

Constructor with raw string and fixed termination point.

GeoFixedString(const GeoFixedString &)

Copy constructor.

GetCString()

Returns a const raw pointer to the string.

GetLength()

Returns the length of the string.

GetMaxLength()

Returns the maximum length string this object can store.

operator<(const GeoFixedString &)

Comparison (required to use strings as keys in a map).

ToUtf8()

Returns a new narrow string from this one.


Anchor
a29ce4e387039ae8999429efd17045367
a29ce4e387039ae8999429efd17045367

Geo::GeoFixedString< T, MSL >::~GeoFixedString

...

public: ~GeoFixedString()

...

Destructor.


Anchor
aa03d9ca18346e6de1fb5172c265c5787
aa03d9ca18346e6de1fb5172c265c5787

void Geo::GeoFixedString< T, MSL >::Clear

...

public: void Clear()

...

Clear the string.


Anchor
ae4f5b3bb46e68e35838259499836e7c2
ae4f5b3bb46e68e35838259499836e7c2

bool Geo::GeoFixedString< T, MSL >::CropAfterLastChar

...

public: bool CropAfterLastChar
(
    T c
)

...

This will remove the string beyond and including the last character specified if there is one.

If there isn't one it won't do anything.

Returns

True if the string was cropped.


Anchor
a9c6ba2b13d876e6eafa994343f221e04
a9c6ba2b13d876e6eafa994343f221e04

bool Geo::GeoFixedString< T, MSL >::CropBeforeLastChar

...

public: bool CropBeforeLastChar
(
    T c
)

...

This will remove the string up to and including the last character specified if there is one.

If there isn't one it won't do anything.

Returns

True if the string was cropped.


Anchor
a694ac83537cd9a81d1cdc0e853499a3c
a694ac83537cd9a81d1cdc0e853499a3c

bool Geo::GeoFixedString< T, MSL >::Empty

...

public: bool Empty() const

...

Returns true if the string is empty.


Anchor
af783ca8c6e8a60164ad610520e738f9e
af783ca8c6e8a60164ad610520e738f9e

static GeoFixedString Geo::GeoFixedString< T, MSL >::FromUtf8

...

public: GeoFixedString FromUtf8
(
    const char * utf8
)

...

Creates a new string of this format from a narrow string.


Anchor
a574f9b442dc1742426b347fc126d9965
a574f9b442dc1742426b347fc126d9965

Geo::GeoFixedString< T, MSL >::GeoFixedString

...

public: GeoFixedString()

...

Default constructor.


Anchor
a3bcaf88415c28e0705001f04a2e063e6
a3bcaf88415c28e0705001f04a2e063e6

Geo::GeoFixedString< T, MSL >::GeoFixedString

...

public: GeoFixedString
(
    const T * str
)

...

Explicit constructor from a raw C string.


Anchor
a055ea3fa6b4d924f13474e090ddfc54e
a055ea3fa6b4d924f13474e090ddfc54e

Geo::GeoFixedString< T, MSL >::GeoFixedString

...

public: GeoFixedString
(
    const T * str,
    s32 length
)

...

Constructor with raw string and fixed termination point.


Anchor
ac5d26a910dcad65ffaeae37bcd3993a2
ac5d26a910dcad65ffaeae37bcd3993a2

Geo::GeoFixedString< T, MSL >::GeoFixedString

...

public: GeoFixedString
(
    const GeoFixedString & rhs
)

...

Copy constructor.


Anchor
afbe15b5308aaf052f7b029b9b4f042e1
afbe15b5308aaf052f7b029b9b4f042e1

const T* Geo::GeoFixedString< T, MSL >::GetCString

...

public: const T * GetCString() const

...

Returns a const raw pointer to the string.


Anchor
aaf93cc97bb39035fa00d9e93e8a64f6d
aaf93cc97bb39035fa00d9e93e8a64f6d

s32 Geo::GeoFixedString< T, MSL >::GetLength

...

public: s32 GetLength() const

...

Returns the length of the string.


Anchor
af56c66d478645f5634aed249a4384dbc
af56c66d478645f5634aed249a4384dbc

s32 Geo::GeoFixedString< T, MSL >::GetMaxLength

...

public: s32 GetMaxLength() const

...

Returns the maximum length string this object can store.


Anchor
ae06c5afcda7321708b12aa32a306bcfa
ae06c5afcda7321708b12aa32a306bcfa

bool Geo::GeoFixedString< T, MSL >::operator<

...

public: bool operator<
(
    const GeoFixedString & rhs
) const

...

Comparison (required to use strings as keys in a map).


Anchor
a5b3ce838b3461b886ccf26f0159a39d0
a5b3ce838b3461b886ccf26f0159a39d0

GeoFixedString<char, MSL> Geo::GeoFixedString< T, MSL >::ToUtf8

...

public: GeoFixedString< char, MSL > ToUtf8() const

...

Returns a new narrow string from this one.