Update to v106r52 release.

byuu says:

I stand corrected, I managed to create and even larger diff than ever.
This one weighs in at 309KiB `>__>`

I'll have to create a changelog later, I'm too tired right now to go
through all of that.
This commit is contained in:
Tim Allen
2018-07-25 22:24:03 +10:00
parent f1a4576ac4
commit 22bd4b9277
171 changed files with 1725 additions and 1403 deletions

View File

@@ -2,20 +2,20 @@
namespace nall {
string_view::string_view() {
view<string>::view() {
_string = nullptr;
_data = "";
_size = 0;
}
string_view::string_view(const string_view& source) {
view<string>::view(const view& source) {
if(this == &source) return;
_string = nullptr;
_data = source._data;
_size = source._size;
}
string_view::string_view(string_view&& source) {
view<string>::view(view&& source) {
if(this == &source) return;
_string = source._string;
_data = source._data;
@@ -23,36 +23,36 @@ string_view::string_view(string_view&& source) {
source._string = nullptr;
}
string_view::string_view(const char* data) {
view<string>::view(const char* data) {
_string = nullptr;
_data = data;
_size = -1; //defer length calculation, as it is often unnecessary
}
string_view::string_view(const char* data, uint size) {
view<string>::view(const char* data, uint size) {
_string = nullptr;
_data = data;
_size = size;
}
string_view::string_view(const string& source) {
view<string>::view(const string& source) {
_string = nullptr;
_data = source.data();
_size = source.size();
}
template<typename... P>
string_view::string_view(P&&... p) {
view<string>::view(P&&... p) {
_string = new string{forward<P>(p)...};
_data = _string->data();
_size = _string->size();
}
string_view::~string_view() {
view<string>::~view() {
if(_string) delete _string;
}
auto string_view::operator=(const string_view& source) -> string_view& {
auto view<string>::operator=(const view& source) -> view& {
if(this == &source) return *this;
_string = nullptr;
_data = source._data;
@@ -60,7 +60,7 @@ auto string_view::operator=(const string_view& source) -> string_view& {
return *this;
};
auto string_view::operator=(string_view&& source) -> string_view& {
auto view<string>::operator=(view&& source) -> view& {
if(this == &source) return *this;
_string = source._string;
_data = source._data;
@@ -69,15 +69,15 @@ auto string_view::operator=(string_view&& source) -> string_view& {
return *this;
};
string_view::operator const char*() const {
view<string>::operator const char*() const {
return _data;
}
auto string_view::data() const -> const char* {
auto view<string>::data() const -> const char* {
return _data;
}
auto string_view::size() const -> uint {
auto view<string>::size() const -> uint {
if(_size < 0) _size = strlen(_data);
return _size;
}