merge
This commit is contained in:
commit
badfc4c709
12 files changed
+166
-45
No files matched your search
+14
-20
@@ -29,6 +29,13 @@ namespace coreutils
|
||||
cursor = this->data;
|
||||
}
|
||||
|
||||
MString::MString(unsigned char *data, size_t length)
|
||||
{
|
||||
setSize(length);
|
||||
memcpy(this->data, data, length);
|
||||
cursor = this->data;
|
||||
}
|
||||
|
||||
MString::MString(const char *data, size_t length)
|
||||
{
|
||||
setSize(length);
|
||||
@@ -65,34 +72,21 @@ namespace coreutils
|
||||
cursor = this->data;
|
||||
}
|
||||
|
||||
MString::MString(std::FILE *file)
|
||||
{
|
||||
setSize(1000000);
|
||||
this->length = fread(this->data, 1000000, 1000000, file);
|
||||
cursor = this->data;
|
||||
}
|
||||
|
||||
MString::~MString()
|
||||
{
|
||||
if (data)
|
||||
free(data);
|
||||
}
|
||||
|
||||
// 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());
|
||||
// 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());
|
||||
// return *this;
|
||||
// }
|
||||
|
||||
MString &MString::operator=(coreutils::ZString &value)
|
||||
{
|
||||
// if(*this == value)
|
||||
// return *this;
|
||||
setSize(value.getLength());
|
||||
memcpy(data, value.getData(), value.getLength());
|
||||
length = value.getLength();
|
||||
|
||||
Reference in new issue
Block a user