Added support for MString in File

This commit is contained in:
Brad Arant committed 2022-11-19 10:18:09 -08:00
1 parent 2a349c6ceb
commit 88d51cb598
4 files changed
+36 -10

No files matched your search

+7 -7
View File
@@ -56,7 +56,7 @@ namespace coreutils {
MString::~MString() {
if(data)
free(data);
free(data);
}
// MString& MString::operator=(coreutils::ZString& value) {
@@ -77,12 +77,12 @@ namespace coreutils {
// return *this;
// }
MString& MString::operator=(coreutils::ZString value) {
if(*this == value)
return *this;
int len = length;
setSize(length + value.getLength());
memcpy(data + len, value.getData(), value.getLength());
MString& MString::operator=(coreutils::ZString &value) {
// if(*this == value)
// return *this;
setSize(value.getLength());
memcpy(data, value.getData(), value.getLength());
length = value.getLength();
return *this;
}