Isle
Loading...
Searching...
No Matches
mxstring.h
Go to the documentation of this file.
1#ifndef MXSTRING_H
2#define MXSTRING_H
3
4#include "mxcore.h"
5
6// VTABLE: LEGO1 0x100dc110
7// VTABLE: BETA10 0x101c1be0
8// SIZE 0x10
9
14class MxString : public MxCore {
15public:
20 MxString();
21
26 MxString(const MxString& p_str);
27
32 MxString(const char* p_str);
33
40 MxString(const char* p_str, MxU16 p_maxlen);
41
46 ~MxString() override;
47
51 void Reverse();
52
56 void ToUpperCase();
57
61 void ToLowerCase();
62
68 MxString& operator=(const MxString& p_str);
69
75 const MxString& operator=(const char* p_str);
76
82 MxString operator+(const MxString& p_str) const;
83
89 MxString operator+(const char* p_str) const;
90
96 MxString& operator+=(const char* p_str);
97
104 static void CharSwap(char* p_a, char* p_b);
105
110 char* GetData() const { return m_data; }
111
115 const MxU16 GetLength() const { return m_length; }
116
122 MxBool Equal(const MxString& p_str) const { return strcmp(m_data, p_str.m_data) == 0; }
123
129 MxS8 Compare(const MxString& p_str) const { return strcmp(m_data, p_str.m_data); }
130
131 // SYNTHETIC: LEGO1 0x100ae280
132 // SYNTHETIC: BETA10 0x1012c9d0
133 // MxString::`scalar deleting destructor'
134
135private:
136 char* m_data;
137 MxU16 m_length;
138};
139
140#endif // MXSTRING_H
[AI] Base virtual class for all Mindscape engine (Mx) objects.
Definition: mxcore.h:15
Mindscape custom string class for managing dynamic C-strings within the game engine.
Definition: mxstring.h:14
char * GetData() const
Returns a pointer to the internal character buffer.
Definition: mxstring.h:110
static void CharSwap(char *p_a, char *p_b)
Utility to swap the values of two characters.
Definition: mxstring.cpp:182
void ToLowerCase()
Converts the string contents to lowercase in-place.
Definition: mxstring.cpp:97
MxString()
Default constructor which creates an empty string.
Definition: mxstring.cpp:12
void Reverse()
Reverses the contents of the string in-place.
Definition: mxstring.cpp:76
MxString operator+(const MxString &p_str) const
Concatenation operator for two MxString instances.
Definition: mxstring.cpp:131
MxS8 Compare(const MxString &p_str) const
Performs lexicographical comparison to another string.
Definition: mxstring.h:129
const MxU16 GetLength() const
Returns the length of the string (number of characters, not including null terminator).
Definition: mxstring.h:115
~MxString() override
Destructor.
Definition: mxstring.cpp:70
void ToUpperCase()
Converts the string contents to uppercase in-place.
Definition: mxstring.cpp:90
MxString & operator=(const MxString &p_str)
Assignment operator from another MxString.
Definition: mxstring.cpp:104
MxString & operator+=(const char *p_str)
Append a C-string to this MxString.
Definition: mxstring.cpp:166
MxBool Equal(const MxString &p_str) const
Compares this string to another for equality.
Definition: mxstring.h:122
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
unsigned short MxU16
[AI]
Definition: mxtypes.h:20
signed char MxS8
[AI]
Definition: mxtypes.h:14