Added JsonString::operator!=

This commit is contained in:
Benoit Blanchon
2020-07-30 09:40:35 +02:00
parent 298864bafe
commit 6841b80466
4 changed files with 73 additions and 1 deletions

View File

@ -38,6 +38,16 @@ class String {
return strcmp(lhs._data, rhs._data) == 0;
}
friend bool operator!=(String lhs, String rhs) {
if (lhs._data == rhs._data)
return false;
if (!lhs._data)
return true;
if (!rhs._data)
return true;
return strcmp(lhs._data, rhs._data) != 0;
}
private:
const char* _data;
bool _isStatic;