Browse Source

Add initial C++20 module migration poc

Patrick-Christopher Mattulat 2 weeks ago
parent
commit
82f1954a35

+ 1 - 0
.gitignore

@@ -1,3 +1,4 @@
 .idea
 cmake-build-*
 test/TestHelper.hpp
+ai-assistent.txt

+ 109 - 9
CMakeLists.txt

@@ -99,6 +99,15 @@ if (${LS_STD_BUILD_WITH_SUPPORTED_COMPILER})
     endif ()
 endif ()
 
+##########################################################
+# Apple - LLVM Clang Scenario
+##########################################################
+
+if (APPLE AND ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
+    set(MACOS_SDK "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk")
+    set(SDK_LIBCXX_FLAGS -nostdinc++ -isystem;${MACOS_SDK}/usr/include/c++/v1 -isysroot;${MACOS_SDK})
+endif ()
+
 ######################################################
 # Find Packages
 ######################################################
@@ -143,6 +152,16 @@ message("${PROJECT_NAME}: Adding additional cmake dependencies...")
 
 if (${LS_STD_BUILD_WITH_TESTS})
     add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/test/lib/${GOOGLE_TEST_MODULE})
+
+    target_compile_options(gtest PRIVATE -Wno-error -Wno-character-conversion)
+    target_compile_options(gmock PRIVATE -Wno-error -Wno-character-conversion)
+
+    if (APPLE AND ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
+        message("${PROJECT_NAME}: Set Google Test Apple SDK with LLVM Clang...")
+
+        target_compile_options(gtest PRIVATE ${SDK_LIBCXX_FLAGS})
+        target_compile_options(gmock PRIVATE ${SDK_LIBCXX_FLAGS})
+    endif ()
 endif ()
 
 ####################################################################################################################
@@ -420,6 +439,24 @@ build_event_module(LS_STD_BUILD_STATIC LS_STD_BUILD_SHARED MODULE_NAME_EVENT MOD
 build_io_module(LS_STD_BUILD_STATIC LS_STD_BUILD_SHARED MODULE_NAME_IO MODULE_NAME_CORE SOURCE_FILES_IO)
 build_time_module(LS_STD_BUILD_STATIC LS_STD_BUILD_SHARED LS_STD_BUILD_WITH_JNI MODULE_NAME_TIME MODULE_NAME_CORE SOURCE_FILES_TIME SOURCE_FILES_LINUX_TIME SOURCE_FILES_WINDOWS_TIME SOURCE_FILES_TIME_JNI)
 
+if (APPLE AND ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
+    message("${PROJECT_NAME}: choose Apple LLVM-Clang setup...")
+
+    target_compile_options("${MODULE_NAME_BOXING}" PRIVATE ${SDK_LIBCXX_FLAGS})
+    target_compile_options("${MODULE_NAME_CORE}" PRIVATE ${SDK_LIBCXX_FLAGS})
+    target_compile_options("${MODULE_NAME_ENCODING}" PRIVATE ${SDK_LIBCXX_FLAGS})
+    target_compile_options("${MODULE_NAME_EVENT}" PRIVATE ${SDK_LIBCXX_FLAGS})
+    target_compile_options("${MODULE_NAME_IO}" PRIVATE ${SDK_LIBCXX_FLAGS})
+    target_compile_options("${MODULE_NAME_TIME}" PRIVATE ${SDK_LIBCXX_FLAGS})
+
+    target_compile_options("${MODULE_NAME_BOXING}" PRIVATE ${MACOS_SDK})
+    target_compile_options("${MODULE_NAME_CORE}" PRIVATE ${MACOS_SDK})
+    target_compile_options("${MODULE_NAME_ENCODING}" PRIVATE ${MACOS_SDK})
+    target_compile_options("${MODULE_NAME_EVENT}" PRIVATE ${MACOS_SDK})
+    target_compile_options("${MODULE_NAME_IO}" PRIVATE ${MACOS_SDK})
+    target_compile_options("${MODULE_NAME_TIME}" PRIVATE ${MACOS_SDK})
+endif ()
+
 # CLI base64
 
 add_executable(${CLI_NAME_BASE64}
@@ -439,7 +476,14 @@ add_executable(${CLI_NAME_BASE64}
 
 if (${LS_STD_BUILD_WITH_TESTS})
     message("${MODULE_NAME_BOXING}: Linking libraries for unit test application...")
-    target_link_libraries(${MODULE_NAME_BOXING}-unit-test
+    set(BOXING_UNIT_TEST_NAME "${MODULE_NAME_BOXING}-unit-test")
+
+    if (APPLE AND ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
+        target_compile_options("${BOXING_UNIT_TEST_NAME}" PRIVATE ${SDK_LIBCXX_FLAGS})
+    endif ()
+
+    target_link_libraries(${BOXING_UNIT_TEST_NAME}
+            PRIVATE
             gtest
             gtest_main
             "${MODULE_NAME_BOXING}"
@@ -452,7 +496,14 @@ endif ()
 
 if (${LS_STD_BUILD_WITH_TESTS})
     message("${MODULE_NAME_CORE}: Linking libraries for unit test application...")
-    target_link_libraries(${MODULE_NAME_CORE}-unit-test
+    set(CORE_UNIT_TEST_NAME "${MODULE_NAME_CORE}-unit-test")
+
+    if (APPLE AND ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
+        target_compile_options("${CORE_UNIT_TEST_NAME}" PRIVATE ${SDK_LIBCXX_FLAGS})
+    endif ()
+
+    target_link_libraries(${CORE_UNIT_TEST_NAME}
+            PRIVATE
             gtest
             gmock
             gtest_main
@@ -465,7 +516,14 @@ endif ()
 
 if (${LS_STD_BUILD_WITH_TESTS})
     message("${MODULE_NAME_ENCODING}: Linking libraries for unit test application...")
-    target_link_libraries(${MODULE_NAME_ENCODING}-unit-test
+    set(ENCODING_UNIT_TEST_NAME "${MODULE_NAME_ENCODING}-unit-test")
+
+    if (APPLE AND ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
+        target_compile_options("${ENCODING_UNIT_TEST_NAME}" PRIVATE ${SDK_LIBCXX_FLAGS})
+    endif ()
+
+    target_link_libraries(${ENCODING_UNIT_TEST_NAME}
+            PRIVATE
             gtest
             gtest_main
             "${MODULE_NAME_ENCODING}"
@@ -478,7 +536,14 @@ endif ()
 
 if (${LS_STD_BUILD_WITH_TESTS})
     message("${MODULE_NAME_EVENT}: Linking libraries for unit test application...")
-    target_link_libraries(${MODULE_NAME_EVENT}-unit-test
+    set(EVENT_UNIT_TEST_NAME "${MODULE_NAME_EVENT}-unit-test")
+
+    if (APPLE AND ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
+        target_compile_options("${EVENT_UNIT_TEST_NAME}" PRIVATE ${SDK_LIBCXX_FLAGS})
+    endif ()
+
+    target_link_libraries(${EVENT_UNIT_TEST_NAME}
+            PRIVATE
             gtest
             gtest_main
             "${MODULE_NAME_EVENT}"
@@ -491,7 +556,14 @@ endif ()
 
 if (${LS_STD_BUILD_WITH_TESTS})
     message("${MODULE_NAME_IO}: Linking libraries for unit test application...")
-    target_link_libraries(${MODULE_NAME_IO}-unit-test
+    set(IO_UNIT_TEST_NAME "${MODULE_NAME_IO}-unit-test")
+
+    if (APPLE AND ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
+        target_compile_options("${IO_UNIT_TEST_NAME}" PRIVATE ${SDK_LIBCXX_FLAGS})
+    endif ()
+
+    target_link_libraries(${IO_UNIT_TEST_NAME}
+            PRIVATE
             gtest
             gmock
             gtest_main
@@ -505,7 +577,14 @@ endif ()
 
 if (${LS_STD_BUILD_WITH_TESTS})
     message("${MODULE_NAME_TIME}: Linking libraries for unit test application...")
-    target_link_libraries(${MODULE_NAME_TIME}-unit-test
+    set(TIME_UNIT_TEST_NAME "${MODULE_NAME_TIME}-unit-test")
+
+    if (APPLE AND ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
+        target_compile_options("${TIME_UNIT_TEST_NAME}" PRIVATE ${SDK_LIBCXX_FLAGS})
+    endif ()
+
+    target_link_libraries(${TIME_UNIT_TEST_NAME}
+            PRIVATE
             gtest
             gmock
             gtest_main
@@ -519,7 +598,14 @@ endif ()
 
 if (${LS_STD_BUILD_WITH_TESTS})
     message("${PROJECT_NAME}: Linking libraries for unit test application...")
-    target_link_libraries(${PROJECT_NAME}-unit-test
+    set(ALL_UNIT_TEST_NAME "${PROJECT_NAME}-unit-test")
+
+    if (APPLE AND ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
+        target_compile_options("${ALL_UNIT_TEST_NAME}" PRIVATE ${SDK_LIBCXX_FLAGS})
+    endif ()
+
+    target_link_libraries(${ALL_UNIT_TEST_NAME}
+            PRIVATE
             gtest
             gmock
             gtest_main
@@ -545,7 +631,14 @@ endif ()
 
 if (${LS_STD_BUILD_WITH_TESTS})
     message("${MODULE_NAME_IO}: Linking libraries for integration test application...")
-    target_link_libraries(${MODULE_NAME_IO}-integration-test
+    set(IO_INTEGRATION_TEST_NAME "${MODULE_NAME_IO}-integration-test")
+
+    if (APPLE AND ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
+        target_compile_options("${IO_INTEGRATION_TEST_NAME}" PRIVATE ${SDK_LIBCXX_FLAGS})
+    endif ()
+
+    target_link_libraries(${IO_INTEGRATION_TEST_NAME}
+            PRIVATE
             gtest
             gtest_main
             "${MODULE_NAME_IO}"
@@ -562,7 +655,14 @@ endif ()
 
 if (${LS_STD_BUILD_WITH_TESTS})
     message("${PROJECT_NAME}: Linking libraries for whole test application...")
-    target_link_libraries(${PROJECT_NAME}-test
+    set(WHOLE_TEST_NAME "${PROJECT_NAME}-test")
+
+    if (APPLE AND ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
+        target_compile_options("${WHOLE_TEST_NAME}" PRIVATE ${SDK_LIBCXX_FLAGS})
+    endif ()
+
+    target_link_libraries(${WHOLE_TEST_NAME}
+            PRIVATE
             gtest
             gmock
             gtest_main

+ 34 - 0
cmake/Build.cmake

@@ -5,6 +5,11 @@ function(build_boxing_module build_static_flag build_shared_flag module_name mod
         add_library("${${module_name}}" STATIC ${${source_files}})
         enable_strict_warnings(module_name)
         set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
+
+        target_compile_features("${${module_name}}" PUBLIC cxx_std_20)
+
+        target_sources("${${module_name}}" PUBLIC FILE_SET boxing_modules TYPE CXX_MODULES FILES
+                ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/boxing/Boolean.cppm)
     endif ()
 
     if (${build_shared_flag})
@@ -12,6 +17,11 @@ function(build_boxing_module build_static_flag build_shared_flag module_name mod
         enable_strict_warnings(module_name)
         target_link_libraries("${${module_name}}" ${${module_name_core}})
         set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
+
+        target_compile_features("${${module_name}}" PUBLIC cxx_std_20)
+
+        target_sources("${${module_name}}" PUBLIC FILE_SET boxing_modules TYPE CXX_MODULES FILES
+                ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/boxing/Boolean.cppm)
     endif ()
 endfunction()
 
@@ -22,6 +32,8 @@ function(build_core_module build_static_flag build_shared_flag build_jni_flag mo
         add_library("${${module_name}}" STATIC ${${source_files}})
         enable_strict_warnings(module_name)
         set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
+
+        target_compile_features("${${module_name}}" PUBLIC cxx_std_20)
     endif ()
 
     if (${build_shared_flag})
@@ -30,10 +42,14 @@ function(build_core_module build_static_flag build_shared_flag build_jni_flag mo
             add_library("${${module_name}}" SHARED ${${source_files}} ${${jni_source_files}})
             enable_strict_warnings(module_name)
             set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
+
+            target_compile_features("${${module_name}}" PUBLIC cxx_std_20)
         else ()
             add_library("${${module_name}}" SHARED ${${source_files}})
             enable_strict_warnings(module_name)
             set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
+
+            target_compile_features("${${module_name}}" PUBLIC cxx_std_20)
         endif ()
     endif ()
 endfunction()
@@ -45,6 +61,8 @@ function(build_encoding_module build_static_flag build_shared_flag module_name m
         add_library("${${module_name}}" STATIC ${${source_files}})
         enable_strict_warnings(module_name)
         set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
+
+        target_compile_features("${${module_name}}" PUBLIC cxx_std_20)
     endif ()
 
     if (${build_shared_flag})
@@ -52,6 +70,8 @@ function(build_encoding_module build_static_flag build_shared_flag module_name m
         enable_strict_warnings(module_name)
         target_link_libraries("${${module_name}}" ${${module_name_core}})
         set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
+
+        target_compile_features("${${module_name}}" PUBLIC cxx_std_20)
     endif ()
 endfunction()
 
@@ -62,6 +82,8 @@ function(build_event_module build_static_flag build_shared_flag module_name modu
         add_library("${${module_name}}" STATIC ${${source_files}})
         enable_strict_warnings(module_name)
         set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
+
+        target_compile_features("${${module_name}}" PUBLIC cxx_std_20)
     endif ()
 
     if (${build_shared_flag})
@@ -69,6 +91,8 @@ function(build_event_module build_static_flag build_shared_flag module_name modu
         enable_strict_warnings(module_name)
         target_link_libraries("${${module_name}}" ${${module_name_core}})
         set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
+
+        target_compile_features("${${module_name}}" PUBLIC cxx_std_20)
     endif ()
 endfunction()
 
@@ -79,6 +103,8 @@ function(build_io_module build_static_flag build_shared_flag module_name module_
         add_library("${${module_name}}" STATIC ${${source_files}})
         enable_strict_warnings(module_name)
         set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
+
+        target_compile_features("${${module_name}}" PUBLIC cxx_std_20)
     endif ()
 
     if (${build_shared_flag})
@@ -86,6 +112,8 @@ function(build_io_module build_static_flag build_shared_flag module_name module_
         enable_strict_warnings(module_name)
         target_link_libraries("${${module_name}}" ${${module_name_core}})
         set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
+
+        target_compile_features("${${module_name}}" PUBLIC cxx_std_20)
     endif ()
 endfunction()
 
@@ -96,6 +124,8 @@ function(build_time_module build_static_flag build_shared_flag build_jni_flag mo
         add_library("${${module_name}}" STATIC ${${source_files}} ${${source_files_linux}} ${${source_files_windows}})
         enable_strict_warnings(module_name)
         set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
+
+        target_compile_features("${${module_name}}" PUBLIC cxx_std_20)
     endif ()
 
     if (${build_shared_flag})
@@ -105,11 +135,15 @@ function(build_time_module build_static_flag build_shared_flag build_jni_flag mo
             enable_strict_warnings(module_name)
             target_link_libraries("${${module_name}}" ${${module_name_core}})
             set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
+
+            target_compile_features("${${module_name}}" PUBLIC cxx_std_20)
         else ()
             add_library("${${module_name}}" SHARED ${${source_files}} ${${source_files_linux}} ${${source_files_windows}})
             enable_strict_warnings(module_name)
             target_link_libraries("${${module_name}}" ${${module_name_core}})
             set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
+
+            target_compile_features("${${module_name}}" PUBLIC cxx_std_20)
         endif ()
     endif ()
 endfunction()

+ 0 - 1
cmake/SourceFiles.cmake

@@ -1,6 +1,5 @@
 function(collect_boxing_module_source_files placeholder)
     set(SOURCE_FILES_BOXING
-            ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/boxing/Boolean.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/boxing/Double.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/boxing/Float.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/boxing/Integer.cpp

+ 0 - 87
include/ls-std/boxing/Boolean.hpp

@@ -1,87 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-09
- * Changed:         2024-09-09
- *
- * */
-
-#ifndef LS_STD_BOOLEAN_HPP
-#define LS_STD_BOOLEAN_HPP
-
-#include <ls-std/core/Class.hpp>
-#include <ls-std/core/interface/IBoxing.hpp>
-#include <ls-std/os/dynamic-goal.hpp>
-#include <memory>
-#include <sstream>
-
-/*
- * @doc: class(name: 'Boolean', package: 'boxing')
- * @doc: boxing.Boolean.description('This class represents the primitive datatype bool and provides functionalities for boolean expressions and string representation.')
- * */
-
-namespace ls::std::boxing
-{
-  class LS_STD_DYNAMIC_GOAL Boolean : public ls::std::core::Class, public ls::std::core::interface_type::IBoxing
-  {
-    public:
-
-      explicit Boolean(bool _value);
-      Boolean();
-      ~Boolean() noexcept override;
-
-      // assignment operators
-
-      ls::std::boxing::Boolean &operator=(int _value);
-      ls::std::boxing::Boolean &operator=(bool _value);
-
-      // stream operators
-
-      friend ::std::ostream &operator<<(::std::ostream &_outputStream, const ls::std::boxing::Boolean &_boolean)
-      {
-        _outputStream << _boolean._toString();
-        return _outputStream;
-      }
-
-      // logical operators
-
-      friend bool operator!(const ls::std::boxing::Boolean &_boolean)
-      {
-        return !_boolean.value;
-      }
-
-      bool operator&&(const ls::std::boxing::Boolean &_boolean) const;
-      bool operator&&(bool _value) const;
-      bool operator&&(int _value) const;
-      bool operator||(const ls::std::boxing::Boolean &_boolean) const;
-      bool operator||(bool _value) const;
-      bool operator||(int _value) const;
-      // INFO: operator ^ can not be taken for XOR, since it's not possible to implement it respecting commutative law
-
-      // implementation
-
-      void parse(const ::std::string &_parseText) override;
-      [[nodiscard]] ::std::string toString() override;
-
-      // additional functionality
-
-      [[nodiscard]] bool getValue() const;
-      [[nodiscard]] static bool XOR(const ls::std::boxing::Boolean &_leftExpression, const ls::std::boxing::Boolean &_rightExpression);
-      [[nodiscard]] static bool XOR(const ls::std::boxing::Boolean &_leftExpression, bool _rightExpression);
-      [[nodiscard]] static bool XOR(bool _leftExpression, const ls::std::boxing::Boolean &_rightExpression);
-      [[nodiscard]] static bool XOR(bool _leftExpression, bool _rightExpression);
-
-    private:
-
-      bool value{};
-
-      const ::std::string FALSE_STRING = "false";
-      const ::std::string TRUE_STRING = "true";
-
-      [[nodiscard]] static ::std::string _fetchClassName();
-      [[nodiscard]] ::std::string _toString() const;
-  };
-}
-
-#endif

+ 1 - 3
include/ls-std/core/type/Types.hpp

@@ -3,14 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-07
- * Changed:         2023-05-16
+ * Changed:         2025-12-24
  *
  * */
 
 #ifndef LS_STD_TYPES_HPP
 #define LS_STD_TYPES_HPP
 
-#include <ls-std/lib/nlohmann_json/include/nlohmann/json.hpp>
 #include <string>
 
 namespace ls::std::core::type
@@ -19,7 +18,6 @@ namespace ls::std::core::type
   using byte_field = ::std::string;
   using long_type = long long int;
   using version_type = int;
-  using json = nlohmann::json;
 }
 
 #endif

+ 1 - 2
include/ls-std/ls-std-boxing.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2022-05-13
- * Changed:         2024-09-09
+ * Changed:         2025-12-24
  *
  * */
 
@@ -15,7 +15,6 @@
  * @doc: boxing.description('This package provides functionalities for wrapping primitive datatypes (boolean, double, float, int, long, string). Wrapping those types would enable a developer to provide string representations, or parsing from strings to convert them back into their primitive forms. Additionally, these boxing types come with a great selection of operators and convenient functions.')
  * */
 
-#include <ls-std/boxing/Boolean.hpp>
 #include <ls-std/boxing/Double.hpp>
 #include <ls-std/boxing/Float.hpp>
 #include <ls-std/boxing/Integer.hpp>

+ 0 - 143
source/ls-std/boxing/Boolean.cpp

@@ -1,143 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-09
- * Changed:         2025-12-21
- *
- * */
-
-#include <algorithm>
-#include <ls-std/boxing/Boolean.hpp>
-#include <ls-std/core/exception/IllegalArgumentException.hpp>
-
-using ls::std::boxing::Boolean;
-using ls::std::core::Class;
-using ls::std::core::IllegalArgumentException;
-using std::string;
-using std::transform;
-
-Boolean::Boolean(const bool _value) : Class(_fetchClassName()), value(_value)
-{}
-
-Boolean::Boolean() : Class(_fetchClassName())
-{}
-
-Boolean::~Boolean() noexcept = default;
-
-Boolean &Boolean::operator=(const int _value)
-{
-  this->value = _value;
-  return *this;
-}
-
-Boolean &Boolean::operator=(const bool _value)
-{
-  this->value = _value;
-  return *this;
-}
-
-bool Boolean::operator&&(const Boolean &_boolean) const
-{
-  return this->value && _boolean.getValue();
-}
-
-bool Boolean::operator&&(const bool _value) const
-{
-  return this->value && _value;
-}
-
-bool Boolean::operator&&(const int _value) const
-{
-  return this->value && _value;
-}
-
-bool Boolean::operator||(const Boolean &_boolean) const
-{
-  return this->value || _boolean.getValue();
-}
-
-bool Boolean::operator||(const bool _value) const
-{
-  return this->value || _value;
-}
-
-bool Boolean::operator||(const int _value) const
-{
-  return this->value || _value;
-}
-
-void Boolean::parse(const string &_parseText)
-{
-  string parseText = _parseText;
-  transform(parseText.begin(), parseText.end(), parseText.begin(), ::tolower);
-
-  if (parseText != this->TRUE_STRING && parseText != this->FALSE_STRING)
-  {
-    throw IllegalArgumentException{parseText + " is not a valid string representation"};
-  }
-  else
-  {
-    if (parseText == this->TRUE_STRING)
-    {
-      this->value = true;
-    }
-
-    if (parseText == this->FALSE_STRING)
-    {
-      this->value = false;
-    }
-  }
-}
-
-string Boolean::toString()
-{
-  return this->_toString();
-}
-
-bool Boolean::getValue() const
-{
-  return this->value;
-}
-
-bool Boolean::XOR(const Boolean &_leftExpression, const Boolean &_rightExpression)
-{
-  return (_leftExpression && !_rightExpression) || (!_leftExpression && _rightExpression.getValue());
-}
-
-bool Boolean::XOR(const Boolean &_leftExpression, const bool _rightExpression)
-{
-  return (_leftExpression && !_rightExpression) || (!_leftExpression && _rightExpression);
-}
-
-bool Boolean::XOR(const bool _leftExpression, const Boolean &_rightExpression)
-{
-  return (_leftExpression && !_rightExpression) || (!_leftExpression && _rightExpression.getValue());
-}
-
-bool Boolean::XOR(const bool _leftExpression, const bool _rightExpression)
-{
-  return (_leftExpression && !_rightExpression) || (!_leftExpression && _rightExpression);
-}
-
-string Boolean::_fetchClassName()
-{
-  static const string className = "Boolean";
-  return className;
-}
-
-string Boolean::_toString() const
-{
-  string booleanString{};
-
-  if (this->value)
-  {
-    booleanString = this->TRUE_STRING;
-  }
-  else
-  {
-    booleanString = this->FALSE_STRING;
-  }
-
-  return booleanString;
-}

+ 164 - 0
source/ls-std/boxing/Boolean.cppm

@@ -0,0 +1,164 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-08-09
+ * Changed:         2025-12-24
+ *
+ * */
+
+module;
+
+#include <algorithm>
+#include <ls-std/core/Class.hpp>
+#include <ls-std/core/interface/IBoxing.hpp>
+#include <ls-std/core/exception/IllegalArgumentException.hpp>
+#include <string>
+
+export module ls.std.boxing.boolean;
+
+using ls::std::core::Class;
+using ls::std::core::IllegalArgumentException;
+using ls::std::core::interface_type::IBoxing;
+using std::string;
+using std::transform;
+
+export namespace ls::std::boxing
+{
+  class Boolean : public Class, public IBoxing
+  {
+    public:
+
+      explicit Boolean(const bool _value) : Class(_fetchClassName()), value(_value)
+      {}
+
+      Boolean() : Class(_fetchClassName())
+      {}
+
+      ~Boolean() noexcept override = default;
+
+      Boolean &operator=(const int _value)
+      {
+        this->value = _value;
+        return *this;
+      }
+
+      Boolean &operator=(const bool _value)
+      {
+        this->value = _value;
+        return *this;
+      }
+
+      bool operator&&(const Boolean &_boolean) const
+      {
+        return this->value && _boolean.getValue();
+      }
+
+      bool operator&&(const bool _value) const
+      {
+        return this->value && _value;
+      }
+
+      bool operator&&(const int _value) const
+      {
+        return this->value && _value;
+      }
+
+      bool operator||(const Boolean &_boolean) const
+      {
+        return this->value || _boolean.getValue();
+      }
+
+      bool operator||(const bool _value) const
+      {
+        return this->value || _value;
+      }
+
+      bool operator||(const int _value) const
+      {
+        return this->value || _value;
+      }
+
+      void parse(const string &_parseText) override
+      {
+        string parseText = _parseText;
+        transform(parseText.begin(), parseText.end(), parseText.begin(), ::tolower);
+
+        if (parseText != this->TRUE_STRING && parseText != this->FALSE_STRING)
+        {
+          throw IllegalArgumentException{parseText + " is not a valid string representation"};
+        }
+        else
+        {
+          if (parseText == this->TRUE_STRING)
+          {
+            this->value = true;
+          }
+
+          if (parseText == this->FALSE_STRING)
+          {
+            this->value = false;
+          }
+        }
+      }
+
+      [[nodiscard]] string toString() override
+      {
+        return this->_toString();
+      }
+
+      [[nodiscard]] bool getValue() const
+      {
+        return this->value;
+      }
+
+      [[nodiscard]] static bool XOR(const Boolean &_leftExpression, const Boolean &_rightExpression)
+      {
+        return (_leftExpression.getValue() && !_rightExpression.getValue()) || (!_leftExpression.getValue() && _rightExpression.getValue());
+      }
+
+      [[nodiscard]] static bool XOR(const Boolean &_leftExpression, const bool _rightExpression)
+      {
+        return (_leftExpression.getValue() && !_rightExpression) || (!_leftExpression.getValue() && _rightExpression);
+      }
+
+      [[nodiscard]] static bool XOR(const bool _leftExpression, const Boolean &_rightExpression)
+      {
+        return (_leftExpression && !_rightExpression.getValue()) || (!_leftExpression && _rightExpression.getValue());
+      }
+
+      [[nodiscard]] static bool XOR(const bool _leftExpression, const bool _rightExpression)
+      {
+        return (_leftExpression && !_rightExpression) || (!_leftExpression && _rightExpression);
+      }
+
+    private:
+
+      bool value{};
+
+      const string FALSE_STRING = "false";
+      const string TRUE_STRING = "true";
+
+      [[nodiscard]] static string _fetchClassName()
+      {
+        static const string className = "Boolean";
+        return className;
+      }
+
+      [[nodiscard]] string _toString() const
+      {
+        string booleanString{};
+
+        if (this->value)
+        {
+          booleanString = this->TRUE_STRING;
+        }
+        else
+        {
+          booleanString = this->FALSE_STRING;
+        }
+
+        return booleanString;
+      }
+  };
+}

+ 9 - 8
test/cases/boxing/BooleanTest.cpp

@@ -3,12 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-09
- * Changed:         2025-12-21
+ * Changed:         2025-12-24
  *
  * */
 
+import ls.std.boxing.boolean;
+
 #include <gtest/gtest.h>
-#include <ls-std/ls-std-boxing.hpp>
 #include <ls-std/ls-std-core.hpp>
 
 using ls::std::boxing::Boolean;
@@ -50,7 +51,7 @@ namespace
   {
     Boolean expression{true};
     ostringstream _stream{};
-    _stream << expression;
+    _stream << expression.toString();
 
     ASSERT_STREQ("true", _stream.str().c_str());
   }
@@ -60,13 +61,13 @@ namespace
   TEST_F(BooleanTest, operator_negation_negative_value)
   {
     const Boolean expression{};
-    ASSERT_TRUE(!expression);
+    ASSERT_TRUE(!expression.getValue());
   }
 
   TEST_F(BooleanTest, operator_negation_positive_value)
   {
     const Boolean expression{true};
-    ASSERT_FALSE(!expression);
+    ASSERT_FALSE(!expression.getValue());
   }
 
   TEST_F(BooleanTest, operator_and)
@@ -133,13 +134,13 @@ namespace
     Boolean expression{};
 
     expression.parse("false");
-    ASSERT_FALSE(expression);
+    ASSERT_FALSE(expression.getValue());
 
     expression.parse("fAlSe");
-    ASSERT_FALSE(expression);
+    ASSERT_FALSE(expression.getValue());
 
     expression.parse("FALSE");
-    ASSERT_FALSE(expression);
+    ASSERT_FALSE(expression.getValue());
   }
 
   TEST_F(BooleanTest, parse_with_invalid_parameter)

+ 3 - 3
test/cases/serialization/JsonTest.cpp

@@ -3,14 +3,14 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2023-03-25
+ * Changed:         2025-12-24
  *
  * */
 
 #include <gtest/gtest.h>
-#include <ls-std/ls-std-core.hpp>
+#include <ls-std/lib/nlohmann_json/include/nlohmann/json.hpp>
 
-using ls::std::core::type::json;
+using nlohmann::json;
 using testing::Test;
 
 namespace