isle-portable/LEGO1/mxstring.h
MS 2d9af630ba
lego1: Two more operators for MxString (#53)
Followed the hint from @madebr in #31 that the next function in MxString was operator+. The one after that is operator+= and both are at 100%.

Squashed commits:
* Removed unnecessary consts
* Replaced malloc/free with new/delete, which solved swapped regs in operator=
* Use delete[] when freeing char* m_data
2023-06-27 19:57:30 -07:00

29 lines
596 B
C++

#ifndef MXSTRING_H
#define MXSTRING_H
#include "mxcore.h"
class MxString : public MxCore
{
public:
__declspec(dllexport) MxString(const MxString &);
__declspec(dllexport) virtual ~MxString();
__declspec(dllexport) const MxString &operator=(const char *);
MxString();
MxString(const char *);
void ToUpperCase();
void ToLowerCase();
MxString& operator=(MxString *);
MxString operator+(const char *);
MxString& operator+=(const char *);
inline const char *GetData() const { return m_data; }
private:
char *m_data;
unsigned short m_length;
};
#endif // MXSTRING_H