diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-02 19:38:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-02 19:38:33 +0200 |
| commit | 87979899ce833ca477bb563b84e3698224119dab (patch) | |
| tree | df67a0724de4c76ce594222747220c233c3bc7f5 /dev/LibCompiler/src/AssemblyFactory.cc | |
| parent | 3afc481dc64a07fe7fcaff9ce7a12a492c3ec8e7 (diff) | |
| parent | fb12b9730d78052f5cafbd84fbc9a830a22cec17 (diff) | |
Merge pull request #4 from nekernel-org/dev
0.0.1
Diffstat (limited to 'dev/LibCompiler/src/AssemblyFactory.cc')
| -rw-r--r-- | dev/LibCompiler/src/AssemblyFactory.cc | 66 |
1 files changed, 29 insertions, 37 deletions
diff --git a/dev/LibCompiler/src/AssemblyFactory.cc b/dev/LibCompiler/src/AssemblyFactory.cc index 46ebed3..8fa12a8 100644 --- a/dev/LibCompiler/src/AssemblyFactory.cc +++ b/dev/LibCompiler/src/AssemblyFactory.cc @@ -1,11 +1,11 @@ /* ------------------------------------------- - Copyright (C) 2024-2025 Amlal EL Mahrous, all rights reserved + Copyright (C) 2024-2025 Amlal EL Mahrous, all rights reserved ------------------------------------------- */ -#include <LibCompiler/AAL/AssemblyInterface.h> -#include <LibCompiler/NFC/ErrorID.h> +#include <LibCompiler/AssemblyInterface.h> +#include <LibCompiler/ErrorID.h> /** * @file AssemblyFactory.cxx @@ -23,37 +23,29 @@ //! @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; - - return fMounted->CompileToFormat(sourceFile, arch); - } - - ///! @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 +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; + + return fMounted->CompileToFormat(sourceFile, arch); +} + +///! @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 |
