summaryrefslogtreecommitdiffhomepage
path: root/dev/LibCompiler/src/AssemblyFactory+AssemblyInterface.cc
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/src/AssemblyFactory+AssemblyInterface.cc
parent8ad58a91a11380203c4a81fe4dc93e7734631b32 (diff)
feat!(LibCompiler): Codebase and diagram has been improved.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/LibCompiler/src/AssemblyFactory+AssemblyInterface.cc')
-rw-r--r--dev/LibCompiler/src/AssemblyFactory+AssemblyInterface.cc55
1 files changed, 0 insertions, 55 deletions
diff --git a/dev/LibCompiler/src/AssemblyFactory+AssemblyInterface.cc b/dev/LibCompiler/src/AssemblyFactory+AssemblyInterface.cc
deleted file mode 100644
index e6072d9..0000000
--- a/dev/LibCompiler/src/AssemblyFactory+AssemblyInterface.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -------------------------------------------
-
- Copyright (C) 2024-2025 Amlal EL Mahrous, all rights reserved
-
-------------------------------------------- */
-
-#include <LibCompiler/AssemblyInterface.h>
-#include <LibCompiler/ErrorID.h>
-
-/**
- * @file AssemblyFactory.cxx
- * @author amlal (amlal@nekernel.org)
- * @brief Assembler Kit
- * @version 0.1
- * @date 2024-01-27
- *
- * @copyright Copyright (c) 2024-2025 Amlal El Mahrouss
- *
- */
-
-//! @file Asm.cpp
-//! @brief AssemblyKit source implementation.
-
-namespace LibCompiler {
-///! @brief Compile for specific format (ELF, PEF, ZBIN)
-Int32 AssemblyFactory::Compile(std::string sourceFile, const Int32& arch) noexcept {
- if (sourceFile.length() < 1 || !fMounted) return LIBCOMPILER_UNIMPLEMENTED;
-
- if (arch != fMounted->Arch()) return LIBCOMPILER_INVALID_ARCH;
-
- try {
- return fMounted->CompileToFormat(sourceFile, arch);
- } catch (std::exception& e) {
- return LIBCOMPILER_EXEC_ERROR;
- }
-}
-
-///! @brief mount assembly backend.
-void AssemblyFactory::Mount(AssemblyInterface* mountPtr) noexcept {
- if (mountPtr) {
- fMounted = mountPtr;
- }
-}
-
-///! @brief Unmount assembler.
-AssemblyInterface* AssemblyFactory::Unmount() noexcept {
- auto mount_prev = fMounted;
-
- if (mount_prev) {
- fMounted = nullptr;
- }
-
- return mount_prev;
-}
-} // namespace LibCompiler