diff options
author | Lucas CHOLLET <lucas.chollet@free.fr> | 2022-06-08 15:56:21 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-06-09 22:08:04 +0200 |
commit | dad4716cc26698525c26d73daf9c6167cff7e020 (patch) | |
tree | e5959af21a0e960d7a549420bf0eb0cad8c7560b /AK | |
parent | d288c700c7caedbb2963dddac94a80097fde0798 (diff) | |
download | serenity-dad4716cc26698525c26d73daf9c6167cff7e020.zip |
AK: Add Error::operator==(Error const&)
Diffstat (limited to 'AK')
-rw-r--r-- | AK/Error.h | 5 |
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; } |