summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
authorLucas CHOLLET <lucas.chollet@free.fr>2022-06-08 15:56:21 +0200
committerAndreas Kling <kling@serenityos.org>2022-06-09 22:08:04 +0200
commitdad4716cc26698525c26d73daf9c6167cff7e020 (patch)
treee5959af21a0e960d7a549420bf0eb0cad8c7560b /AK
parentd288c700c7caedbb2963dddac94a80097fde0798 (diff)
downloadserenity-dad4716cc26698525c26d73daf9c6167cff7e020.zip
AK: Add Error::operator==(Error const&)
Diffstat (limited to 'AK')
-rw-r--r--AK/Error.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/AK/Error.h b/AK/Error.h
index 298705ba0f..b4b17875a4 100644
--- a/AK/Error.h
+++ b/AK/Error.h
@@ -26,6 +26,11 @@ public:
static Error from_syscall(StringView syscall_name, int rc) { return Error(syscall_name, rc); }
static Error from_string_literal(StringView string_literal) { return Error(string_literal); }
+ bool operator==(Error const& other) const
+ {
+ return m_code == other.m_code && m_string_literal == other.m_string_literal && m_syscall == other.m_syscall;
+ }
+
bool is_errno() const { return m_code != 0; }
bool is_syscall() const { return m_syscall; }