From dad4716cc26698525c26d73daf9c6167cff7e020 Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Wed, 8 Jun 2022 15:56:21 +0200 Subject: [PATCH] AK: Add Error::operator==(Error const&) --- AK/Error.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AK/Error.h b/AK/Error.h index 298705ba0f6..b4b17875a4c 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; }