mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-08-17 01:10:28 +03:00
AK: Add Error::operator==(Error const&)
This commit is contained in:
parent
d288c700c7
commit
dad4716cc2
Notes:
sideshowbarker
2024-07-17 10:21:51 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/dad4716cc2 Pull-request: https://github.com/SerenityOS/serenity/pull/14222 Reviewed-by: https://github.com/petelliott ✅
@ -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; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user