1 /* 2 SPDX-FileCopyrightText: 2021 Michail Vourlakos <mvourlakos@gmail.com> 3 SPDX-License-Identifier: GPL-2.0-or-later 4 */ 5 6 #include "errordata.h" 7 8 namespace Latte { 9 namespace Data { 10 Error()11Error::Error() 12 : Generic() 13 { 14 } 15 Error(Error && o)16Error::Error(Error &&o) 17 : Generic(o), 18 information(o.information) 19 { 20 } 21 Error(const Error & o)22Error::Error(const Error &o) 23 : Generic(o), 24 information(o.information) 25 { 26 } 27 operator =(const Error & rhs)28Error &Error::operator=(const Error &rhs) 29 { 30 id = rhs.id; 31 name = rhs.name; 32 information = rhs.information; 33 34 return (*this); 35 } 36 operator =(Error && rhs)37Error &Error::operator=(Error &&rhs) 38 { 39 id = rhs.id; 40 name = rhs.name; 41 information = rhs.information; 42 43 return (*this); 44 } 45 operator ==(const Error & rhs) const46bool Error::operator==(const Error &rhs) const 47 { 48 return (id == rhs.id) 49 && (name == rhs.name) 50 && (information == rhs.information); 51 } 52 operator !=(const Error & rhs) const53bool Error::operator!=(const Error &rhs) const 54 { 55 return !(*this == rhs); 56 } 57 isValid() const58bool Error::isValid() const 59 { 60 return !id.isEmpty(); 61 } 62 63 } 64 } 65