Many fixes for MString, ZString.

This commit is contained in:
Brad Arant committed 2022-08-23 09:30:56 -07:00
1 parent d0d5172afa
commit 2a349c6ceb
9 files changed
+65 -34

No files matched your search

+11 -11
View File
@@ -105,30 +105,30 @@ namespace coreutils {
int len = strlen(value);
setSize(len + length);
memcpy(data + temp, value, len);
return *this;
return *this;
}
MString& MString::operator<<(const int value) {
std::stringstream temp;
temp << value;
*this << temp.str();
return *this;
return *this;
}
// MString& MString::operator<<(coreutils::ZString &zstring) {
// int temp = length;
// int len = length + zstring.getLength();
// setSize(len);
// memcpy(data + temp, zstring.getData(), zstring.getLength());
// return *this;
// }
// MString& MString::operator<<(coreutils::ZString &zstring) {
// int temp = length;
// int len = length + zstring.getLength();
// setSize(len);
// memcpy(data + temp, zstring.getData(), zstring.getLength());
// return *this;
// }
MString& MString::operator<<(coreutils::ZString zstring) {
int temp = length;
int len = length + zstring.getLength();
setSize(len);
memcpy(data + temp, zstring.getData(), zstring.getLength());
return *this;
return *this;
}
MString& MString::operator<<(std::string value) {
@@ -136,7 +136,7 @@ namespace coreutils {
int len = length + value.length();
setSize(len);
memcpy(data + temp, value.c_str(), value.length());
return *this;
return *this;
}
MString& MString::write(char ch) {