diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-22 10:22:16 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-22 10:22:16 +0200 |
| commit | e0b3869075eb6dd4d2d515f80056e2eeb1128fae (patch) | |
| tree | 5158781eb6c8513d69c703e1847e1dd84094c42f /lib | |
| parent | 7927f01e875ef76185535d209c14230fe9be183d (diff) | |
feat(btb)!: Introducing libBTB, better API.
also:
- The Codebase has been improved.
- Error codes are now string messages.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/IManifestBuilder.h | 31 | ||||
| -rw-r--r-- | lib/Includes.h | 17 | ||||
| -rw-r--r-- | lib/JSONManifestBuilder.h | 31 | ||||
| -rw-r--r-- | lib/Macros.h | 34 |
4 files changed, 0 insertions, 113 deletions
diff --git a/lib/IManifestBuilder.h b/lib/IManifestBuilder.h deleted file mode 100644 index ed3c30f..0000000 --- a/lib/IManifestBuilder.h +++ /dev/null @@ -1,31 +0,0 @@ -// ============================================================= // -// btb -// Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. -// ============================================================= // - -#pragma once - -#include <Includes.h> -#include <Macros.h> - -namespace BTB { -/// @brief Builder interface class. -/// @note This class is meant to be used as an interface. -class IManifestBuilder { - public: - explicit IManifestBuilder() = default; - virtual ~IManifestBuilder() = default; - - IManifestBuilder& operator=(const IManifestBuilder&) = default; - IManifestBuilder(const IManifestBuilder&) = default; - - /// @brief Builds a target using the implemented laguage. - /// @param arg_sz filename size - /// @param arg_val filename path. - /// @retval true succeeded. - /// @retval false failed. - virtual bool buildTarget(int arg_sz, const char* arg_val, const bool dry_run = false) = 0; - - virtual const char* buildSystem() = 0; -}; -} // namespace BTB
\ No newline at end of file diff --git a/lib/Includes.h b/lib/Includes.h deleted file mode 100644 index 3695d53..0000000 --- a/lib/Includes.h +++ /dev/null @@ -1,17 +0,0 @@ -// ============================================================= // -// btb -// Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. -// ============================================================= // - -#ifndef BTB_INCLUDES_H -#define BTB_INCLUDES_H - -#include <cstddef> -#include <cstdio> -#include <fstream> -#include <iostream> -#include <sstream> -#include <string> -#include <thread> - -#endif // BTB_INCLUDES_H diff --git a/lib/JSONManifestBuilder.h b/lib/JSONManifestBuilder.h deleted file mode 100644 index 93c86e9..0000000 --- a/lib/JSONManifestBuilder.h +++ /dev/null @@ -1,31 +0,0 @@ -// ============================================================= // -// btb -// Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. -// ============================================================= // - -#pragma once - -#include <IManifestBuilder.h> -#include <json.h> - -namespace BTB { -/// @brief JSON builder -class JSONManifestBuilder final : public IManifestBuilder { - public: - explicit JSONManifestBuilder() = default; - virtual ~JSONManifestBuilder() override = default; - - JSONManifestBuilder& operator=(const JSONManifestBuilder&) = default; - JSONManifestBuilder(const JSONManifestBuilder&) = default; - - public: - /// @brief Builds a JSON target. - /// @param arg_sz filename size - /// @param arg_val filename path. - /// @retval true build succeeded. - /// @retval false failed to build. - virtual bool buildTarget(int arg_sz, const char* arg_val, const bool dry_run = false) override; - - virtual const char* buildSystem() override; -}; -} // namespace BTB
\ No newline at end of file diff --git a/lib/Macros.h b/lib/Macros.h deleted file mode 100644 index 9d51a2f..0000000 --- a/lib/Macros.h +++ /dev/null @@ -1,34 +0,0 @@ -// ============================================================= // -// btb -// Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. -// ============================================================= // - -#pragma once - -extern "C" { -#include <assert.h> -} - -#include <rang.h> - -#define LIKELY(ARG) (ARG) ? assert(false) : ((void) 0) -#define UNLIKELY(ARG) LIKELY(!(ARG)) - -#define LIBBTB_VERSION "1.1.0" - -#define LIBBTB_VERSION_BCD 0x0110 - -#define LIBBTB_VERSION_MAJOR 1 -#define LIBBTB_VERSION_MINOR 1 -#define LIBBTB_VERSION_PATCH 0 - -#define LIBBTB_UNUSED(X) ((void) X) - -namespace BTB::Logger { -/// @brief replacement for std::cout for BTB logging. -inline std::ostream& info() noexcept { - auto& out = std::cout; - out << rang::fg::red << "btb: " << rang::style::reset; - return out; -} -} // namespace BTB::Logger |
