summaryrefslogtreecommitdiffhomepage
path: root/dev/LibCompiler/ErrorOr.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-23 03:48:06 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-05-23 03:48:06 +0200
commit2eed4954c762bb8050e40798c3d9f1d3998324d1 (patch)
tree8848d4345fca4d62c23d1e7136eeff2978c9e6c5 /dev/LibCompiler/ErrorOr.h
parent8ad58a91a11380203c4a81fe4dc93e7734631b32 (diff)
feat!(LibCompiler): Codebase and diagram has been improved.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/LibCompiler/ErrorOr.h')
-rw-r--r--dev/LibCompiler/ErrorOr.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/dev/LibCompiler/ErrorOr.h b/dev/LibCompiler/ErrorOr.h
index ca93dd2..77015b1 100644
--- a/dev/LibCompiler/ErrorOr.h
+++ b/dev/LibCompiler/ErrorOr.h
@@ -10,6 +10,7 @@
#pragma once
#include <LibCompiler/Defines.h>
+#include <LibCompiler/ErrorID.h>
#include <LibCompiler/Ref.h>
namespace LibCompiler {
@@ -33,6 +34,10 @@ class ErrorOr final {
Ref<T> Leak() { return mRef; }
+ Int32 Error() { return mId; }
+
+ BOOL HasError() { return mId != LIBCOMPILER_SUCCESS; }
+
operator bool() { return mRef; }
private: