瀏覽代碼

Merge branch 'dev' of public/ls-standard-library into master

Merge origin/dev into origin/master
Lynar Studios - Public Repositories 3 年之前
父節點
當前提交
b717c3e7d5
共有 100 個文件被更改,包括 2110 次插入2052 次删除
  1. 45 61
      CMakeLists.txt
  2. 71 58
      README.md
  3. 5 0
      config/LynarStudiosStyle.xml
  4. 9 5
      include/ls_std/base/Class.hpp
  5. 23 0
      include/ls_std/base/LibraryVersion.hpp
  6. 3 2
      include/ls_std/base/Types.hpp
  7. 11 9
      include/ls_std/base/Version.hpp
  8. 17 23
      include/ls_std/boxing/Boolean.hpp
  9. 28 34
      include/ls_std/boxing/Double.hpp
  10. 28 34
      include/ls_std/boxing/Float.hpp
  11. 5 3
      include/ls_std/boxing/IBoxing.hpp
  12. 30 35
      include/ls_std/boxing/Integer.hpp
  13. 30 35
      include/ls_std/boxing/Long.hpp
  14. 21 28
      include/ls_std/boxing/String.hpp
  15. 13 18
      include/ls_std/event/Event.hpp
  16. 9 5
      include/ls_std/event/EventHandler.hpp
  17. 13 10
      include/ls_std/event/EventManager.hpp
  18. 4 3
      include/ls_std/event/EventTypes.hpp
  19. 7 5
      include/ls_std/event/IEventSubscriber.hpp
  20. 30 0
      include/ls_std/exception/EventNotHandledException.hpp
  21. 30 0
      include/ls_std/exception/EventNotSubscribedException.hpp
  22. 7 4
      include/ls_std/exception/FileNotFoundException.hpp
  23. 7 4
      include/ls_std/exception/FileOperationException.hpp
  24. 7 4
      include/ls_std/exception/IllegalArgumentException.hpp
  25. 8 5
      include/ls_std/exception/IllegalArithmeticOperationException.hpp
  26. 30 0
      include/ls_std/exception/IncompleteJsonException.hpp
  27. 7 4
      include/ls_std/exception/NullPointerException.hpp
  28. 29 0
      include/ls_std/factory/IFactory.hpp
  29. 44 31
      include/ls_std/io/File.hpp
  30. 10 8
      include/ls_std/io/FileOutputStream.hpp
  31. 13 8
      include/ls_std/io/FilePathSeparator.hpp
  32. 7 4
      include/ls_std/io/FilePathSeparatorMatch.hpp
  33. 7 5
      include/ls_std/io/FileReader.hpp
  34. 9 7
      include/ls_std/io/FileWriter.hpp
  35. 5 3
      include/ls_std/io/IReader.hpp
  36. 6 4
      include/ls_std/io/IStorable.hpp
  37. 6 4
      include/ls_std/io/IWriter.hpp
  38. 14 9
      include/ls_std/io/NewLine.hpp
  39. 6 4
      include/ls_std/io/StandardOutputWriter.hpp
  40. 10 8
      include/ls_std/io/StorableFile.hpp
  41. 0 39
      include/ls_std/io/kv/KVDocument.hpp
  42. 0 44
      include/ls_std/io/kv/KVParser.hpp
  43. 0 46
      include/ls_std/io/kv/KVReader.hpp
  44. 41 0
      include/ls_std/io/kv/KvDocument.hpp
  45. 48 0
      include/ls_std/io/kv/KvFileReader.hpp
  46. 12 10
      include/ls_std/io/kv/KvPair.hpp
  47. 7 5
      include/ls_std/io/kv/KvParseParameter.hpp
  48. 46 0
      include/ls_std/io/kv/KvParser.hpp
  49. 5 4
      include/ls_std/io/kv/KvTypes.hpp
  50. 19 9
      include/ls_std/io/logging/LogLevel.hpp
  51. 6 10
      include/ls_std/io/logging/LogLevelValue.hpp
  52. 17 14
      include/ls_std/io/logging/Logger.hpp
  53. 0 36
      include/ls_std/io/xml/XMLAttribute.hpp
  54. 0 41
      include/ls_std/io/xml/XMLDeclaration.hpp
  55. 0 38
      include/ls_std/io/xml/XMLDocument.hpp
  56. 0 75
      include/ls_std/io/xml/XMLNode.hpp
  57. 0 71
      include/ls_std/io/xml/XMLParser.hpp
  58. 0 48
      include/ls_std/io/xml/XMLReader.hpp
  59. 41 0
      include/ls_std/io/xml/XmlAttribute.hpp
  60. 43 0
      include/ls_std/io/xml/XmlDeclaration.hpp
  61. 43 0
      include/ls_std/io/xml/XmlDocument.hpp
  62. 82 0
      include/ls_std/io/xml/XmlNode.hpp
  63. 6 8
      include/ls_std/io/xml/XmlParseMode.hpp
  64. 8 6
      include/ls_std/io/xml/XmlParseParameter.hpp
  65. 73 0
      include/ls_std/io/xml/XmlParser.hpp
  66. 50 0
      include/ls_std/io/xml/XmlReader.hpp
  67. 8 6
      include/ls_std/logic/IListener.hpp
  68. 9 7
      include/ls_std/logic/Narrator.hpp
  69. 17 11
      include/ls_std/logic/State.hpp
  70. 14 9
      include/ls_std/logic/StateConnection.hpp
  71. 19 15
      include/ls_std/logic/StateMachine.hpp
  72. 3 2
      include/ls_std/logic/StateMachineTypes.hpp
  73. 26 23
      include/ls_std/ls_std.hpp
  74. 6 4
      include/ls_std/serialization/ISerializable.hpp
  75. 0 46
      include/ls_std/serialization/boxing/SerializableJSONBoolean.hpp
  76. 0 46
      include/ls_std/serialization/boxing/SerializableJSONDouble.hpp
  77. 0 46
      include/ls_std/serialization/boxing/SerializableJSONFloat.hpp
  78. 0 45
      include/ls_std/serialization/boxing/SerializableJSONInteger.hpp
  79. 0 45
      include/ls_std/serialization/boxing/SerializableJSONLong.hpp
  80. 0 45
      include/ls_std/serialization/boxing/SerializableJSONString.hpp
  81. 12 10
      include/ls_std/serialization/json/event/SerializableJsonEvent.hpp
  82. 12 10
      include/ls_std/serialization/json/logic/SerializableJsonState.hpp
  83. 12 10
      include/ls_std/serialization/json/logic/SerializableJsonStateConnection.hpp
  84. 12 10
      include/ls_std/serialization/json/logic/SerializableJsonStateMachine.hpp
  85. 15 9
      include/ls_std/time/Date.hpp
  86. 5 3
      include/ls_std/utils/RegexUtils.hpp
  87. 18 11
      include/ls_std/utils/STLUtils.hpp
  88. 9 13
      include/ls_std/utils/WindowsUtils.hpp
  89. 16 4
      source/ls_std/base/Class.cpp
  90. 19 13
      source/ls_std/base/Version.cpp
  91. 32 63
      source/ls_std/boxing/Boolean.cpp
  92. 96 89
      source/ls_std/boxing/Double.cpp
  93. 90 88
      source/ls_std/boxing/Float.cpp
  94. 26 71
      source/ls_std/boxing/Integer.cpp
  95. 27 70
      source/ls_std/boxing/Long.cpp
  96. 69 81
      source/ls_std/boxing/String.cpp
  97. 15 34
      source/ls_std/event/Event.cpp
  98. 16 4
      source/ls_std/event/EventHandler.cpp
  99. 62 13
      source/ls_std/event/EventManager.cpp
  100. 234 108
      source/ls_std/io/File.cpp

+ 45 - 61
CMakeLists.txt

@@ -3,7 +3,7 @@
 ##########################################################
 
 cmake_minimum_required(VERSION 3.17)
-project(ls_std VERSION 2021.1.0)
+project(ls_std VERSION 2021.2.0)
 
 ##########################################################
 # Options
@@ -32,6 +32,7 @@ message("${PROJECT_NAME}: Adding include directories...")
 if (${LS_STD_BUILD_WITH_TESTS})
     include_directories(${CMAKE_CURRENT_SOURCE_DIR}/test)
     include_directories(${CMAKE_CURRENT_LIST_DIR}/test/lib/googletest-1.8.1/googletest/include)
+    include_directories(${CMAKE_CURRENT_LIST_DIR}/test/lib/googletest-1.8.1/googlemock/include)
 endif ()
 
 include_directories(${CMAKE_CURRENT_LIST_DIR}/include)
@@ -66,37 +67,29 @@ set(SOURCE_FILES
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/FileOutputStream.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/logging/Logger.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/logging/LogLevel.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/boxing/SerializableJSONInteger.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/boxing/SerializableJSONLong.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/boxing/SerializableJSONString.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/boxing/SerializableJSONFloat.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/boxing/SerializableJSONDouble.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/boxing/SerializableJSONBoolean.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/logic/StateMachine.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/logic/State.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/logic/StateConnection.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/logic/SerializableJSONStateConnection.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/logic/SerializableJSONState.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/logic/SerializableJSONStateMachine.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XMLAttribute.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XMLNode.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/logic/SerializableJsonStateConnection.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/logic/SerializableJsonState.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/logic/SerializableJsonStateMachine.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XmlAttribute.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XmlNode.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/base/Version.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XMLDeclaration.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XMLDocument.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XMLReader.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XMLParserMock.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XmlDeclaration.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XmlDocument.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XmlReader.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/StandardOutputWriter.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/logic/Narrator.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/logic/IListener.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XMLParser.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XmlParser.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/event/Event.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/event/EventHandler.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/event/EventManager.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/event/SerializableJSONEvent.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/kv/KVPair.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/kv/KVDocument.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/kv/KVParser.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/kv/KVReader.cpp)
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/serialization/json/event/SerializableJsonEvent.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/kv/KvPair.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/kv/KvDocument.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/kv/KvParser.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/kv/KvFileReader.cpp)
 
 if (${LS_STD_BUILD_WITH_TESTS})
     set(TEST_FILES
@@ -117,32 +110,26 @@ if (${LS_STD_BUILD_WITH_TESTS})
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/StorableFileTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileOutputStreamTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/logging/LoggerTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/JSONTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/boxing/SerializableJSONIntegerTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/boxing/SerializableJSONLongTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/boxing/SerializableJSONStringTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/boxing/SerializableJSONFloatTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/boxing/SerializableJSONDoubleTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/boxing/SerializableJSONBooleanTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/JsonTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/logic/StateTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/logic/StateMachineTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/logic/StateConnectionTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/logic/SerializableJSONStateConnectionTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/logic/SerializableJSONStateTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/logic/SerializableJSONStateMachineTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/logic/SerializableJsonStateConnectionTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/logic/SerializableJsonStateTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/logic/SerializableJsonStateMachineTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/TestDataFactory.hpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/TestDataFactory.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XMLAttributeTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XMLNodeTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlAttributeTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlNodeTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/base/VersionTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XMLDeclarationTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XMLDocumentTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XMLReaderTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XMLParserMockTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlDeclarationTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlDocumentTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlReaderTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlParserTestWrapperTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/observer/TestDataCar.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/observer/TestDataMercedesCar.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/logic/NarratorTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XMLParserTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlParserTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/event/EventTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/NewsAgency.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/DailyNewsAgency.cpp
@@ -151,11 +138,23 @@ if (${LS_STD_BUILD_WITH_TESTS})
             ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/GossipNewsAgency.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/event/EventHandlerTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/event/EventManagerTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/event/SerializableJSONEventTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/kv/KVPairTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/kv/KVDocumentTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/kv/KVParserTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/kv/KVReaderTest.cpp)
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/json/event/SerializableJsonEventTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/kv/KvPairTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/kv/KvDocumentTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/kv/KvParserTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/kv/KvFileReaderTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/exception/EventNotHandledExceptionTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/exception/EventNotSubscribedExceptionTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/exception/FileNotFoundExceptionTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/exception/FileOperationExceptionTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/exception/IllegalArgumentExceptionTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/exception/IllegalArithmeticOperationExceptionTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/exception/IncompleteJsonExceptionTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/exception/NullPointerExceptionTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/io/xml/XmlParserTestWrapper.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/base/LibraryVersionTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/logging/LogLevelTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/StandardOutputWriterTest.cpp)
 endif ()
 
 ##########################################################
@@ -194,20 +193,5 @@ endif ()
 
 if (${LS_STD_BUILD_WITH_TESTS})
     message("${PROJECT_NAME}: Linking libraries for test application...")
-
-    if (WIN32)
-        SET(CMAKE_FIND_LIBRARY_PREFIXES "")
-        SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
-
-        find_library(WSOCK32_LIBRARY wsock32)
-        find_library(WS2_32_LIBRARY ws2_32)
-        message("${PROJECT_NAME}: library search - ${WSOCK32_LIBRARY}...")
-        message("${PROJECT_NAME}: library search - ${WS2_32_LIBRARY}...")
-
-        target_link_libraries(${PROJECT_NAME}_test gtest gtest_main "${WSOCK32_LIBRARY}" "${WS2_32_LIBRARY}" "${PROJECT_NAME}_${PROJECT_VERSION}_static")
-    endif ()
-
-    if (UNIX)
-        target_link_libraries(${PROJECT_NAME}_test gtest gtest_main "${PROJECT_NAME}_${PROJECT_VERSION}_static")
-    endif ()
+    target_link_libraries(${PROJECT_NAME}_test gtest gmock gtest_main "${PROJECT_NAME}_${PROJECT_VERSION}_static")
 endif ()

+ 71 - 58
README.md

@@ -1,63 +1,77 @@
-# Lynar Studios - Standard Library 2021.1.0 #
+# Lynar Studios - Standard Library 2021.2.0 #
 
-This is a cross-platform standard library written in C++ which provides basic functionality and implementation, like:
+This is a cross-platform standard library written in C++ offering functionalities you'd usually miss in C++ standard library, especially if you'd search for cross-platform implementations. This library has been tested on __Windows__, __Linux__ and __MacOS__ systems.
  
-- Boxing  
-  - Double
-  - Float
-  - String
-  - Integer 
-  - Long
-  - Boolean  
-- File
-  - IReader (interface)
-  - IWriter (interface)  
-  - IStorable (interface)  
-  - Model
-  - Reader
-  - Writer
-- Minimal Reflection  
-  - Class (base)
-- Time
-  - Date
-- Logic
-  - State Machine (Model, State, Connection)
-  - IListener (Interface)
-  - Narrator  
-- Serialization
-  - ISerializable (Interface)
-  - JSON Boxing (Double, Float, String, Integer, Long, Boolean)
-  - JSON State Machine (Model, State, Connection)  
-  - JSON Event
-- JSON
-  - Marshalling
-  - Unmarshalling
-- XML
-  - Model (Document, Declaration, Node, Attribute)
-  - Reader
-  - Writer
-  - Parser  
-- Logger
-  - Model
-  - Log Level
-- Event Handling
-  - IEventSubscriber (Interface)
-  - Model
-  - Event Handler
-  - Event Manager
-- Exception
-- KV
-  - Document
-  - KV Pair
-  - Parser
-  - Reader  
-
-It has been tested on __Windows__, __Linux__ and __MacOS__ systems.
+#### Boxing ####
+
+This library provides boxing classes for primitive data types (e.g. string, int, long, float...) to add additional functionalities for each one of them.
+ 
+#### File ####
+
+To handle file operations - or to receive information of a file - this library provides an own __File__ class implementation, which can also be passed to library implemented input or output stream classes.
+
+#### Base ####
+
+This is a collection of very basic functionalities like a base __Class__ which provides minimal reflection like class name. Also, you have the possibility with this collection to fetch this libraries version or even handle own versions for your project.
+
+#### Time ####
+
+A __Date__ class comes with this collection, which you can use to represent a date and doing operations on it. 
+
+#### Logic ####
+
+This collection of classes provides some nice functionalities to support your project with some nice logical features, like state machines and observer pattern supporting classes.
+
+#### Serialization ####
+
+Serialization is very important nowadays to persist data. This library offers a serializable interface, which can then be implemented in your project.  
+In addition to that there is already JSON serialization-based implementation for some public library classes.
+
+#### JSON ####
+
+This library uses a transitive JSON dependency, which is in line with our license model. Many thanks to __Niels Lohmann__ for writing this nice little library.
+
+#### XML ####
+
+To handle XML files this library has an own XML parser implementation, which uses modern C++ features, such as shared pointers.
+
+#### Logger ####
+
+For logging functionality you might need for your project there is a __Logger__ class coming with this library, which is also able to handle different log level.
+
+#### Event Handling ####
+
+With this first implemented milestone of event handling this library provides functionalities for creating and firing events.
+
+#### Exception ####
+
+This library provides some basic exceptions which can be used in your project to create awareness of certain error behaviour.
+
+#### KV ####
+
+A key value file offers the possibility to store simple information pairs in a file. This library provides parsing functionalities for __.kv__ files.
 
 ### Changelog ###
 
-- Made Event class serializable
-- Added Key Value File Functionality
+#### Features ####
+
+- extended EventManager class by adding EventHandler availability check method
+- added exceptions for event management
+- extended Date class by introducing __+=__ and __-=__ operators
+- it's now possible to retrieve library version
+- added more operators to __LogLevel__ class
+- added factory interface
+
+#### Improvements ####
+
+- increased test coverage by adding more unit tests
+- improved overall error handling by adding more error checks
+- reduced overall unnecessary complexity of public classes 
+- improved naming of certain classes
+
+#### Fixes ####
+
+- add missing header files to main header file
 
 ### Documentation ###
 
@@ -104,6 +118,5 @@ target_link_libraries(... "path/to/this/library/../libls_std_YYYY.MAJOR.MINOR.dl
 
 ### Testing ###
 
-This project contains unit tests to accomplish test coverage.  
-To run those unit tests you have to adjust __TestHelper__ class by adding your personal test folder path to __getTestFolderLocation__ method.  
-There you have to adjust __location__ variable based on the operating system you're using.
+This project contains unit tests to provide test coverage.  
+To run those tests you have to build this project with option __LS_STD_BUILD_WITH_TESTS__ set to __ON__.

+ 5 - 0
config/LynarStudiosStyle.xml

@@ -11,6 +11,8 @@
     <option name="INDENT_C_STRUCT_MEMBERS" value="2" />
     <option name="INDENT_VISIBILITY_KEYWORDS" value="2" />
     <option name="INDENT_INSIDE_CODE_BLOCK" value="2" />
+    <option name="INDENT_PREPROCESSOR_DIRECTIVE" value="2" />
+    <option name="INDENT_DIRECTIVE_AS_CODE" value="true" />
     <option name="NAMESPACE_BRACE_PLACEMENT" value="2" />
     <option name="FUNCTION_BRACE_PLACEMENT" value="2" />
     <option name="BLOCK_BRACE_PLACEMENT" value="2" />
@@ -31,8 +33,11 @@
   <codeStyleSettings language="ObjectiveC">
     <option name="RIGHT_MARGIN" value="700" />
     <option name="KEEP_LINE_BREAKS" value="false" />
+    <option name="BLANK_LINES_AROUND_METHOD_IN_INTERFACE" value="0" />
     <option name="BRACE_STYLE" value="2" />
     <option name="CLASS_BRACE_STYLE" value="2" />
+    <option name="ELSE_ON_NEW_LINE" value="true" />
+    <option name="CATCH_ON_NEW_LINE" value="true" />
     <indentOptions>
       <option name="INDENT_SIZE" value="2" />
       <option name="CONTINUATION_INDENT_SIZE" value="4" />

+ 9 - 5
include/ls_std/base/Class.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-07
- * Changed:         2020-11-14
+ * Changed:         2021-04-24
  *
  * */
 
@@ -12,18 +12,22 @@
 
 #include <string>
 
-namespace ls_std {
-  class Class {
+namespace ls_std
+{
+  class Class
+  {
     public:
 
-      explicit Class(std::string _name);
+      explicit Class(const std::string &_name);
       virtual ~Class() = default;
 
       std::string getClassName();
 
     private:
 
-      std::string name {};
+      std::string name{};
+
+      void _assignClassName(const std::string &_name);
   };
 }
 

+ 23 - 0
include/ls_std/base/LibraryVersion.hpp

@@ -0,0 +1,23 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2021-05-02
+ * Changed:         2021-09-24
+ *
+ * */
+
+#ifndef LS_STD_LIBRARY_VERSION_HPP
+#define LS_STD_LIBRARY_VERSION_HPP
+
+#include <string>
+
+namespace ls_std
+{
+  static std::string getVersion()
+  {
+    return "2021.2.0";
+  }
+}
+
+#endif

+ 3 - 2
include/ls_std/base/Types.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-07
- * Changed:         2020-11-06
+ * Changed:         2021-04-23
  *
  * */
 
@@ -12,7 +12,8 @@
 
 #include <string>
 
-namespace ls_std {
+namespace ls_std
+{
   using byte = char;
   using byte_field = std::string;
   using long_type = long long int;

+ 11 - 9
include/ls_std/base/Version.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-27
- * Changed:         2020-11-26
+ * Changed:         2021-04-24
  *
  * */
 
@@ -14,8 +14,10 @@
 #include <ls_std/serialization/ISerializable.hpp>
 #include "Types.hpp"
 
-namespace ls_std {
-  class Version : public ISerializable {
+namespace ls_std
+{
+  class Version : public ls_std::ISerializable
+  {
     public:
 
       explicit Version(ls_std::version_type _majorVersion, ls_std::version_type _minorVersion, ls_std::version_type _patchVersion);
@@ -24,25 +26,25 @@ namespace ls_std {
       // implementation
 
       ls_std::byte_field marshal() override;
-      void unmarshal(const ls_std::byte_field& _data) override;
+      void unmarshal(const ls_std::byte_field &_data) override;
 
       // other functionality
 
       ls_std::version_type getMajorVersion() const;
       ls_std::version_type getMinorVersion() const;
       ls_std::version_type getPatchVersion() const;
-      static bool isValid(const std::string& _versionString);
+      static bool isValid(const std::string &_versionString);
       void setMajorVersion(ls_std::version_type _major);
       void setMinorVersion(ls_std::version_type _minor);
       void setPatchVersion(ls_std::version_type _patch);
 
     private:
 
-      ls_std::version_type majorVersion {};
-      ls_std::version_type minorVersion {};
-      ls_std::version_type patchVersion {};
+      ls_std::version_type majorVersion{};
+      ls_std::version_type minorVersion{};
+      ls_std::version_type patchVersion{};
 
-      static bool _isValid(const std::string& _versionString);
+      static bool _isValid(const std::string &_versionString);
   };
 }
 

+ 17 - 23
include/ls_std/boxing/Boolean.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-09
- * Changed:         2020-11-26
+ * Changed:         2021-07-08
  *
  * */
 
@@ -13,11 +13,11 @@
 #include <memory>
 #include <ls_std/base/Class.hpp>
 #include "IBoxing.hpp"
-#include <ls_std/serialization/ISerializable.hpp>
-#include <ls_std/io/IStorable.hpp>
 
-namespace ls_std {
-  class Boolean : public Class, public IBoxing, public ISerializable, public IStorable {
+namespace ls_std
+{
+  class Boolean : public ls_std::Class, public ls_std::IBoxing
+  {
     public:
 
       explicit Boolean(bool _value);
@@ -30,54 +30,48 @@ namespace ls_std {
 
       // assignment operators
 
-      ls_std::Boolean& operator=(int _value);
-      ls_std::Boolean& operator=(bool _value);
+      ls_std::Boolean &operator=(int _value);
+      ls_std::Boolean &operator=(bool _value);
 
       // stream operators
 
-      friend std::ostream& operator<<(std::ostream& _outputStream, const ls_std::Boolean& _boolean) {
+      friend std::ostream &operator<<(std::ostream &_outputStream, const ls_std::Boolean &_boolean)
+      {
         _outputStream << _boolean._toString();
         return _outputStream;
       }
 
       // logical operators
 
-      friend bool operator!(const ls_std::Boolean& _boolean) {
+      friend bool operator!(const ls_std::Boolean &_boolean)
+      {
         return !_boolean.value;
       }
 
-      bool operator&&(const ls_std::Boolean& _boolean) const;
+      bool operator&&(const ls_std::Boolean &_boolean) const;
       bool operator&&(bool _value) const;
       bool operator&&(int _value) const;
-      bool operator||(const ls_std::Boolean& _boolean) const;
+      bool operator||(const ls_std::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
 
-      ls_std::byte_field load() override;
-      ls_std::byte_field marshal() override;
       void parse(std::string _parseText) override;
-      void save(const ls_std::byte_field& _data) override;
       std::string toString() override;
-      void unmarshal(const ls_std::byte_field& _data) override;
 
       // additional functionality
 
       bool getValue() const;
-      void setSerializable(std::shared_ptr<ISerializable> _serializable);
-      void setStorable(std::shared_ptr<IStorable> _storable);
-      static bool XOR(const ls_std::Boolean& _leftExpression, const ls_std::Boolean& _rightExpression);
-      static bool XOR(const ls_std::Boolean& _leftExpression, bool _rightExpression);
-      static bool XOR(bool _leftExpression, const ls_std::Boolean& _rightExpression);
+      static bool XOR(const ls_std::Boolean &_leftExpression, const ls_std::Boolean &_rightExpression);
+      static bool XOR(const ls_std::Boolean &_leftExpression, bool _rightExpression);
+      static bool XOR(bool _leftExpression, const ls_std::Boolean &_rightExpression);
       static bool XOR(bool _leftExpression, bool _rightExpression);
 
     private:
 
-      std::shared_ptr<ISerializable> serializable {};
-      std::shared_ptr<IStorable> storable {};
-      bool value {};
+      bool value{};
 
       const std::string FALSE_STRING = "false";
       const std::string TRUE_STRING = "true";

+ 28 - 34
include/ls_std/boxing/Double.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2020-11-26
+ * Changed:         2021-07-12
  *
  * */
 
@@ -13,11 +13,11 @@
 #include <memory>
 #include <ls_std/base/Class.hpp>
 #include "IBoxing.hpp"
-#include <ls_std/serialization/ISerializable.hpp>
-#include <ls_std/io/IStorable.hpp>
 
-namespace ls_std {
-  class Double : public Class, public IBoxing, public ISerializable, public IStorable {
+namespace ls_std
+{
+  class Double : public ls_std::Class, public ls_std::IBoxing
+  {
     public:
 
       Double();
@@ -30,44 +30,44 @@ namespace ls_std {
 
       // assignment operators
 
-      ls_std::Double& operator=(double _value);
+      ls_std::Double &operator=(double _value);
 
       // arithmetic operators
 
       double operator-() const;
-      double operator+(const ls_std::Double& _double) const;
+      double operator+(const ls_std::Double &_double) const;
       double operator+(double _value) const;
-      double operator*(const ls_std::Double& _double) const;
+      double operator*(const ls_std::Double &_double) const;
       double operator*(double _value) const;
-      double operator-(const ls_std::Double& _double) const;
+      double operator-(const ls_std::Double &_double) const;
       double operator-(double _value) const;
-      double operator/(const ls_std::Double& _double) const;
+      double operator/(const ls_std::Double &_double) const;
       double operator/(double _value) const;
 
       // compound operators
 
-      ls_std::Double& operator+=(const ls_std::Double& _double);
-      ls_std::Double& operator+=(double _value);
-      ls_std::Double& operator-=(const ls_std::Double& _double);
-      ls_std::Double& operator-=(double _value);
-      ls_std::Double& operator*=(const ls_std::Double& _double);
-      ls_std::Double& operator*=(double _value);
-      ls_std::Double& operator/=(const ls_std::Double& _double);
-      ls_std::Double& operator/=(double _value);
+      ls_std::Double &operator+=(const ls_std::Double &_double);
+      ls_std::Double &operator+=(double _value);
+      ls_std::Double &operator-=(const ls_std::Double &_double);
+      ls_std::Double &operator-=(double _value);
+      ls_std::Double &operator*=(const ls_std::Double &_double);
+      ls_std::Double &operator*=(double _value);
+      ls_std::Double &operator/=(const ls_std::Double &_double);
+      ls_std::Double &operator/=(double _value);
 
       // comparison operators
 
-      bool operator==(const ls_std::Double& _double) const;
+      bool operator==(const ls_std::Double &_double) const;
       bool operator==(double _value) const;
-      bool operator!=(const ls_std::Double& _double) const;
+      bool operator!=(const ls_std::Double &_double) const;
       bool operator!=(double _value) const;
-      bool operator>(const ls_std::Double& _double) const;
+      bool operator>(const ls_std::Double &_double) const;
       bool operator>(double _value) const;
-      bool operator>=(const ls_std::Double& _double) const;
+      bool operator>=(const ls_std::Double &_double) const;
       bool operator>=(double _value) const;
-      bool operator<(const ls_std::Double& _double) const;
+      bool operator<(const ls_std::Double &_double) const;
       bool operator<(double _value) const;
-      bool operator<=(const ls_std::Double& _double) const;
+      bool operator<=(const ls_std::Double &_double) const;
       bool operator<=(double _value) const;
 
       // increment / decrement operator
@@ -77,27 +77,21 @@ namespace ls_std {
 
       // implementation
 
-      ls_std::byte_field load() override;
-      ls_std::byte_field marshal() override;
       void parse(std::string _parseText) override;
-      void save(const ls_std::byte_field& _data) override;
       std::string toString() override;
-      void unmarshal(const ls_std::byte_field& _data) override;
 
       // additional functionality
 
       double getEpsilon();
       double getValue();
       void setEpsilon(double _epsilon);
-      void setSerializable(std::shared_ptr<ISerializable> _serializable);
-      void setStorable(std::shared_ptr<IStorable> _storable);
 
     private:
 
-      double epsilon {};
-      std::shared_ptr<ISerializable> serializable {};
-      std::shared_ptr<IStorable> storable {};
-      double value {};
+      double epsilon{};
+      double value{};
+
+      void _assignEpsilon(double _epsilon);
   };
 }
 

+ 28 - 34
include/ls_std/boxing/Float.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2020-11-26
+ * Changed:         2021-07-12
  *
  * */
 
@@ -13,11 +13,11 @@
 #include <memory>
 #include <ls_std/base/Class.hpp>
 #include "IBoxing.hpp"
-#include <ls_std/serialization/ISerializable.hpp>
-#include <ls_std/io/IStorable.hpp>
 
-namespace ls_std {
-  class Float : public Class, public IBoxing, public ISerializable, public IStorable {
+namespace ls_std
+{
+  class Float : public ls_std::Class, public ls_std::IBoxing
+  {
     public:
 
       Float();
@@ -30,44 +30,44 @@ namespace ls_std {
 
       // assignment operators
 
-      ls_std::Float& operator=(float _value);
+      ls_std::Float &operator=(float _value);
 
       // arithmetic operators
 
       float operator-() const;
-      float operator+(const ls_std::Float& _float) const;
+      float operator+(const ls_std::Float &_float) const;
       float operator+(float _value) const;
-      float operator*(const ls_std::Float& _float) const;
+      float operator*(const ls_std::Float &_float) const;
       float operator*(float _value) const;
-      float operator-(const ls_std::Float& _float) const;
+      float operator-(const ls_std::Float &_float) const;
       float operator-(float _value) const;
-      float operator/(const ls_std::Float& _float) const;
+      float operator/(const ls_std::Float &_float) const;
       float operator/(float _value) const;
 
       // compound operators
 
-      ls_std::Float& operator+=(const ls_std::Float& _float);
-      ls_std::Float& operator+=(float _value);
-      ls_std::Float& operator-=(const ls_std::Float& _float);
-      ls_std::Float& operator-=(float _value);
-      ls_std::Float& operator*=(const ls_std::Float& _float);
-      ls_std::Float& operator*=(float _value);
-      ls_std::Float& operator/=(const ls_std::Float& _float);
-      ls_std::Float& operator/=(float _value);
+      ls_std::Float &operator+=(const ls_std::Float &_float);
+      ls_std::Float &operator+=(float _value);
+      ls_std::Float &operator-=(const ls_std::Float &_float);
+      ls_std::Float &operator-=(float _value);
+      ls_std::Float &operator*=(const ls_std::Float &_float);
+      ls_std::Float &operator*=(float _value);
+      ls_std::Float &operator/=(const ls_std::Float &_float);
+      ls_std::Float &operator/=(float _value);
 
       // comparison operators
 
-      bool operator==(const ls_std::Float& _float) const;
+      bool operator==(const ls_std::Float &_float) const;
       bool operator==(float _value) const;
-      bool operator!=(const ls_std::Float& _float) const;
+      bool operator!=(const ls_std::Float &_float) const;
       bool operator!=(float _value) const;
-      bool operator>(const ls_std::Float& _float) const;
+      bool operator>(const ls_std::Float &_float) const;
       bool operator>(float _value) const;
-      bool operator>=(const ls_std::Float& _float) const;
+      bool operator>=(const ls_std::Float &_float) const;
       bool operator>=(float _value) const;
-      bool operator<(const ls_std::Float& _float) const;
+      bool operator<(const ls_std::Float &_float) const;
       bool operator<(float _value) const;
-      bool operator<=(const ls_std::Float& _float) const;
+      bool operator<=(const ls_std::Float &_float) const;
       bool operator<=(float _value) const;
 
       // increment / decrement operator
@@ -77,27 +77,21 @@ namespace ls_std {
 
       // implementation
 
-      ls_std::byte_field load() override;
-      ls_std::byte_field marshal() override;
       void parse(std::string _parseText) override;
-      void save(const ls_std::byte_field& _data) override;
       std::string toString() override;
-      void unmarshal(const ls_std::byte_field& _data) override;
 
       // additional functionality
 
       float getEpsilon();
       float getValue();
       void setEpsilon(float _epsilon);
-      void setSerializable(std::shared_ptr<ISerializable> _serializable);
-      void setStorable(std::shared_ptr<IStorable> _storable);
 
     private:
 
-      float epsilon {};
-      std::shared_ptr<ISerializable> serializable {};
-      std::shared_ptr<IStorable> storable {};
-      float value {};
+      float epsilon{};
+      float value{};
+
+      void _assignEpsilon(float _epsilon);
   };
 }
 

+ 5 - 3
include/ls_std/boxing/IBoxing.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-07
- * Changed:         2020-11-06
+ * Changed:         2021-04-23
  *
  * */
 
@@ -12,8 +12,10 @@
 
 #include <string>
 
-namespace ls_std {
-  class IBoxing {
+namespace ls_std
+{
+  class IBoxing
+  {
     public:
 
       IBoxing() = default;

+ 30 - 35
include/ls_std/boxing/Integer.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-07
- * Changed:         2020-11-26
+ * Changed:         2021-07-14
  *
  * */
 
@@ -16,8 +16,10 @@
 #include <ls_std/serialization/ISerializable.hpp>
 #include <ls_std/io/IStorable.hpp>
 
-namespace ls_std {
-  class Integer : public Class, public IBoxing, public ISerializable, public IStorable {
+namespace ls_std
+{
+  class Integer : public ls_std::Class, public ls_std::IBoxing
+  {
     public:
 
       explicit Integer(int _value);
@@ -30,58 +32,59 @@ namespace ls_std {
 
       // assignment operators
 
-      ls_std::Integer& operator=(int _value);
+      ls_std::Integer &operator=(int _value);
 
       // arithmetic operators
 
       int operator-() const;
-      int operator+(const ls_std::Integer& _integer) const;
+      int operator+(const ls_std::Integer &_integer) const;
       int operator+(int _value) const;
-      int operator*(const ls_std::Integer& _integer) const;
+      int operator*(const ls_std::Integer &_integer) const;
       int operator*(int _value) const;
-      int operator-(const ls_std::Integer& _integer) const;
+      int operator-(const ls_std::Integer &_integer) const;
       int operator-(int _value) const;
-      int operator/(const ls_std::Integer& _integer) const;
+      int operator/(const ls_std::Integer &_integer) const;
       int operator/(int _value) const;
-      int operator%(const ls_std::Integer& _integer) const;
+      int operator%(const ls_std::Integer &_integer) const;
       int operator%(int _value) const;
 
       // compound operators
 
-      ls_std::Integer& operator+=(const ls_std::Integer& _integer);
-      ls_std::Integer& operator+=(int _value);
-      ls_std::Integer& operator-=(const ls_std::Integer& _integer);
-      ls_std::Integer& operator-=(int _value);
-      ls_std::Integer& operator*=(const ls_std::Integer& _integer);
-      ls_std::Integer& operator*=(int _value);
-      ls_std::Integer& operator/=(const ls_std::Integer& _integer);
-      ls_std::Integer& operator/=(int _value);
+      ls_std::Integer &operator+=(const ls_std::Integer &_integer);
+      ls_std::Integer &operator+=(int _value);
+      ls_std::Integer &operator-=(const ls_std::Integer &_integer);
+      ls_std::Integer &operator-=(int _value);
+      ls_std::Integer &operator*=(const ls_std::Integer &_integer);
+      ls_std::Integer &operator*=(int _value);
+      ls_std::Integer &operator/=(const ls_std::Integer &_integer);
+      ls_std::Integer &operator/=(int _value);
 
       // comparison operators
 
-      bool operator==(const ls_std::Integer& _integer) const;
+      bool operator==(const ls_std::Integer &_integer) const;
       bool operator==(int _value) const;
-      bool operator!=(const ls_std::Integer& _integer) const;
+      bool operator!=(const ls_std::Integer &_integer) const;
       bool operator!=(int _value) const;
-      bool operator>(const ls_std::Integer& _integer) const;
+      bool operator>(const ls_std::Integer &_integer) const;
       bool operator>(int _value) const;
-      bool operator>=(const ls_std::Integer& _integer) const;
+      bool operator>=(const ls_std::Integer &_integer) const;
       bool operator>=(int _value) const;
-      bool operator<(const ls_std::Integer& _integer) const;
+      bool operator<(const ls_std::Integer &_integer) const;
       bool operator<(int _value) const;
-      bool operator<=(const ls_std::Integer& _integer) const;
+      bool operator<=(const ls_std::Integer &_integer) const;
       bool operator<=(int _value) const;
 
       // logical operators
 
-      friend bool operator!(const ls_std::Integer& _integer) {
+      friend bool operator!(const ls_std::Integer &_integer)
+      {
         return !_integer.value;
       }
 
-      bool operator&&(const ls_std::Integer& _integer) const;
+      bool operator&&(const ls_std::Integer &_integer) const;
       bool operator&&(int _value) const;
       bool operator&&(bool _expression) const;
-      bool operator||(const ls_std::Integer& _integer) const;
+      bool operator||(const ls_std::Integer &_integer) const;
       bool operator||(int _value) const;
       bool operator||(bool _expression) const;
 
@@ -92,24 +95,16 @@ namespace ls_std {
 
       // implementation
 
-      ls_std::byte_field load() override;
-      ls_std::byte_field marshal() override;
       void parse(std::string _parseText) override;
-      void save(const ls_std::byte_field& _data) override;
       std::string toString() override;
-      void unmarshal(const ls_std::byte_field& _data) override;
 
       // additional functionality
 
       int getValue() const;
-      void setSerializable(std::shared_ptr<ISerializable> _serializable);
-      void setStorable(std::shared_ptr<IStorable> _storable);
 
     private:
 
-      std::shared_ptr<ISerializable> serializable {};
-      std::shared_ptr<IStorable> storable {};
-      int value {};
+      int value{};
   };
 }
 

+ 30 - 35
include/ls_std/boxing/Long.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2020-11-26
+ * Changed:         2021-07-14
  *
  * */
 
@@ -17,8 +17,10 @@
 #include <ls_std/serialization/ISerializable.hpp>
 #include <ls_std/io/IStorable.hpp>
 
-namespace ls_std {
-  class Long : public Class, public IBoxing, public ISerializable, public IStorable {
+namespace ls_std
+{
+  class Long : public ls_std::Class, public ls_std::IBoxing
+  {
     public:
 
       explicit Long(ls_std::long_type _value);
@@ -31,58 +33,59 @@ namespace ls_std {
 
       // assignment operators
 
-      ls_std::Long& operator=(ls_std::long_type _value);
+      ls_std::Long &operator=(ls_std::long_type _value);
 
       // arithmetic operators
 
       ls_std::long_type operator-() const;
-      ls_std::long_type operator+(const ls_std::Long& _long) const;
+      ls_std::long_type operator+(const ls_std::Long &_long) const;
       ls_std::long_type operator+(ls_std::long_type _value) const;
-      ls_std::long_type operator*(const ls_std::Long& _long) const;
+      ls_std::long_type operator*(const ls_std::Long &_long) const;
       ls_std::long_type operator*(ls_std::long_type _value) const;
-      ls_std::long_type operator-(const ls_std::Long& _long) const;
+      ls_std::long_type operator-(const ls_std::Long &_long) const;
       ls_std::long_type operator-(ls_std::long_type _value) const;
-      ls_std::long_type operator/(const ls_std::Long& _long) const;
+      ls_std::long_type operator/(const ls_std::Long &_long) const;
       ls_std::long_type operator/(ls_std::long_type _value) const;
-      ls_std::long_type operator%(const ls_std::Long& _long) const;
+      ls_std::long_type operator%(const ls_std::Long &_long) const;
       ls_std::long_type operator%(ls_std::long_type _value) const;
 
       // compound operators
 
-      ls_std::Long& operator+=(const ls_std::Long& _long);
-      ls_std::Long& operator+=(ls_std::long_type _value);
-      ls_std::Long& operator-=(const ls_std::Long& _long);
-      ls_std::Long& operator-=(ls_std::long_type _value);
-      ls_std::Long& operator*=(const ls_std::Long& _long);
-      ls_std::Long& operator*=(ls_std::long_type _value);
-      ls_std::Long& operator/=(const ls_std::Long& _long);
-      ls_std::Long& operator/=(ls_std::long_type _value);
+      ls_std::Long &operator+=(const ls_std::Long &_long);
+      ls_std::Long &operator+=(ls_std::long_type _value);
+      ls_std::Long &operator-=(const ls_std::Long &_long);
+      ls_std::Long &operator-=(ls_std::long_type _value);
+      ls_std::Long &operator*=(const ls_std::Long &_long);
+      ls_std::Long &operator*=(ls_std::long_type _value);
+      ls_std::Long &operator/=(const ls_std::Long &_long);
+      ls_std::Long &operator/=(ls_std::long_type _value);
 
       // comparison operators
 
-      bool operator==(const ls_std::Long& _long) const;
+      bool operator==(const ls_std::Long &_long) const;
       bool operator==(ls_std::long_type _value) const;
-      bool operator!=(const ls_std::Long& _long) const;
+      bool operator!=(const ls_std::Long &_long) const;
       bool operator!=(ls_std::long_type _value) const;
-      bool operator>(const ls_std::Long& _long) const;
+      bool operator>(const ls_std::Long &_long) const;
       bool operator>(ls_std::long_type _value) const;
-      bool operator>=(const ls_std::Long& _long) const;
+      bool operator>=(const ls_std::Long &_long) const;
       bool operator>=(ls_std::long_type _value) const;
-      bool operator<(const ls_std::Long& _long) const;
+      bool operator<(const ls_std::Long &_long) const;
       bool operator<(ls_std::long_type _value) const;
-      bool operator<=(const ls_std::Long& _long) const;
+      bool operator<=(const ls_std::Long &_long) const;
       bool operator<=(ls_std::long_type _value) const;
 
       // logical operators
 
-      friend bool operator!(const ls_std::Long& _long) {
+      friend bool operator!(const ls_std::Long &_long)
+      {
         return !_long.value;
       }
 
-      bool operator&&(const ls_std::Long& _long) const;
+      bool operator&&(const ls_std::Long &_long) const;
       bool operator&&(ls_std::long_type _value) const;
       bool operator&&(bool _expression) const;
-      bool operator||(const ls_std::Long& _long) const;
+      bool operator||(const ls_std::Long &_long) const;
       bool operator||(ls_std::long_type _value) const;
       bool operator||(bool _expression) const;
 
@@ -93,24 +96,16 @@ namespace ls_std {
 
       // implementation
 
-      ls_std::byte_field load() override;
-      ls_std::byte_field marshal() override;
       void parse(std::string _parseText) override;
-      void save(const ls_std::byte_field& _data) override;
       std::string toString() override;
-      void unmarshal(const ls_std::byte_field& _data) override;
 
       // additional functionality
 
       ls_std::long_type getValue() const;
-      void setSerializable(std::shared_ptr<ISerializable> _serializable);
-      void setStorable(std::shared_ptr<IStorable> _storable);
 
     private:
 
-      std::shared_ptr<ISerializable> serializable {};
-      std::shared_ptr<IStorable> storable {};
-      ls_std::long_type value {};
+      ls_std::long_type value{};
   };
 }
 

+ 21 - 28
include/ls_std/boxing/String.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2020-11-26
+ * Changed:         2021-07-12
  *
  * */
 
@@ -12,14 +12,15 @@
 
 #include "IBoxing.hpp"
 #include <ls_std/base/Class.hpp>
-#include <ls_std/serialization/ISerializable.hpp>
-#include <ls_std/io/IStorable.hpp>
+#include <ls_std/base/Types.hpp>
 #include <string>
 #include <memory>
 #include <vector>
 
-namespace ls_std {
-  class String : public Class, public IBoxing, public ISerializable, public IStorable {
+namespace ls_std
+{
+  class String : public ls_std::Class, public ls_std::IBoxing
+  {
     public:
 
       String();
@@ -28,67 +29,59 @@ namespace ls_std {
 
       // conversion operator
 
-      operator const char*() const; // do not make explicit!
+      operator const char *() const; // do not make explicit!
       operator std::string() const; // do not make explicit!
 
       // assignment operators
 
-      ls_std::String& operator=(std::string _value);
+      ls_std::String &operator=(std::string _value);
 
       // arithmetic operators
 
       std::string operator+(ls_std::String _string) const;
-      std::string operator+(const std::string& _string) const;
-      std::string operator+(const char* _string) const;
+      std::string operator+(const std::string &_string) const;
+      std::string operator+(const char *_string) const;
       std::string operator-(int _number);
 
       // compound operators
 
-      ls_std::String& operator+=(ls_std::String _string);
-      ls_std::String& operator+=(const std::string& _text);
+      ls_std::String &operator+=(ls_std::String _string);
+      ls_std::String &operator+=(const std::string &_text);
 
       // comparison operators
 
       bool operator==(ls_std::String _string);
-      bool operator==(const std::string& _value);
-      bool operator==(const char* _value);
+      bool operator==(const std::string &_value);
+      bool operator==(const char *_value);
       bool operator!=(ls_std::String _string);
-      bool operator!=(const std::string& _value);
-      bool operator!=(const char* _value);
+      bool operator!=(const std::string &_value);
+      bool operator!=(const char *_value);
 
       // implementation
 
-      ls_std::byte_field load() override;
-      ls_std::byte_field marshal() override;
       void parse(std::string _parseText) override;
-      void save(const ls_std::byte_field& _data) override;
       std::string toString() override;
-      void unmarshal(const ls_std::byte_field& _data) override;
 
       // additional functionality
 
-      bool contains(const std::string& _text);
-      bool endsWith(const std::string& _text);
+      bool contains(const std::string &_text);
+      bool endsWith(const std::string &_text);
       bool equalsIgnoreCase(ls_std::String _string);
       bool equalsIgnoreCase(std::string _text);
       std::vector<ls_std::byte> getByteData();
       std::string padLeft(size_t _width, char _fillCharacter);
       std::string padRight(size_t _width, char _fillCharacter);
       std::string reverse();
-      void setSerializable(std::shared_ptr<ISerializable> _serializable);
-      void setStorable(std::shared_ptr<IStorable> _storable);
-      bool startsWith(const std::string& _text);
+      bool startsWith(const std::string &_text);
       std::string toLowerCase();
       std::string toUpperCase();
 
     private:
 
-      std::shared_ptr<ISerializable> serializable {};
-      std::shared_ptr<IStorable> storable {};
-      std::string value {};
+      std::string value{};
 
       static std::string _buildCharacterChain(size_t _amount, char _fillCharacter);
-      static std::string _createFillContent(const std::string& _text, size_t _width, char _fillCharacter);
+      static std::string _createFillContent(const std::string &_text, size_t _width, char _fillCharacter);
   };
 }
 

+ 13 - 18
include/ls_std/event/Event.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-26
- * Changed:         2020-12-23
+ * Changed:         2021-07-14
  *
  * */
 
@@ -15,36 +15,31 @@
 #include <memory>
 #include "EventTypes.hpp"
 
-namespace ls_std {
-  class Event : public ls_std::Class, public ISerializable {
+namespace ls_std
+{
+  class Event : public ls_std::Class
+  {
     public:
 
-      explicit Event(const ls_std::event_id&  _id);
+      explicit Event(const ls_std::event_id &_id);
       ~Event() override = default;
 
-      // implementation
-
-      ls_std::byte_field marshal() override;
-      void unmarshal(const ls_std::byte_field& _data) override;
-
       // additional functionality
 
-      void addParameter(const ls_std::event_parameter& _eventParameter);
+      bool addParameter(const ls_std::event_parameter &_eventParameter);
       void clearParameterList();
       ls_std::event_id getId();
       ls_std::event_parameter_list getParameterList();
-      void removeParameter(const ls_std::event_parameter_id& _id);
-      void setId(const ls_std::event_id&  _id);
-      void setSerializable(std::shared_ptr<ISerializable> _serializable);
+      bool removeParameter(const ls_std::event_parameter_id &_id);
+      void setId(const ls_std::event_id &_id);
 
     private:
 
-      ls_std::event_id id {};
-      ls_std::event_parameter_list parameterList {};
-      std::shared_ptr<ISerializable> serializable {};
+      ls_std::event_id id{};
+      ls_std::event_parameter_list parameterList{};
 
-      void _assignId(const ls_std::event_id& _id);
-      bool _hasParameter(const ls_std::event_id&  _id);
+      void _assignId(const ls_std::event_id &_id);
+      bool _hasParameter(const ls_std::event_id &_id);
   };
 }
 

+ 9 - 5
include/ls_std/event/EventHandler.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2020-11-28
+ * Changed:         2021-05-27
  *
  * */
 
@@ -17,18 +17,22 @@
 #include "Event.hpp"
 #include <ls_std/logic/Narrator.hpp>
 
-namespace ls_std {
-  class EventHandler : public ls_std::Narrator {
+namespace ls_std
+{
+  class EventHandler : public ls_std::Narrator
+  {
     public:
 
-      explicit EventHandler(ls_std::event_id  _id);
+      explicit EventHandler(const ls_std::event_id& _id);
       ~EventHandler() override = default;
 
       ls_std::event_id getId();
 
     private:
 
-      ls_std::event_id id {};
+      ls_std::event_id id{};
+
+      void _assignId(const ls_std::event_id& _id);
   };
 }
 

+ 13 - 10
include/ls_std/event/EventManager.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2020-11-29
+ * Changed:         2021-05-27
  *
  * */
 
@@ -17,8 +17,10 @@
 #include "EventHandler.hpp"
 #include "IEventSubscriber.hpp"
 
-namespace ls_std {
-  class EventManager : public ls_std::Class, public ls_std::IEventSubscriber {
+namespace ls_std
+{
+  class EventManager : public ls_std::Class, public ls_std::IEventSubscriber
+  {
     public:
 
       explicit EventManager();
@@ -26,21 +28,22 @@ namespace ls_std {
 
       // implementation
 
-      void subscribe(const ls_std::event_id& _id, const std::shared_ptr<IListener>& _listener) override;
-      void unsubscribe(const ls_std::event_id& _id, const std::shared_ptr<IListener>& _listener) override;
+      void subscribe(const ls_std::event_id &_id, const std::shared_ptr<ls_std::IListener> &_listener) override;
+      void unsubscribe(const ls_std::event_id &_id, const std::shared_ptr<ls_std::IListener> &_listener) override;
 
       // additional functionality
 
-      void addEventHandler(const std::shared_ptr<ls_std::EventHandler>& _eventHandler);
+      bool addEventHandler(const std::shared_ptr<ls_std::EventHandler> &_eventHandler);
       void fire(ls_std::Event _event);
-      void removeEventHandler(const std::shared_ptr<ls_std::EventHandler>& _eventHandler);
+      bool hasEventHandler(const ls_std::event_id &_id);
+      bool removeEventHandler(const std::shared_ptr<ls_std::EventHandler> &_eventHandler);
 
     private:
 
-      std::map<ls_std::event_id, std::shared_ptr<ls_std::EventHandler>> eventHandlers {};
+      std::map<ls_std::event_id, std::shared_ptr<ls_std::EventHandler>> eventHandlers{};
 
-      bool _hasEventHandler(const ls_std::event_id& _id);
-      void _removeEventHandler(const std::shared_ptr<ls_std::EventHandler>& _eventHandler);
+      bool _hasEventHandler(const ls_std::event_id &_id);
+      bool _removeEventHandler(const std::shared_ptr<ls_std::EventHandler> &_eventHandler);
   };
 }
 

+ 4 - 3
include/ls_std/event/EventTypes.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-26
- * Changed:         2020-11-26
+ * Changed:         2021-05-01
  *
  * */
 
@@ -14,12 +14,13 @@
 #include <vector>
 #include <map>
 
-namespace ls_std {
+namespace ls_std
+{
   using event_id = std::string;
   using event_parameter_id = std::string;
   using event_parameter_value = std::string;
   using event_parameter = std::pair<std::string, std::string>;
-  using event_parameter_list = std::map<event_parameter_id, event_parameter_value>;
+  using event_parameter_list = std::map<ls_std::event_parameter_id, ls_std::event_parameter_value>;
 }
 
 #endif

+ 7 - 5
include/ls_std/event/IEventSubscriber.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2020-11-29
+ * Changed:         2021-05-01
  *
  * */
 
@@ -14,15 +14,17 @@
 #include <memory>
 #include <ls_std/logic/IListener.hpp>
 
-namespace ls_std {
-  class IEventSubscriber {
+namespace ls_std
+{
+  class IEventSubscriber
+  {
     public:
 
       IEventSubscriber() = default;
       ~IEventSubscriber() = default;
 
-      virtual void subscribe(const ls_std::event_id& _id, const std::shared_ptr<IListener>& _listener) = 0;
-      virtual void unsubscribe(const ls_std::event_id& _id, const std::shared_ptr<IListener>& _listener) = 0;
+      virtual void subscribe(const ls_std::event_id &_id, const std::shared_ptr<ls_std::IListener> &_listener) = 0;
+      virtual void unsubscribe(const ls_std::event_id &_id, const std::shared_ptr<ls_std::IListener> &_listener) = 0;
   };
 }
 

+ 30 - 0
include/ls_std/exception/EventNotHandledException.hpp

@@ -0,0 +1,30 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2021-05-27
+ * Changed:         2021-05-27
+ *
+ * */
+
+#ifndef LS_STD_EVENT_NOT_HANDLED_EXCEPTION_HPP
+#define LS_STD_EVENT_NOT_HANDLED_EXCEPTION_HPP
+
+#include <exception>
+
+namespace ls_std
+{
+  class EventNotHandledException : public std::exception
+  {
+    public:
+
+      EventNotHandledException() = default;
+
+      const char *what() const noexcept override
+      {
+        return "EventNotHandledException thrown - event was not handled - nothing happened!";
+      };
+  };
+}
+
+#endif

+ 30 - 0
include/ls_std/exception/EventNotSubscribedException.hpp

@@ -0,0 +1,30 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2021-05-27
+ * Changed:         2021-05-27
+ *
+ * */
+
+#ifndef LS_STD_EVENT_NOT_SUBSCRIBED_EXCEPTION_HPP
+#define LS_STD_EVENT_NOT_SUBSCRIBED_EXCEPTION_HPP
+
+#include <exception>
+
+namespace ls_std
+{
+  class EventNotSubscribedException : public std::exception
+  {
+    public:
+
+      EventNotSubscribedException() = default;
+
+      const char *what() const noexcept override
+      {
+        return "EventNotSubscribedException thrown - event was not subscribed!";
+      };
+  };
+}
+
+#endif

+ 7 - 4
include/ls_std/exception/FileNotFoundException.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2020-11-06
+ * Changed:         2021-04-23
  *
  * */
 
@@ -15,13 +15,16 @@
 #include <cstring>
 
 // TODO: pass parameters, use class, show class name
-namespace ls_std {
-  class FileNotFoundException : public std::exception {
+namespace ls_std
+{
+  class FileNotFoundException : public std::exception
+  {
     public:
 
       FileNotFoundException() = default;
 
-      const char *what() const noexcept override {
+      const char *what() const noexcept override
+      {
         return "FileNotFoundException thrown - file not found!";
       };
   };

+ 7 - 4
include/ls_std/exception/FileOperationException.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-15
- * Changed:         2020-11-06
+ * Changed:         2021-04-23
  *
  * */
 
@@ -13,13 +13,16 @@
 #include <exception>
 #include <string>
 
-namespace ls_std {
-  class FileOperationException : public std::exception {
+namespace ls_std
+{
+  class FileOperationException : public std::exception
+  {
     public:
 
       explicit FileOperationException() = default;
 
-      const char *what() const noexcept override {
+      const char *what() const noexcept override
+      {
         return "FileOperationException thrown - file operation failed!";
       }
   };

+ 7 - 4
include/ls_std/exception/IllegalArgumentException.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-09
- * Changed:         2020-11-06
+ * Changed:         2021-04-23
  *
  * */
 
@@ -12,13 +12,16 @@
 
 #include <exception>
 
-namespace ls_std {
-  class IllegalArgumentException : public std::exception {
+namespace ls_std
+{
+  class IllegalArgumentException : public std::exception
+  {
     public:
 
       IllegalArgumentException() = default;
 
-      const char *what() const noexcept override {
+      const char *what() const noexcept override
+      {
         return "IllegalArgumentException thrown - passed argument is not valid!";
       }
   };

+ 8 - 5
include/ls_std/exception/IllegalArithmeticOperationException.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-07
- * Changed:         2020-11-06
+ * Changed:         2021-05-01
  *
  * */
 
@@ -12,14 +12,17 @@
 
 #include <exception>
 
-namespace ls_std {
-  class IllegalArithmeticOperationException : public std::exception {
+namespace ls_std
+{
+  class IllegalArithmeticOperationException : public std::exception
+  {
     public:
 
       IllegalArithmeticOperationException() = default;
 
-      const char *what() const noexcept override {
-        return "IllegalArithmeticOperationException thrown - arithmetic operation is not valid!";
+      const char *what() const noexcept override
+      {
+        return "IllegalArithmeticOperationException thrown - arithmetic operation is not allowed!";
       }
   };
 }

+ 30 - 0
include/ls_std/exception/IncompleteJsonException.hpp

@@ -0,0 +1,30 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2021-04-30
+ * Changed:         2021-05-01
+ *
+ * */
+
+#ifndef LS_STD_INCOMPLETE_JSON_EXCEPTION_HPP
+#define LS_STD_INCOMPLETE_JSON_EXCEPTION_HPP
+
+#include <exception>
+
+namespace ls_std
+{
+  class IncompleteJsonException : public std::exception
+  {
+    public:
+
+      explicit IncompleteJsonException() = default;
+
+      const char *what() const noexcept override
+      {
+        return "IncompleteJsonException thrown - this JSON string is incomplete.";
+      }
+  };
+}
+
+#endif

+ 7 - 4
include/ls_std/exception/NullPointerException.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-06
- * Changed:         2020-11-06
+ * Changed:         2021-04-23
  *
  * */
 
@@ -12,13 +12,16 @@
 
 #include <exception>
 
-namespace ls_std {
-  class NullPointerException : public std::exception {
+namespace ls_std
+{
+  class NullPointerException : public std::exception
+  {
     public:
 
       explicit NullPointerException() = default;
 
-      const char *what() const noexcept override {
+      const char *what() const noexcept override
+      {
         return "NullPointerException thrown - reference is null!";
       }
   };

+ 29 - 0
include/ls_std/factory/IFactory.hpp

@@ -0,0 +1,29 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2021-04-23
+ * Changed:         2021-04-23
+ *
+ * */
+
+#ifndef LS_STD_I_FACTORY_HPP
+#define LS_STD_I_FACTORY_HPP
+
+#include <memory>
+#include <ls_std/base/Class.hpp>
+
+namespace ls_std
+{
+  class IFactory
+  {
+    public:
+
+      IFactory() = default;
+      ~IFactory() = default;
+
+      virtual std::shared_ptr<ls_std::Class> build() = 0;
+  };
+}
+
+#endif

+ 44 - 31
include/ls_std/io/File.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-15
- * Changed:         2020-11-26
+ * Changed:         2021-09-26
  *
  * */
 
@@ -18,15 +18,21 @@
 #include <regex>
 
 #if defined(unix) || defined(__APPLE__)
+
 #include <dirent.h>
+
 #endif
 
 #ifdef _WIN32
+
 #include <windows.h>
+
 #endif
 
-namespace ls_std {
-  class File : public Class {
+namespace ls_std
+{
+  class File : public ls_std::Class
+  {
     public:
 
       explicit File(std::string _absoluteFilePath);
@@ -34,8 +40,8 @@ namespace ls_std {
 
       // comparison operators
 
-      bool operator==(ls_std::File& _file);
-      bool operator!=(ls_std::File& _file);
+      bool operator==(ls_std::File &_file);
+      bool operator!=(ls_std::File &_file);
 
       // additional functionality
 
@@ -47,6 +53,7 @@ namespace ls_std {
       std::string getAbsoluteFilePath();
       std::string getName();
       std::string getParent();
+      static std::string getWorkingDirectory();
       long getSize();
       bool isDirectory();
       bool isFile();
@@ -56,54 +63,60 @@ namespace ls_std {
       void makeDirectory();
       void makeDirectories();
       void remove();
-      bool renameTo(const std::string& _newName);
-      void reset(const std::string& _newPath);
+      bool renameTo(const std::string &_newName);
+      void reset(const std::string &_newPath);
 
     private:
 
-      std::string absoluteFilePath {};
+      std::string absoluteFilePath{};
 
       #if defined(unix) || defined(__APPLE__)
-        static void _addToFileListUnix(const std::string& _path, bool _withDirectories, dirent* directoryEntity, std::list<std::string>& _list);
+      static void _addToFileListUnix(const std::string &_path, bool _withDirectories, dirent *directoryEntity, std::list<std::string> &_list);
+      #endif
+      #ifdef _WIN32
+      static void _addToFileListWindows(const std::string &_path, bool _withDirectories, WIN32_FIND_DATA _data, std::list<std::string> &_list);
+      #endif
+      static bool _equals(ls_std::File &_file, ls_std::File &_foreignFile);
+      static bool _exists(const std::string &_path);
+      static std::string _getParent(const std::string &_path);
+      #if defined(unix) || defined(__APPLE__)
+      static std::string _getWorkingDirectoryUnix();
       #endif
       #ifdef _WIN32
-        static void _addToFileListWindows(const std::string& _path, bool _withDirectories, WIN32_FIND_DATA _data, std::list<std::string>& _list);
+      static std::string _getWorkingDirectoryWindows();
       #endif
-      static bool _equals(ls_std::File& _file, ls_std::File& _foreignFile);
-      static bool _exists(const std::string& _path);
-      static std::string _getParent(const std::string& _path);
-      static bool _isDirectory(const std::string& _path);
-      static bool _isExecutable(const std::string& _path);
-      static bool _isFile(const std::string& _path);
+      static bool _isDirectory(const std::string &_path);
+      static bool _isExecutable(const std::string &_path);
+      static bool _isFile(const std::string &_path);
       #if defined(unix) || defined(__APPLE__)
-        static bool _isReadableUnix(const std::string& _path);
+      static bool _isReadableUnix(const std::string &_path);
       #endif
       #ifdef _WIN32
-        static bool _isReadableWindows(const std::string& _path);
+      static bool _isReadableWindows(const std::string &_path);
       #endif
-      static bool _isWritable(const std::string& _path);
-      static time_t _lastModified(const std::string& _path);
-      static std::list<std::string> _list(const std::string& _path);
-      static std::list<std::string> _listFiles(const std::string& _path);
+      static bool _isWritable(const std::string &_path);
+      static time_t _lastModified(const std::string &_path);
+      static std::list<std::string> _list(const std::string &_path);
+      static std::list<std::string> _listFiles(const std::string &_path);
       #if defined(unix) || defined(__APPLE__)
-        static std::list<std::string> _listUnix(const std::string& _path, bool withDirectories);
+      static std::list<std::string> _listUnix(const std::string &_path, bool withDirectories);
       #endif
       #ifdef _WIN32
-        static std::list<std::string> _listWindows(const std::string& _path, bool withDirectories);
+      static std::list<std::string> _listWindows(const std::string &_path, bool withDirectories);
       #endif
-      static int _mkdir(const std::string& _path);
+      static int _mkdir(const std::string &_path);
       static std::string _normalizePath(std::string _path);
-      static std::string _reduceSeparators(const std::string& _path);
-      static void _remove(const std::string& _path);
+      static std::string _reduceSeparators(const std::string &_path);
+      static void _remove(const std::string &_path);
       #if defined(unix) || defined(__APPLE__)
-        static void _removeUnix(const std::string& _path);
+      static void _removeUnix(const std::string &_path);
       #endif
       #ifdef _WIN32
-        static void _removeWindows(const std::string& _path);
+      static void _removeWindows(const std::string &_path);
       #endif
-      static bool _renameTo(const std::string& _oldName, const std::string& _newName);
+      static bool _renameTo(const std::string &_oldName, const std::string &_newName);
       static std::string _replaceWrongSeparator(std::string _path);
-      static std::vector<std::string> _splitIntoSubDirectoryNames(const std::string& _path);
+      static std::vector<std::string> _splitIntoSubDirectoryNames(const std::string &_path);
   };
 }
 

+ 10 - 8
include/ls_std/io/FileOutputStream.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2020-11-26
+ * Changed:         2021-05-01
  *
  * */
 
@@ -15,22 +15,24 @@
 #include "IWriter.hpp"
 #include <fstream>
 
-namespace ls_std {
-  class FileOutputStream : public Class, public IWriter {
+namespace ls_std
+{
+  class FileOutputStream : public ls_std::Class, public ls_std::IWriter
+  {
     public:
 
-      explicit FileOutputStream(ls_std::File& _file);
-      explicit FileOutputStream(ls_std::File& _file, bool _append);
+      explicit FileOutputStream(ls_std::File &_file);
+      explicit FileOutputStream(ls_std::File &_file, bool _append);
       ~FileOutputStream() override;
 
       void close();
-      bool write(const ls_std::byte_field& _data) override;
+      bool write(const ls_std::byte_field &_data) override;
 
     private:
 
-      bool append {};
+      bool append{};
       ls_std::File file;
-      std::ofstream outputStream {};
+      std::ofstream outputStream{};
 
       void _close();
       void _init();

+ 13 - 8
include/ls_std/io/FilePathSeparator.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-15
- * Changed:         2020-11-06
+ * Changed:         2021-04-23
  *
  * */
 
@@ -12,31 +12,36 @@
 
 #include <string>
 
-namespace ls_std {
-  class FilePathSeparator {
+namespace ls_std
+{
+  class FilePathSeparator
+  {
     public:
 
       FilePathSeparator() = default;
       ~FilePathSeparator() = default;
 
-      static char get() {
+      static char get()
+      {
         char separator;
 
         #ifdef _WIN32
-          separator = ls_std::FilePathSeparator::getWindowsFilePathSeparator();
+        separator = ls_std::FilePathSeparator::getWindowsFilePathSeparator();
         #endif
         #if defined(unix) || defined(__APPLE__)
-          separator = ls_std::FilePathSeparator::getUnixFilePathSeparator();
+        separator = ls_std::FilePathSeparator::getUnixFilePathSeparator();
         #endif
 
         return separator;
       }
 
-      static char getUnixFilePathSeparator() {
+      static char getUnixFilePathSeparator()
+      {
         return '/';
       }
 
-      static char getWindowsFilePathSeparator() {
+      static char getWindowsFilePathSeparator()
+      {
         return '\\';
       }
   };

+ 7 - 4
include/ls_std/io/FilePathSeparatorMatch.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-15
- * Changed:         2020-11-06
+ * Changed:         2021-04-23
  *
  * */
 
@@ -12,9 +12,12 @@
 
 #include "FilePathSeparator.hpp"
 
-namespace ls_std {
-  struct FilePathSeparatorMatch {
-    bool operator()(char _char) const {
+namespace ls_std
+{
+  struct FilePathSeparatorMatch
+  {
+    bool operator()(char _char) const
+    {
       return _char == ls_std::FilePathSeparator::getWindowsFilePathSeparator() || _char == ls_std::FilePathSeparator::getUnixFilePathSeparator();
     }
   };

+ 7 - 5
include/ls_std/io/FileReader.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2020-11-26
+ * Changed:         2021-05-01
  *
  * */
 
@@ -14,15 +14,17 @@
 #include "File.hpp"
 #include "IReader.hpp"
 
-namespace ls_std {
-  class FileReader : public Class, public IReader {
+namespace ls_std
+{
+  class FileReader : public ls_std::Class, public ls_std::IReader
+  {
     public:
 
-      explicit FileReader(ls_std::File& _file);
+      explicit FileReader(ls_std::File &_file);
       ~FileReader() override = default;
 
       ls_std::byte_field read() override;
-      void reset(ls_std::File& _file);
+      void reset(ls_std::File &_file);
 
     private:
 

+ 9 - 7
include/ls_std/io/FileWriter.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2020-11-26
+ * Changed:         2021-05-01
  *
  * */
 
@@ -14,21 +14,23 @@
 #include "IWriter.hpp"
 #include "File.hpp"
 
-namespace ls_std {
-  class FileWriter : public Class, public IWriter {
+namespace ls_std
+{
+  class FileWriter : public ls_std::Class, public ls_std::IWriter
+  {
     public:
 
-      explicit FileWriter(ls_std::File& _file);
+      explicit FileWriter(ls_std::File &_file);
       ~FileWriter() override = default;
 
-      void reset(ls_std::File& _file);
-      bool write(const ls_std::byte_field& _data) override;
+      void reset(ls_std::File &_file);
+      bool write(const ls_std::byte_field &_data) override;
 
     private:
 
       ls_std::File file;
 
-      static void _init(ls_std::File& _file);
+      static void _init(ls_std::File &_file);
   };
 }
 

+ 5 - 3
include/ls_std/io/IReader.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2020-11-20
+ * Changed:         2021-04-23
  *
  * */
 
@@ -12,8 +12,10 @@
 
 #include <ls_std/base/Types.hpp>
 
-namespace ls_std {
-  class IReader {
+namespace ls_std
+{
+  class IReader
+  {
     public:
 
       IReader() = default;

+ 6 - 4
include/ls_std/io/IStorable.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-19
- * Changed:         2020-11-20
+ * Changed:         2021-04-23
  *
  * */
 
@@ -12,14 +12,16 @@
 
 #include <ls_std/base/Types.hpp>
 
-namespace ls_std {
-  class IStorable {
+namespace ls_std
+{
+  class IStorable
+  {
     public:
       IStorable() = default;
       ~IStorable() = default;
 
       virtual ls_std::byte_field load() = 0;
-      virtual void save(const ls_std::byte_field& _data) = 0;
+      virtual void save(const ls_std::byte_field &_data) = 0;
   };
 }
 

+ 6 - 4
include/ls_std/io/IWriter.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2020-11-20
+ * Changed:         2021-04-23
  *
  * */
 
@@ -13,14 +13,16 @@
 #include <vector>
 #include <ls_std/base/Types.hpp>
 
-namespace ls_std {
-  class IWriter {
+namespace ls_std
+{
+  class IWriter
+  {
     public:
 
       IWriter() = default;
       ~IWriter() = default;
 
-      virtual bool write(const ls_std::byte_field& _data) = 0;
+      virtual bool write(const ls_std::byte_field &_data) = 0;
   };
 }
 

+ 14 - 9
include/ls_std/io/NewLine.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-18
- * Changed:         2020-11-06
+ * Changed:         2021-04-23
  *
  * */
 
@@ -12,31 +12,36 @@
 
 #include <string>
 
-namespace ls_std {
-  class NewLine {
+namespace ls_std
+{
+  class NewLine
+  {
     public:
 
       NewLine() = default;
       ~NewLine() = default;
 
-      static std::string get() {
-        std::string newLine {};
+      static std::string get()
+      {
+        std::string newLine{};
 
         #if defined(unix) || defined(__APPLE__)
-          newLine = ls_std::NewLine::getUnixNewLine();
+        newLine = ls_std::NewLine::getUnixNewLine();
         #endif
         #ifdef _WIN32
-          newLine = ls_std::NewLine::getWindowsNewLine();
+        newLine = ls_std::NewLine::getWindowsNewLine();
         #endif
 
         return newLine;
       }
 
-      static std::string getUnixNewLine() {
+      static std::string getUnixNewLine()
+      {
         return "\n";
       }
 
-      static std::string getWindowsNewLine() {
+      static std::string getWindowsNewLine()
+      {
         return "\r\n";
       }
   };

+ 6 - 4
include/ls_std/io/StandardOutputWriter.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-06
- * Changed:         2020-11-06
+ * Changed:         2021-05-01
  *
  * */
 
@@ -12,14 +12,16 @@
 
 #include "IWriter.hpp"
 
-namespace ls_std {
-  class StandardOutputWriter : public IWriter {
+namespace ls_std
+{
+  class StandardOutputWriter : public ls_std::IWriter
+  {
     public:
 
       StandardOutputWriter() = default;
       ~StandardOutputWriter() = default;
 
-      bool write(const ls_std::byte_field& _data) override;
+      bool write(const ls_std::byte_field &_data) override;
   };
 }
 

+ 10 - 8
include/ls_std/io/StorableFile.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-19
- * Changed:         2020-11-06
+ * Changed:         2021-05-01
  *
  * */
 
@@ -15,23 +15,25 @@
 #include "IStorable.hpp"
 #include "File.hpp"
 
-namespace ls_std {
-  class StorableFile : public IStorable {
+namespace ls_std
+{
+  class StorableFile : public ls_std::IStorable
+  {
     public:
 
-      explicit StorableFile(const std::string& _path);
+      explicit StorableFile(const std::string &_path);
       ~StorableFile() = default;
 
       std::shared_ptr<ls_std::File> getFile();
       ls_std::byte_field load() override;
-      void reset(const std::string& _path);
-      void save(const ls_std::byte_field& _data) override;
+      void reset(const std::string &_path);
+      void save(const ls_std::byte_field &_data) override;
 
     private:
 
-      std::shared_ptr<ls_std::File> file {};
+      std::shared_ptr<ls_std::File> file{};
 
-      void _init(const std::string& _path);
+      void _init(const std::string &_path);
   };
 }
 

+ 0 - 39
include/ls_std/io/kv/KVDocument.hpp

@@ -1,39 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-12-25
- * Changed:         2020-12-25
- *
- * */
-
-#ifndef LS_STD_KV_DOCUMENT_HPP
-#define LS_STD_KV_DOCUMENT_HPP
-
-#include <ls_std/base/Class.hpp>
-#include "KVPair.hpp"
-#include "KVTypes.hpp"
-#include <map>
-
-namespace ls_std {
-  class KVDocument : public ls_std::Class {
-    public:
-
-      KVDocument();
-      ~KVDocument() override = default;
-
-      bool addPair(ls_std::KVPair _pair);
-      void clear();
-      std::map<ls_std::kv_key, ls_std::KVPair> getPairs();
-      bool hasPair(const ls_std::kv_key& _key);
-      void removePair(const ls_std::kv_key& _key);
-
-    private:
-
-      std::map<ls_std::kv_key, ls_std::KVPair> pairs {};
-
-      bool _hasPair(const ls_std::kv_key& _key);
-  };
-}
-
-#endif

+ 0 - 44
include/ls_std/io/kv/KVParser.hpp

@@ -1,44 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-12-25
- * Changed:         2020-12-25
- *
- * */
-
-#ifndef LS_STD_KV_PARSER_HPP
-#define LS_STD_KV_PARSER_HPP
-
-#include <ls_std/base/Class.hpp>
-#include <ls_std/base/Types.hpp>
-#include "KVDocument.hpp"
-#include "KVParseData.hpp"
-#include <memory>
-
-namespace ls_std {
-  class KVParser : public ls_std::Class {
-    public:
-
-      explicit KVParser(const std::shared_ptr<ls_std::KVDocument>& _document);
-      ~KVParser() override = default;
-
-      std::shared_ptr<ls_std::KVDocument> getDocument();
-      void parse(const ls_std::byte_field& _data);
-      void setDocument(const std::shared_ptr<ls_std::KVDocument>& _document);
-
-    private:
-
-      std::shared_ptr<ls_std::KVDocument> document {};
-
-      void _assignDocument(const std::shared_ptr<ls_std::KVDocument>& _document);
-      static bool _lineHasPair(ls_std::KVParseData _parseData);
-      void _parse(const ls_std::byte_field& _data);
-      void _parsePair(ls_std::KVParseData _parseData);
-      static ls_std::KVParseData _readLine(const ls_std::byte_field& _data, std::string::size_type _index);
-      static void _readLineWithUnixLineBreak(ls_std::KVParseData& _parseData);
-      static void _readLineWithWindowsLineBreak(ls_std::KVParseData& _parseData);
-  };
-}
-
-#endif

+ 0 - 46
include/ls_std/io/kv/KVReader.hpp

@@ -1,46 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-12-25
- * Changed:         2020-12-25
- *
- * */
-
-#ifndef LS_STD_KV_READER_HPP
-#define LS_STD_KV_READER_HPP
-
-#include <ls_std/base/Class.hpp>
-#include <ls_std/io/IReader.hpp>
-#include <ls_std/io/kv/KVDocument.hpp>
-#include <ls_std/io/File.hpp>
-#include <memory>
-
-namespace ls_std {
-  class KVReader : public ls_std::Class, public ls_std::IReader {
-    public:
-
-      explicit KVReader(const std::shared_ptr<ls_std::KVDocument>& _document, const std::string& _absolutePath);
-      ~KVReader() override = default;
-
-      // implementation
-
-      ls_std::byte_field read() override;
-
-      // additional functionality
-
-      std::shared_ptr<ls_std::KVDocument> getDocument();
-      void setDocument(const std::shared_ptr<ls_std::KVDocument>& _document);
-      void setFile(const ls_std::File& _kvFile);
-
-    private:
-
-      std::shared_ptr<ls_std::KVDocument> document {};
-      ls_std::File kvFile;
-
-      void _assignDocument(const std::shared_ptr<ls_std::KVDocument>& _document);
-      void _assignFile(ls_std::File _kvFile);
-  };
-}
-
-#endif

+ 41 - 0
include/ls_std/io/kv/KvDocument.hpp

@@ -0,0 +1,41 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-12-25
+ * Changed:         2021-07-15
+ *
+ * */
+
+#ifndef LS_STD_KV_DOCUMENT_HPP
+#define LS_STD_KV_DOCUMENT_HPP
+
+#include <ls_std/base/Class.hpp>
+#include "KvPair.hpp"
+#include "KvTypes.hpp"
+#include <map>
+
+namespace ls_std
+{
+  class KvDocument : public ls_std::Class
+  {
+    public:
+
+      KvDocument();
+      ~KvDocument() override = default;
+
+      bool addPair(ls_std::KvPair _pair);
+      void clear();
+      std::map<ls_std::kv_key, ls_std::KvPair> getPairs();
+      bool hasPair(const ls_std::kv_key &_key);
+      bool removePair(const ls_std::kv_key &_key);
+
+    private:
+
+      std::map<ls_std::kv_key, ls_std::KvPair> pairs{};
+
+      bool _hasPair(const ls_std::kv_key &_key);
+  };
+}
+
+#endif

+ 48 - 0
include/ls_std/io/kv/KvFileReader.hpp

@@ -0,0 +1,48 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-12-25
+ * Changed:         2021-07-15
+ *
+ * */
+
+#ifndef LS_STD_KV_FILE_READER_HPP
+#define LS_STD_KV_FILE_READER_HPP
+
+#include <ls_std/base/Class.hpp>
+#include <ls_std/io/IReader.hpp>
+#include <ls_std/io/kv/KvDocument.hpp>
+#include <ls_std/io/File.hpp>
+#include <memory>
+
+namespace ls_std
+{
+  class KvFileReader : public ls_std::Class, public ls_std::IReader
+  {
+    public:
+
+      explicit KvFileReader(const std::shared_ptr<ls_std::KvDocument> &_document, const std::string &_absolutePath);
+      ~KvFileReader() override = default;
+
+      // implementation
+
+      ls_std::byte_field read() override;
+
+      // additional functionality
+
+      std::shared_ptr<ls_std::KvDocument> getDocument();
+      void setDocument(const std::shared_ptr<ls_std::KvDocument> &_document);
+      void setFile(const ls_std::File &_kvFile);
+
+    private:
+
+      std::shared_ptr<ls_std::KvDocument> document{};
+      ls_std::File kvFile;
+
+      void _assignDocument(const std::shared_ptr<ls_std::KvDocument> &_document);
+      void _assignFile(ls_std::File _kvFile);
+  };
+}
+
+#endif

+ 12 - 10
include/ls_std/io/kv/KVPair.hpp → include/ls_std/io/kv/KvPair.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2020-12-25
+ * Changed:         2021-05-02
  *
  * */
 
@@ -11,25 +11,27 @@
 #define LS_STD_KV_PAIR_HPP
 
 #include <ls_std/base/Class.hpp>
-#include "KVTypes.hpp"
+#include "KvTypes.hpp"
 
-namespace ls_std {
-  class KVPair : public ls_std::Class {
+namespace ls_std
+{
+  class KvPair : public ls_std::Class
+  {
     public:
 
-      explicit KVPair(const ls_std::kv_key& _key, ls_std::kv_value _value);
-      ~KVPair() override = default;
+      explicit KvPair(const ls_std::kv_key &_key, ls_std::kv_value _value);
+      ~KvPair() override = default;
 
       ls_std::kv_key getKey();
       ls_std::kv_value getValue();
-      void setValue(const ls_std::kv_value& _value);
+      void setValue(const ls_std::kv_value &_value);
 
     private:
 
-      ls_std::kv_key key {};
-      ls_std::kv_value value {};
+      ls_std::kv_key key{};
+      ls_std::kv_value value{};
 
-      void _assignKey(const ls_std::kv_key& _key);
+      void _assignKey(const ls_std::kv_key &_key);
   };
 }
 

+ 7 - 5
include/ls_std/io/kv/KVParseData.hpp → include/ls_std/io/kv/KvParseParameter.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2020-12-25
+ * Changed:         2021-05-02
  *
  * */
 
@@ -13,10 +13,12 @@
 #include <string>
 #include <ls_std/boxing/String.hpp>
 
-namespace ls_std {
-  struct KVParseData {
-    std::string::size_type index {};
-    ls_std::String line {};
+namespace ls_std
+{
+  struct KvParseParameter
+  {
+    std::string::size_type index{};
+    ls_std::String line{};
   };
 }
 

+ 46 - 0
include/ls_std/io/kv/KvParser.hpp

@@ -0,0 +1,46 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-12-25
+ * Changed:         2021-05-02
+ *
+ * */
+
+#ifndef LS_STD_KV_PARSER_HPP
+#define LS_STD_KV_PARSER_HPP
+
+#include <ls_std/base/Class.hpp>
+#include <ls_std/base/Types.hpp>
+#include "KvDocument.hpp"
+#include "KvParseParameter.hpp"
+#include <memory>
+
+namespace ls_std
+{
+  class KvParser : public ls_std::Class
+  {
+    public:
+
+      explicit KvParser(const std::shared_ptr<ls_std::KvDocument> &_document);
+      ~KvParser() override = default;
+
+      std::shared_ptr<ls_std::KvDocument> getDocument();
+      void parse(const ls_std::byte_field &_data);
+      void setDocument(const std::shared_ptr<ls_std::KvDocument> &_document);
+
+    private:
+
+      std::shared_ptr<ls_std::KvDocument> document{};
+
+      void _assignDocument(const std::shared_ptr<ls_std::KvDocument> &_document);
+      static bool _lineHasPair(ls_std::KvParseParameter _parseParameter);
+      void _parse(const ls_std::byte_field &_data);
+      void _parsePair(ls_std::KvParseParameter _parseParameter);
+      static ls_std::KvParseParameter _readLine(const ls_std::byte_field &_data, std::string::size_type _index);
+      static void _readLineWithUnixLineBreak(ls_std::KvParseParameter &_parseParameter);
+      static void _readLineWithWindowsLineBreak(ls_std::KvParseParameter &_parseParameter);
+  };
+}
+
+#endif

+ 5 - 4
include/ls_std/io/kv/KVTypes.hpp → include/ls_std/io/kv/KvTypes.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2020-12-25
+ * Changed:         2021-04-23
  *
  * */
 
@@ -12,9 +12,10 @@
 
 #include <string>
 
-namespace ls_std {
-  using kv_key    = std::string;
-  using kv_value  = std::string;
+namespace ls_std
+{
+  using kv_key = std::string;
+  using kv_value = std::string;
 }
 
 #endif

+ 19 - 9
include/ls_std/io/logging/LogLevel.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2020-11-26
+ * Changed:         2021-05-02
  *
  * */
 
@@ -14,26 +14,36 @@
 #include <ls_std/base/Class.hpp>
 #include "LogLevelValue.hpp"
 
-namespace ls_std {
-  class LogLevel : public Class {
+namespace ls_std
+{
+  class LogLevel : public ls_std::Class
+  {
     public:
 
-      explicit LogLevel(const ls_std::LogLevelValue& _value);
+      explicit LogLevel(const ls_std::LogLevelValue &_value);
       LogLevel();
       ~LogLevel() override = default;
 
       operator unsigned char() const;
-      LogLevel& operator=(const ls_std::LogLevelValue& _value);
-      bool operator<=(const ls_std::LogLevelValue& _value);
-
+      ls_std::LogLevel &operator=(const ls_std::LogLevelValue &_value);
+      bool operator<(const ls_std::LogLevelValue &_value);
+      bool operator<=(const ls_std::LogLevelValue &_value);
+      bool operator>(const ls_std::LogLevelValue &_value);
+      bool operator>=(const ls_std::LogLevelValue &_value);
+      bool operator==(const ls_std::LogLevelValue &_value);
+
+      void setLogLevel(const ls_std::LogLevelValue &_value);
+      void setLogLevel(const std::string &_value);
       std::string toString() const;
 
     private:
 
-      std::unordered_map<uint8_t , std::string> level {};
-      ls_std::LogLevelValue value {};
+      std::unordered_map<uint8_t, std::string> level{};
+      ls_std::LogLevelValue value{};
 
+      ls_std::LogLevelValue _getValueFromString(const std::string &_value);
       void _init();
+      bool _isValidLogLevelString(const std::string &_value);
   };
 }
 

+ 6 - 10
include/ls_std/io/logging/LogLevelValue.hpp

@@ -3,22 +3,18 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2020-11-06
+ * Changed:         2021-05-02
  *
  * */
 
 #ifndef LS_STD_LOG_LEVEL_VALUE_HPP
 #define LS_STD_LOG_LEVEL_VALUE_HPP
 
-namespace ls_std {
-  enum LogLevelValue {
-    FATAL = 0,
-    ERR,
-    WARN,
-    INFO,
-    DEBUG,
-    TRACE,
-    OFF
+namespace ls_std
+{
+  enum LogLevelValue
+  {
+    FATAL = 0, ERR, WARN, INFO, DEBUG, TRACE
   };
 }
 

+ 17 - 14
include/ls_std/io/logging/Logger.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2020-11-26
+ * Changed:         2021-07-16
  *
  * */
 
@@ -17,28 +17,31 @@
 #include <ls_std/io/FileOutputStream.hpp>
 #include <string>
 
-namespace ls_std {
-  class Logger : public Class {
+namespace ls_std
+{
+  class Logger : public ls_std::Class
+  {
     public:
 
-      explicit Logger(const std::shared_ptr<ls_std::IWriter>& _writer);
+      explicit Logger(const std::shared_ptr<ls_std::IWriter> &_writer);
       ~Logger() override = default;
 
-      void debug(const ls_std::byte* _data);
-      void error(const ls_std::byte* _data);
-      void fatal(const ls_std::byte* _data);
+      void debug(const ls_std::byte *_data);
+      void error(const ls_std::byte *_data);
+      void fatal(const ls_std::byte *_data);
       ls_std::LogLevel getLogLevel();
-      void info(const ls_std::byte* _data);
-      void setLogLevel(const ls_std::LogLevelValue& _logLevelValue);
-      void trace(const ls_std::byte* _data);
-      void warn(const ls_std::byte* _data);
+      void info(const ls_std::byte *_data);
+      void setLogLevel(const ls_std::LogLevelValue &_logLevelValue);
+      void trace(const ls_std::byte *_data);
+      void warn(const ls_std::byte *_data);
 
     private:
 
-      ls_std::LogLevel logLevel {};
-      std::shared_ptr<ls_std::IWriter> writer {};
+      ls_std::LogLevel logLevel{};
+      std::shared_ptr<ls_std::IWriter> writer{};
 
-      void _log(const ls_std::byte* _data, const ls_std::LogLevel& _logLevel);
+      void _assignWriter(const std::shared_ptr<ls_std::IWriter> &_writer);
+      void _log(const ls_std::byte *_data, const ls_std::LogLevel &_logLevel);
   };
 }
 

+ 0 - 36
include/ls_std/io/xml/XMLAttribute.hpp

@@ -1,36 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-09-23
- * Changed:         2020-11-26
- *
- * */
-
-#ifndef LS_STD_XML_ATTRIBUTE_HPP
-#define LS_STD_XML_ATTRIBUTE_HPP
-
-#include <ls_std/base/Class.hpp>
-#include <string>
-
-namespace ls_std {
-  class XMLAttribute : public Class {
-    public:
-
-      explicit XMLAttribute(std::string _name);
-      ~XMLAttribute() override = default;
-
-      std::string getName();
-      std::string getValue();
-      void setName(std::string _name);
-      void setValue(std::string _value);
-      std::string toXML();
-
-    private:
-
-      std::string name {};
-      std::string value {};
-  };
-}
-
-#endif

+ 0 - 41
include/ls_std/io/xml/XMLDeclaration.hpp

@@ -1,41 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-09-27
- * Changed:         2020-11-26
- *
- * */
-
-#ifndef LS_STD_XML_DECLARATION_HPP
-#define LS_STD_XML_DECLARATION_HPP
-
-#include <ls_std/base/Class.hpp>
-#include "XMLAttribute.hpp"
-
-namespace ls_std {
-  class XMLDeclaration : public Class {
-    public:
-
-      explicit XMLDeclaration(std::string _version);
-      ~XMLDeclaration() override = default;
-
-      std::string getEncoding();
-      std::string getStandalone();
-      std::string getVersion();
-      void setEncoding(std::string _encoding);
-      void setStandalone(std::string _standalone);
-      void setVersion(std::string _version);
-      std::string toXML();
-
-    private:
-
-      ls_std::XMLAttribute encoding {"encoding"};
-      ls_std::XMLAttribute standalone {"standalone"};
-      ls_std::XMLAttribute version {"version"};
-
-      static std::string _toXMLAttribute(ls_std::XMLAttribute _attribute);
-  };
-}
-
-#endif

+ 0 - 38
include/ls_std/io/xml/XMLDocument.hpp

@@ -1,38 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-09-27
- * Changed:         2020-11-26
- *
- * */
-
-#ifndef LS_STD_XML_DOCUMENT_HPP
-#define LS_STD_XML_DOCUMENT_HPP
-
-#include <memory>
-#include <ls_std/base/Class.hpp>
-#include "XMLNode.hpp"
-#include "XMLDeclaration.hpp"
-
-namespace ls_std {
-  class XMLDocument : public Class {
-    public:
-
-      XMLDocument();
-      ~XMLDocument() override = default;
-
-      std::shared_ptr<ls_std::XMLDeclaration> getDeclaration();
-      std::shared_ptr<ls_std::XMLNode> getRootElement();
-      void setDeclaration(const std::shared_ptr<ls_std::XMLDeclaration>& _declaration);
-      void setRootElement(const std::shared_ptr<ls_std::XMLNode>& _root);
-      std::string toXML();
-
-    private:
-
-      std::shared_ptr<ls_std::XMLDeclaration> declaration {};
-      std::shared_ptr<ls_std::XMLNode> rootElement {};
-  };
-}
-
-#endif

+ 0 - 75
include/ls_std/io/xml/XMLNode.hpp

@@ -1,75 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-09-24
- * Changed:         2020-11-26
- *
- * */
-
-#ifndef LS_STD_XML_NODE_HPP
-#define LS_STD_XML_NODE_HPP
-
-#include <list>
-#include <memory>
-#include <ls_std/base/Class.hpp>
-#include "XMLAttribute.hpp"
-
-namespace ls_std {
-  class XMLNode : public Class {
-    public:
-
-      explicit XMLNode(std::string _name);
-      ~XMLNode() override = default;
-
-      bool addAttributeAfter(const std::shared_ptr<ls_std::XMLAttribute>& _attribute, const std::string& _name);
-      bool addAttributeBefore(const std::shared_ptr<ls_std::XMLAttribute>& _attribute, const std::string& _name);
-      bool addAttributeToBeginning(const std::shared_ptr<ls_std::XMLAttribute>& _attribute);
-      bool addAttributeToEnd(const std::shared_ptr<ls_std::XMLAttribute>& _attribute);
-      bool addChildAfter(const std::shared_ptr<ls_std::XMLNode>& _child, const std::shared_ptr<ls_std::XMLNode>& _search);
-      bool addChildBefore(const std::shared_ptr<ls_std::XMLNode>& _child, const std::shared_ptr<ls_std::XMLNode>& _search);
-      bool addChildToBeginning(const std::shared_ptr<ls_std::XMLNode>& _child);
-      bool addChildToEnd(const std::shared_ptr<ls_std::XMLNode>& _child);
-      void clearValue();
-      std::list<std::shared_ptr<ls_std::XMLAttribute>> getAttributes();
-      std::list<std::shared_ptr<ls_std::XMLNode>> getChildren();
-      std::list<std::shared_ptr<ls_std::XMLNode>> getChildren(const std::string& _name);
-      std::string getName();
-      std::string getValue();
-      bool hasAttribute(const std::string& _name);
-      bool hasChild(const std::string& _name);
-      bool hasChild(const std::shared_ptr<ls_std::XMLNode>& _child);
-      void removeFirstAttribute();
-      void removeLastAttribute();
-      void removeFirstChild();
-      void removeLastChild();
-      void setName(std::string _name);
-      void setValue(std::string _value);
-      std::string toXML();
-
-    protected:
-
-      std::string _toXML_(uint8_t _tabSize);
-
-    private:
-
-      std::list<std::shared_ptr<ls_std::XMLAttribute>> attributes {};
-      std::list<std::shared_ptr<ls_std::XMLNode>> children {};
-      std::string name {};
-      const static uint8_t TAB_SIZE {4};
-      std::string value {};
-
-      static std::string _getTab(uint8_t _tabSize);
-      bool _hasAttribute(const std::string& _name);
-      bool _hasChild(const std::shared_ptr<ls_std::XMLNode>& _child);
-      bool _hasChild(const std::string& _name);
-      std::string _toXMLAttributes();
-      std::string _toXMLChildren(uint8_t _tabSize);
-      std::string _toXMLCloseTag();
-      std::string _toXMLOpenTag();
-      std::string _toXMLOpenTagClose();
-      std::string _toXMLValue();
-  };
-}
-
-#endif

+ 0 - 71
include/ls_std/io/xml/XMLParser.hpp

@@ -1,71 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-11-25
- * Changed:         2020-11-26
- *
- * */
-
-#ifndef LS_STD_XML_PARSER_HPP
-#define LS_STD_XML_PARSER_HPP
-
-#include <ls_std/base/Class.hpp>
-#include <ls_std/base/Types.hpp>
-#include "XMLDocument.hpp"
-#include "XMLParseMode.hpp"
-#include "XMLParseData.hpp"
-#include <list>
-
-namespace ls_std {
-  class XMLParser : public Class {
-    public:
-
-      explicit XMLParser(const std::shared_ptr<ls_std::XMLDocument>& _document);
-      ~XMLParser() override = default;
-
-      std::shared_ptr<ls_std::XMLDocument> getDocument();
-      void parse(const ls_std::byte_field& _data);
-      void setDocument(const std::shared_ptr<ls_std::XMLDocument>& _document);
-
-    protected:
-
-      static std::pair<std::string, std::string> _readAttribute_(const ls_std::byte_field& _data);
-      static std::list<std::pair<std::string, std::string>> _readAttributes_(ls_std::byte_field _data);
-
-    private:
-
-      uint8_t currentLevel {};
-      std::shared_ptr<ls_std::XMLDocument> document {};
-      uint8_t maxLevel {};
-      ls_std::XMLParseMode mode {};
-      std::list<ls_std::XMLParseData> parseData {};
-
-      void _analyze(const ls_std::byte_field &_data, std::string::size_type _index);
-      void _assignDocument(const std::shared_ptr<ls_std::XMLDocument>& _document);
-      static std::shared_ptr<ls_std::XMLDeclaration> _createDeclaration(const std::list<std::pair<std::string, std::string>>& _attributes);
-      static std::shared_ptr<ls_std::XMLNode> _createNode(const std::list<std::pair<std::string, std::string>>& _attributes, const std::string& _name);
-      static std::pair<std::string, std::string> _findAttribute(const std::list<std::pair<std::string, std::string>>& _attributes, const std::string& _name);
-      static size_t _findAttributeEndPosition(const ls_std::byte_field& _data);
-      static ls_std::byte_field _getNextTagString(const ls_std::byte_field& _data, std::string::size_type _index);
-      void _isClosingTag(const ls_std::byte_field& _data, std::string::size_type _index);
-      void _isDeclaration(const ls_std::byte_field& _data, std::string::size_type _index);
-      void _isOpeningTag(const ls_std::byte_field& _data, std::string::size_type _index);
-      void _isValue(const ls_std::byte_field& _data, std::string::size_type _index);
-      void _mergeNodes();
-      void _mergeChildrenToParentNode(const std::shared_ptr<ls_std::XMLNode>& _parent, std::list<ls_std::XMLParseData>::iterator& _iterator, uint8_t _parentLevel);
-      void _mergeNodesOnCurrentLevel();
-      void _parse(const ls_std::byte_field& _data);
-      static std::pair<std::string, std::string> _parseAttribute(const ls_std::byte_field& _data);
-      static std::list<std::pair<std::string, std::string>> _parseAttributes(ls_std::byte_field _data);
-      size_t _parseClosingTag(const ls_std::byte_field& _data, std::string::size_type _index);
-      size_t _parseDeclaration(const ls_std::byte_field& _data, std::string::size_type _index);
-      size_t _parseOpeningTag(const ls_std::byte_field& _data, std::string::size_type _index);
-      static ls_std::byte_field _parseTagName(const ls_std::byte_field& _data);
-      size_t _parseValue(const ls_std::byte_field& _data, std::string::size_type _index);
-      void _reset();
-      void _setMaxLevel();
-  };
-}
-
-#endif

+ 0 - 48
include/ls_std/io/xml/XMLReader.hpp

@@ -1,48 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-10-08
- * Changed:         2020-11-26
- *
- * */
-
-#ifndef LS_STD_XML_READER_HPP
-#define LS_STD_XML_READER_HPP
-
-#include <ls_std/base/Class.hpp>
-#include "XMLDocument.hpp"
-#include <ls_std/io/IReader.hpp>
-#include <ls_std/io/File.hpp>
-#include "XMLParseMode.hpp"
-#include "XMLParseData.hpp"
-#include <list>
-
-namespace ls_std {
-  class XMLReader : public Class, public IReader {
-    public:
-
-      explicit XMLReader(const std::shared_ptr<ls_std::XMLDocument>& _document, const std::string& _absolutePath);
-      ~XMLReader() override = default;
-
-      // implementation
-
-      ls_std::byte_field read() override;
-
-      // additional functionality
-
-      std::shared_ptr<ls_std::XMLDocument> getDocument();
-      void setDocument(const std::shared_ptr<ls_std::XMLDocument>& _document);
-      void setFile(const ls_std::File& _xmlFile);
-
-    private:
-
-      std::shared_ptr<ls_std::XMLDocument> document {};
-      ls_std::File xmlFile;
-
-      void _assignDocument(const std::shared_ptr<ls_std::XMLDocument>& _document);
-      void _assignFile(ls_std::File _xmlFile);
-  };
-}
-
-#endif

+ 41 - 0
include/ls_std/io/xml/XmlAttribute.hpp

@@ -0,0 +1,41 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-09-23
+ * Changed:         2021-07-16
+ *
+ * */
+
+#ifndef LS_STD_XML_ATTRIBUTE_HPP
+#define LS_STD_XML_ATTRIBUTE_HPP
+
+#include <ls_std/base/Class.hpp>
+#include <string>
+
+namespace ls_std
+{
+  class XmlAttribute : public ls_std::Class
+  {
+    public:
+
+      explicit XmlAttribute(const std::string& _name);
+      ~XmlAttribute() override = default;
+
+      std::string getName();
+      std::string getValue();
+      void setName(const std::string& _name);
+      void setValue(const std::string& _value);
+      std::string toXml();
+
+    private:
+
+      std::string name{};
+      std::string value{};
+
+      void _assignName(const std::string& _name);
+      void _assignValue(const std::string& _value);
+  };
+}
+
+#endif

+ 43 - 0
include/ls_std/io/xml/XmlDeclaration.hpp

@@ -0,0 +1,43 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-09-27
+ * Changed:         2021-07-16
+ *
+ * */
+
+#ifndef LS_STD_XML_DECLARATION_HPP
+#define LS_STD_XML_DECLARATION_HPP
+
+#include <ls_std/base/Class.hpp>
+#include "XmlAttribute.hpp"
+
+namespace ls_std
+{
+  class XmlDeclaration : public ls_std::Class
+  {
+    public:
+
+      explicit XmlDeclaration(const std::string& _version);
+      ~XmlDeclaration() override = default;
+
+      std::string getEncoding();
+      std::string getStandalone();
+      std::string getVersion();
+      void setEncoding(const std::string& _encoding);
+      void setStandalone(const std::string& _standalone);
+      void setVersion(const std::string& _version);
+      std::string toXml();
+
+    private:
+
+      ls_std::XmlAttribute encoding{"encoding"};
+      ls_std::XmlAttribute standalone{"standalone"};
+      ls_std::XmlAttribute version{"version"};
+
+      static std::string _toXmlAttribute(ls_std::XmlAttribute _attribute);
+  };
+}
+
+#endif

+ 43 - 0
include/ls_std/io/xml/XmlDocument.hpp

@@ -0,0 +1,43 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-09-27
+ * Changed:         2021-07-16
+ *
+ * */
+
+#ifndef LS_STD_XML_DOCUMENT_HPP
+#define LS_STD_XML_DOCUMENT_HPP
+
+#include <memory>
+#include <ls_std/base/Class.hpp>
+#include "XmlNode.hpp"
+#include "XmlDeclaration.hpp"
+
+namespace ls_std
+{
+  class XmlDocument : public ls_std::Class
+  {
+    public:
+
+      XmlDocument();
+      ~XmlDocument() override = default;
+
+      std::shared_ptr<ls_std::XmlDeclaration> getDeclaration();
+      std::shared_ptr<ls_std::XmlNode> getRootElement();
+      void setDeclaration(const std::shared_ptr<ls_std::XmlDeclaration> &_declaration);
+      void setRootElement(const std::shared_ptr<ls_std::XmlNode> &_rootElement);
+      std::string toXml();
+
+    private:
+
+      std::shared_ptr<ls_std::XmlDeclaration> declaration{};
+      std::shared_ptr<ls_std::XmlNode> rootElement{};
+
+      void _assignDeclaration(const std::shared_ptr<ls_std::XmlDeclaration> &_declaration);
+      void _assignRootElement(const std::shared_ptr<ls_std::XmlNode> &_rootElement);
+  };
+}
+
+#endif

+ 82 - 0
include/ls_std/io/xml/XmlNode.hpp

@@ -0,0 +1,82 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-09-24
+ * Changed:         2021-07-16
+ *
+ * */
+
+#ifndef LS_STD_XML_NODE_HPP
+#define LS_STD_XML_NODE_HPP
+
+#include <list>
+#include <memory>
+#include <ls_std/base/Class.hpp>
+#include "XmlAttribute.hpp"
+
+namespace ls_std
+{
+  class XmlNode : public ls_std::Class
+  {
+    public:
+
+      explicit XmlNode(std::string _name);
+      ~XmlNode() override = default;
+
+      bool addAttributeAfter(const std::shared_ptr<ls_std::XmlAttribute> &_attribute, const std::string &_name);
+      bool addAttributeBefore(const std::shared_ptr<ls_std::XmlAttribute> &_attribute, const std::string &_name);
+      bool addAttributeToBeginning(const std::shared_ptr<ls_std::XmlAttribute> &_attribute);
+      bool addAttributeToEnd(const std::shared_ptr<ls_std::XmlAttribute> &_attribute);
+      bool addChildAfter(const std::shared_ptr<ls_std::XmlNode> &_child, const std::shared_ptr<ls_std::XmlNode> &_search);
+      bool addChildBefore(const std::shared_ptr<ls_std::XmlNode> &_child, const std::shared_ptr<ls_std::XmlNode> &_search);
+      bool addChildToBeginning(const std::shared_ptr<ls_std::XmlNode> &_child);
+      bool addChildToEnd(const std::shared_ptr<ls_std::XmlNode> &_child);
+      void clearValue();
+      std::list<std::shared_ptr<ls_std::XmlAttribute>> getAttributes();
+      std::list<std::shared_ptr<ls_std::XmlNode>> getChildren();
+      std::list<std::shared_ptr<ls_std::XmlNode>> getChildren(const std::string &_name);
+      std::string getName();
+      std::string getValue();
+      bool hasAttribute(const std::string &_name);
+      bool hasChild(const std::string &_name);
+      bool hasChild(const std::shared_ptr<ls_std::XmlNode> &_child);
+      bool removeFirstAttribute();
+      bool removeLastAttribute();
+      bool removeFirstChild();
+      bool removeLastChild();
+      void setName(const std::string &_name);
+      void setValue(const std::string &_value);
+      std::string toXml();
+
+    protected:
+
+      std::string _toXml_(uint8_t _tabSize);
+
+    private:
+
+      std::list<std::shared_ptr<ls_std::XmlAttribute>> attributes{};
+      std::list<std::shared_ptr<ls_std::XmlNode>> children{};
+      std::string name{};
+      const static uint8_t TAB_SIZE{4};
+      std::string value{};
+
+      void _assignName(const std::string &_name);
+      void _assignValue(const std::string &_value);
+      static void _checkIfAttributeReferenceIsValid(const std::shared_ptr<ls_std::XmlAttribute> &_attribute);
+      static void _checkIfNameIsNotEmpty(const std::string &_name);
+      static void _checkIfNodeReferenceIsValid(const std::shared_ptr<ls_std::XmlNode> &_child);
+      static std::string _getTab(uint8_t _tabSize);
+      bool _hasAttribute(const std::string &_name);
+      bool _hasChild(const std::shared_ptr<ls_std::XmlNode> &_child);
+      bool _hasChild(const std::string &_name);
+      std::string _toXmlAttributes();
+      std::string _toXmlChildren(uint8_t _tabSize);
+      std::string _toXmlCloseTag();
+      std::string _toXmlOpenTag();
+      std::string _toXmlOpenTagClose();
+      std::string _toXmlValue();
+  };
+}
+
+#endif

+ 6 - 8
include/ls_std/io/xml/XMLParseMode.hpp → include/ls_std/io/xml/XmlParseMode.hpp

@@ -3,20 +3,18 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-13
- * Changed:         2020-11-06
+ * Changed:         2021-05-02
  *
  * */
 
 #ifndef LS_STD_XML_PARSE_MODE_HPP
 #define LS_STD_XML_PARSE_MODE_HPP
 
-namespace ls_std {
-  enum XMLParseMode {
-    XML_PARSE_MODE_ANALYZE = 0,
-    XML_PARSE_MODE_DECLARATION,
-    XML_PARSE_MODE_OPENING_TAG,
-    XML_PARSE_MODE_VALUE,
-    XML_PARSE_MODE_CLOSING_TAG
+namespace ls_std
+{
+  enum XmlParseMode
+  {
+    XML_PARSE_MODE_ANALYZE = 0, XML_PARSE_MODE_DECLARATION, XML_PARSE_MODE_OPENING_TAG, XML_PARSE_MODE_VALUE, XML_PARSE_MODE_CLOSING_TAG
   };
 }
 

+ 8 - 6
include/ls_std/io/xml/XMLParseData.hpp → include/ls_std/io/xml/XmlParseParameter.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-17
- * Changed:         2020-11-06
+ * Changed:         2021-05-02
  *
  * */
 
@@ -12,12 +12,14 @@
 
 #include <cstdint>
 #include <memory>
-#include "XMLNode.hpp"
+#include "XmlNode.hpp"
 
-namespace ls_std {
-  struct XMLParseData {
-    uint8_t level {};
-    std::shared_ptr<ls_std::XMLNode> node {};
+namespace ls_std
+{
+  struct XmlParseParameter
+  {
+    uint8_t level{};
+    std::shared_ptr<ls_std::XmlNode> node{};
   };
 }
 

+ 73 - 0
include/ls_std/io/xml/XmlParser.hpp

@@ -0,0 +1,73 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-11-25
+ * Changed:         2021-05-02
+ *
+ * */
+
+#ifndef LS_STD_XML_PARSER_HPP
+#define LS_STD_XML_PARSER_HPP
+
+#include <ls_std/base/Class.hpp>
+#include <ls_std/base/Types.hpp>
+#include "XmlDocument.hpp"
+#include "XmlParseMode.hpp"
+#include "XmlParseParameter.hpp"
+#include <list>
+
+namespace ls_std
+{
+  class XmlParser : public ls_std::Class
+  {
+    public:
+
+      explicit XmlParser(const std::shared_ptr<ls_std::XmlDocument> &_document);
+      ~XmlParser() override = default;
+
+      std::shared_ptr<ls_std::XmlDocument> getDocument();
+      void parse(const ls_std::byte_field &_data);
+      void setDocument(const std::shared_ptr<ls_std::XmlDocument> &_document);
+
+    protected:
+
+      static std::pair<std::string, std::string> _readAttribute_(const ls_std::byte_field &_data);
+      static std::list<std::pair<std::string, std::string>> _readAttributes_(ls_std::byte_field _data);
+
+    private:
+
+      uint8_t currentLevel{};
+      std::shared_ptr<ls_std::XmlDocument> document{};
+      uint8_t maxLevel{};
+      ls_std::XmlParseMode mode{};
+      std::list<ls_std::XmlParseParameter> parseParameters{};
+
+      void _analyze(const ls_std::byte_field &_data, std::string::size_type _index);
+      void _assignDocument(const std::shared_ptr<ls_std::XmlDocument> &_document);
+      static std::shared_ptr<ls_std::XmlDeclaration> _createDeclaration(const std::list<std::pair<std::string, std::string>> &_attributes);
+      static std::shared_ptr<ls_std::XmlNode> _createNode(const std::list<std::pair<std::string, std::string>> &_attributes, const std::string &_name);
+      static std::pair<std::string, std::string> _findAttribute(const std::list<std::pair<std::string, std::string>> &_attributes, const std::string &_name);
+      static size_t _findAttributeEndPosition(const ls_std::byte_field &_data);
+      static ls_std::byte_field _getNextTagString(const ls_std::byte_field &_data, std::string::size_type _index);
+      void _isClosingTag(const ls_std::byte_field &_data, std::string::size_type _index);
+      void _isDeclaration(const ls_std::byte_field &_data, std::string::size_type _index);
+      void _isOpeningTag(const ls_std::byte_field &_data, std::string::size_type _index);
+      void _isValue(const ls_std::byte_field &_data, std::string::size_type _index);
+      void _mergeNodes();
+      void _mergeChildrenToParentNode(const std::shared_ptr<ls_std::XmlNode> &_parent, std::list<ls_std::XmlParseParameter>::iterator &_iterator, uint8_t _parentLevel);
+      void _mergeNodesOnCurrentLevel();
+      void _parse(const ls_std::byte_field &_data);
+      static std::pair<std::string, std::string> _parseAttribute(const ls_std::byte_field &_data);
+      static std::list<std::pair<std::string, std::string>> _parseAttributes(ls_std::byte_field _data);
+      size_t _parseClosingTag(const ls_std::byte_field &_data, std::string::size_type _index);
+      size_t _parseDeclaration(const ls_std::byte_field &_data, std::string::size_type _index);
+      size_t _parseOpeningTag(const ls_std::byte_field &_data, std::string::size_type _index);
+      static ls_std::byte_field _parseTagName(const ls_std::byte_field &_data);
+      size_t _parseValue(const ls_std::byte_field &_data, std::string::size_type _index);
+      void _reset();
+      void _setMaxLevel();
+  };
+}
+
+#endif

+ 50 - 0
include/ls_std/io/xml/XmlReader.hpp

@@ -0,0 +1,50 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-10-08
+ * Changed:         2021-05-02
+ *
+ * */
+
+#ifndef LS_STD_XML_READER_HPP
+#define LS_STD_XML_READER_HPP
+
+#include <ls_std/base/Class.hpp>
+#include "XmlDocument.hpp"
+#include <ls_std/io/IReader.hpp>
+#include <ls_std/io/File.hpp>
+#include "XmlParseMode.hpp"
+#include "XmlParseParameter.hpp"
+#include <list>
+
+namespace ls_std
+{
+  class XmlReader : public ls_std::Class, public ls_std::IReader
+  {
+    public:
+
+      explicit XmlReader(const std::shared_ptr<ls_std::XmlDocument> &_document, const std::string &_absolutePath);
+      ~XmlReader() override = default;
+
+      // implementation
+
+      ls_std::byte_field read() override;
+
+      // additional functionality
+
+      std::shared_ptr<ls_std::XmlDocument> getDocument();
+      void setDocument(const std::shared_ptr<ls_std::XmlDocument> &_document);
+      void setFile(const ls_std::File &_xmlFile);
+
+    private:
+
+      std::shared_ptr<ls_std::XmlDocument> document{};
+      ls_std::File xmlFile;
+
+      void _assignDocument(const std::shared_ptr<ls_std::XmlDocument> &_document);
+      void _assignFile(ls_std::File _xmlFile);
+  };
+}
+
+#endif

+ 8 - 6
include/ls_std/logic/IListener.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-14
- * Changed:         2020-11-29
+ * Changed:         2021-05-02
  *
  * */
 
@@ -12,14 +12,16 @@
 
 #include <ls_std/base/Class.hpp>
 
-namespace ls_std {
-  class IListener : public Class {
+namespace ls_std
+{
+  class IListener
+  {
     public:
 
-      IListener();
-      ~IListener() override = default;
+      IListener() = default;
+      ~IListener() = default;
 
-      virtual void listen(const ls_std::Class& _info) = 0;
+      virtual void listen(const ls_std::Class &_info) = 0;
   };
 }
 

+ 9 - 7
include/ls_std/logic/Narrator.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-14
- * Changed:         2020-11-28
+ * Changed:         2021-05-27
  *
  * */
 
@@ -15,22 +15,24 @@
 #include <list>
 #include <memory>
 
-namespace ls_std {
-  class Narrator : public Class {
+namespace ls_std
+{
+  class Narrator : public ls_std::Class
+  {
     public:
 
       Narrator();
       ~Narrator() override = default;
 
-      void addListener(const std::shared_ptr<ls_std::IListener>& _listener);
+      bool addListener(const std::shared_ptr<ls_std::IListener> &_listener);
       void clear();
       std::list<std::shared_ptr<ls_std::IListener>> getListeners();
-      void removeListener(const std::shared_ptr<ls_std::IListener>& _listener);
-      void tell(const ls_std::Class& _info);
+      bool removeListener(const std::shared_ptr<ls_std::IListener> &_listener);
+      void tell(const ls_std::Class &_info);
 
     private:
 
-      std::list<std::shared_ptr<ls_std::IListener>> listeners {};
+      std::list<std::shared_ptr<ls_std::IListener>> listeners{};
   };
 }
 

+ 17 - 11
include/ls_std/logic/State.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-05
- * Changed:         2020-11-26
+ * Changed:         2021-07-14
  *
  * */
 
@@ -15,29 +15,35 @@
 #include <ls_std/base/Class.hpp>
 #include "StateMachineTypes.hpp"
 #include "StateConnection.hpp"
+#include <ls_std/serialization/ISerializable.hpp>
 
-namespace ls_std {
-  class State : public ls_std::Class {
+namespace ls_std
+{
+  class State : public ls_std::Class
+  {
     public:
 
-      explicit State(ls_std::StateId _id);
+      explicit State(const ls_std::StateId& _id);
       ~State() override = default;
 
-      bool addStateConnection(const ls_std::StateConnectionId& _connectionId, const std::shared_ptr<ls_std::State>& _connectedState);
-      bool addStateConnection(const std::shared_ptr<ls_std::StateConnection>& _connection);
+      // additional functionality
+
+      bool addStateConnection(const ls_std::StateConnectionId &_connectionId, const std::shared_ptr<ls_std::State> &_connectedState);
+      bool addStateConnection(const std::shared_ptr<ls_std::StateConnection> &_connection);
       void clearConnections();
       std::unordered_map<ls_std::StateConnectionId, std::shared_ptr<ls_std::StateConnection>> getConnectedStates();
       ls_std::StateId getId();
-      bool hasConnection(const ls_std::StateConnectionId& _connectionId);
-      void setId(ls_std::StateId _id);
+      bool hasConnection(const ls_std::StateConnectionId &_connectionId);
+      void setId(const ls_std::StateId& _id);
 
     private:
 
-      std::unordered_map<ls_std::StateConnectionId, std::shared_ptr<ls_std::StateConnection>> connectedStates {};
-      ls_std::StateId id {};
+      std::unordered_map<ls_std::StateConnectionId, std::shared_ptr<ls_std::StateConnection>> connectedStates{};
+      ls_std::StateId id{};
 
+      void _assignStateId(const ls_std::StateId& _id);
       void _clearConnections();
-      bool _hasConnection(const ls_std::StateConnectionId& _connectionId);
+      bool _hasConnection(const ls_std::StateConnectionId &_connectionId);
   };
 }
 

+ 14 - 9
include/ls_std/logic/StateConnection.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-10
- * Changed:         2020-11-26
+ * Changed:         2021-05-27
  *
  * */
 
@@ -14,25 +14,30 @@
 #include <ls_std/base/Class.hpp>
 #include "StateMachineTypes.hpp"
 
-namespace ls_std {
-  class StateConnection : public Class {
+namespace ls_std
+{
+  class StateConnection : public ls_std::Class
+  {
     public:
 
-      explicit StateConnection(ls_std::StateConnectionId _connectionId, ls_std::StateId _stateId);
+      explicit StateConnection(const ls_std::StateConnectionId& _connectionId, const ls_std::StateId& _stateId);
       ~StateConnection() override = default;
 
       StateConnectionId getConnectionId();
       ls_std::StateId getStateId();
       bool isPassable() const;
-      void setConnectionId(ls_std::StateConnectionId _connectionId);
-      void setStateId(ls_std::StateId _stateId);
+      void setConnectionId(const ls_std::StateConnectionId& _connectionId);
+      void setStateId(const ls_std::StateId& _stateId);
       void updatePassCondition(bool _condition);
 
     private:
 
-      bool condition {};
-      ls_std::StateConnectionId connectionId {};
-      ls_std::StateId stateId {};
+      bool condition{};
+      ls_std::StateConnectionId connectionId{};
+      ls_std::StateId stateId{};
+
+      void _assignConnectionId(const ls_std::StateConnectionId& _connectionId);
+      void _assignStateId(const ls_std::StateId& _stateId);
   };
 }
 

+ 19 - 15
include/ls_std/logic/StateMachine.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-05
- * Changed:         2020-11-26
+ * Changed:         2021-05-01
  *
  * */
 
@@ -18,34 +18,38 @@
 #include "State.hpp"
 #include "StateMachineTypes.hpp"
 
-namespace ls_std {
-  class StateMachine : public Class {
+namespace ls_std
+{
+  class StateMachine : public ls_std::Class
+  {
     public:
 
-      explicit StateMachine(std::string _name);
+      explicit StateMachine(const std::string& _name);
       ~StateMachine() override = default;
 
-      bool addState(const std::shared_ptr<ls_std::State>& _state);
+      bool addState(const std::shared_ptr<ls_std::State> &_state);
       std::shared_ptr<ls_std::State> getCurrentState();
       std::vector<ls_std::StateId> getMemory();
       std::string getName();
       std::unordered_map<StateId, std::shared_ptr<ls_std::State>> getStates();
-      bool hasState(const ls_std::StateId& _id);
+      bool hasState(const ls_std::StateId &_id);
       bool proceed();
-      void setMemory(std::vector<ls_std::StateId> _memory);
-      void setName(std::string _name);
-      bool setStartState(const ls_std::StateId& _id);
+      void setMemory(const std::vector<ls_std::StateId>& _memory);
+      void setName(const std::string& _name);
+      bool setStartState(const ls_std::StateId &_id);
 
     private:
 
-      std::shared_ptr<State> currentState {};
-      std::vector<ls_std::StateId> memory {};
-      std::string name {};
-      std::unordered_map<ls_std::StateId, std::shared_ptr<ls_std::State>> states {};
+      std::shared_ptr<State> currentState{};
+      std::vector<ls_std::StateId> memory{};
+      std::string name{};
+      std::unordered_map<ls_std::StateId, std::shared_ptr<ls_std::State>> states{};
 
+      void _assignMemory(const std::vector<ls_std::StateId>& _memory);
+      void _assignName(const std::string& _name);
       std::vector<ls_std::StateId> _getNextValidStates();
-      void _remember(const ls_std::StateId& _id);
-      bool _hasState(const ls_std::StateId& _id);
+      void _remember(const ls_std::StateId &_id);
+      bool _hasState(const ls_std::StateId &_id);
   };
 }
 

+ 3 - 2
include/ls_std/logic/StateMachineTypes.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-10
- * Changed:         2020-11-06
+ * Changed:         2021-04-23
  *
  * */
 
@@ -12,7 +12,8 @@
 
 #include <string>
 
-namespace ls_std {
+namespace ls_std
+{
   using StateConnectionId = std::string;
   using StateId = std::string;
 }

+ 26 - 23
include/ls_std/ls_std.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-29
- * Changed:         2020-12-25
+ * Changed:         2021-09-18
  *
  * */
 
@@ -17,6 +17,7 @@
 #include "base/Class.hpp"
 #include "base/Types.hpp"
 #include "base/Version.hpp"
+#include "base/LibraryVersion.hpp"
 
 #include "boxing/IBoxing.hpp"
 #include "boxing/Boolean.hpp"
@@ -26,22 +27,26 @@
 #include "boxing/Long.hpp"
 #include "boxing/String.hpp"
 
+#include "exception/EventNotHandledException.hpp"
+#include "exception/EventNotSubscribedException.hpp"
 #include "exception/FileNotFoundException.hpp"
 #include "exception/FileOperationException.hpp"
 #include "exception/IllegalArgumentException.hpp"
 #include "exception/IllegalArithmeticOperationException.hpp"
+#include "exception/IncompleteJsonException.hpp"
+#include "exception/NullPointerException.hpp"
 
 #include "io/logging/LogLevel.hpp"
 #include "io/logging/LogLevelValue.hpp"
 #include "io/logging/Logger.hpp"
-#include "io/xml/XMLReader.hpp"
-#include "io/xml/XMLParseMode.hpp"
-#include "io/xml/XMLParseData.hpp"
-#include "io/xml/XMLNode.hpp"
-#include "io/xml/XMLDocument.hpp"
-#include "io/xml/XMLDeclaration.hpp"
-#include "io/xml/XMLAttribute.hpp"
-#include "io/xml/XMLParser.hpp"
+#include "io/xml/XmlReader.hpp"
+#include "io/xml/XmlParseMode.hpp"
+#include "io/xml/XmlParseParameter.hpp"
+#include "io/xml/XmlNode.hpp"
+#include "io/xml/XmlDocument.hpp"
+#include "io/xml/XmlDeclaration.hpp"
+#include "io/xml/XmlAttribute.hpp"
+#include "io/xml/XmlParser.hpp"
 #include "io/File.hpp"
 #include "io/FileOutputStream.hpp"
 #include "io/FilePathSeparator.hpp"
@@ -53,32 +58,28 @@
 #include "io/IWriter.hpp"
 #include "io/NewLine.hpp"
 #include "io/StorableFile.hpp"
-#include "io/kv/KVPair.hpp"
-#include "io/kv/KVDocument.hpp"
-#include "io/kv/KVParser.hpp"
-#include "io/kv/KVReader.hpp"
+#include "io/StandardOutputWriter.hpp"
+#include "io/kv/KvPair.hpp"
+#include "io/kv/KvDocument.hpp"
+#include "io/kv/KvParser.hpp"
+#include "io/kv/KvFileReader.hpp"
 
 #include "logic/State.hpp"
 #include "logic/StateConnection.hpp"
 #include "logic/StateMachine.hpp"
 #include "logic/StateMachineTypes.hpp"
 
-#include "serialization/boxing/SerializableJSONBoolean.hpp"
-#include "serialization/boxing/SerializableJSONDouble.hpp"
-#include "serialization/boxing/SerializableJSONFloat.hpp"
-#include "serialization/boxing/SerializableJSONInteger.hpp"
-#include "serialization/boxing/SerializableJSONLong.hpp"
-#include "serialization/boxing/SerializableJSONString.hpp"
-#include "serialization/logic/SerializableJSONState.hpp"
-#include "serialization/logic/SerializableJSONStateConnection.hpp"
-#include "serialization/logic/SerializableJSONStateMachine.hpp"
-#include "serialization/event/SerializableJSONEvent.hpp"
+#include "serialization/json/logic/SerializableJsonState.hpp"
+#include "serialization/json/logic/SerializableJsonStateConnection.hpp"
+#include "serialization/json/logic/SerializableJsonStateMachine.hpp"
+#include "serialization/json/event/SerializableJsonEvent.hpp"
 #include "serialization/ISerializable.hpp"
 
 #include "time/Date.hpp"
 
 #include "utils/RegexUtils.hpp"
 #include "utils/STLUtils.hpp"
+
 #if _WIN32
 #include "utils/WindowsUtils.hpp"
 #endif
@@ -89,4 +90,6 @@
 #include "event/IEventSubscriber.hpp"
 #include "event/EventManager.hpp"
 
+#include "factory/IFactory.hpp"
+
 #endif

+ 6 - 4
include/ls_std/serialization/ISerializable.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-21
- * Changed:         2020-11-20
+ * Changed:         2021-04-23
  *
  * */
 
@@ -12,15 +12,17 @@
 
 #include <ls_std/base/Types.hpp>
 
-namespace ls_std {
-  class ISerializable {
+namespace ls_std
+{
+  class ISerializable
+  {
     public:
 
       ISerializable() = default;
       ~ISerializable() = default;
 
       virtual ls_std::byte_field marshal() = 0;
-      virtual void unmarshal(const ls_std::byte_field& _data) = 0;
+      virtual void unmarshal(const ls_std::byte_field &_data) = 0;
   };
 }
 

+ 0 - 46
include/ls_std/serialization/boxing/SerializableJSONBoolean.hpp

@@ -1,46 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-09-04
- * Changed:         2020-11-26
- *
- * */
-
-#ifndef LS_STD_SERIALIZABLE_JSON_BOOLEAN_HPP
-#define LS_STD_SERIALIZABLE_JSON_BOOLEAN_HPP
-
-#include <memory>
-#include <ls_std/lib/nlohmann_json/include/nlohmann/json.hpp>
-#include <ls_std/base/Class.hpp>
-#include <ls_std/serialization/ISerializable.hpp>
-#include <ls_std/boxing/Boolean.hpp>
-
-namespace ls_std {
-  class SerializableJSONBoolean : public Class, public ISerializable {
-    public:
-
-      explicit SerializableJSONBoolean(const std::shared_ptr<ls_std::Boolean>& _value);
-      ~SerializableJSONBoolean() override = default;
-
-      // implementation
-
-      ls_std::byte_field marshal() override;
-      void unmarshal(const ls_std::byte_field& _data) override;
-
-      // additional functionality
-
-      std::shared_ptr<ls_std::Boolean> getValue();
-      void setValue(const std::shared_ptr<ls_std::Boolean>& _value);
-
-    private:
-
-      std::shared_ptr<ls_std::Boolean> value {};
-      nlohmann::json jsonObject {};
-
-      void _assignValue(const std::shared_ptr<ls_std::Boolean>& _value);
-      void _update();
-  };
-}
-
-#endif

+ 0 - 46
include/ls_std/serialization/boxing/SerializableJSONDouble.hpp

@@ -1,46 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-09-04
- * Changed:         2020-11-26
- *
- * */
-
-#ifndef LS_STD_SERIALIZABLE_JSON_DOUBLE_HPP
-#define LS_STD_SERIALIZABLE_JSON_DOUBLE_HPP
-
-#include <memory>
-#include <ls_std/lib/nlohmann_json/include/nlohmann/json.hpp>
-#include <ls_std/base/Class.hpp>
-#include <ls_std/serialization/ISerializable.hpp>
-#include <ls_std/boxing/Double.hpp>
-
-namespace ls_std {
-  class SerializableJSONDouble : public Class, public ISerializable {
-    public:
-
-      explicit SerializableJSONDouble(const std::shared_ptr<ls_std::Double>& _value);
-      ~SerializableJSONDouble() override = default;
-
-      // implementation
-
-      ls_std::byte_field marshal() override;
-      void unmarshal(const ls_std::byte_field& _data) override;
-
-      // additional functionality
-
-      std::shared_ptr<ls_std::Double> getValue();
-      void setValue(const std::shared_ptr<ls_std::Double>& _value);
-
-    private:
-
-      std::shared_ptr<ls_std::Double> value {};
-      nlohmann::json jsonObject {};
-
-      void _assignValue(const std::shared_ptr<ls_std::Double>& _value);
-      void _update();
-  };
-}
-
-#endif

+ 0 - 46
include/ls_std/serialization/boxing/SerializableJSONFloat.hpp

@@ -1,46 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-09-04
- * Changed:         2020-11-26
- *
- * */
-
-#ifndef LS_STD_SERIALIZABLE_JSON_FLOAT_HPP
-#define LS_STD_SERIALIZABLE_JSON_FLOAT_HPP
-
-#include <memory>
-#include <ls_std/lib/nlohmann_json/include/nlohmann/json.hpp>
-#include <ls_std/base/Class.hpp>
-#include <ls_std/serialization/ISerializable.hpp>
-#include <ls_std/boxing/Float.hpp>
-
-namespace ls_std {
-  class SerializableJSONFloat : public Class, public ISerializable {
-    public:
-
-      explicit SerializableJSONFloat(const std::shared_ptr<ls_std::Float>& _value);
-      ~SerializableJSONFloat() override = default;
-
-      // implementation
-
-      ls_std::byte_field marshal() override;
-      void unmarshal(const ls_std::byte_field& _data) override;
-
-      // additional functionality
-
-      std::shared_ptr<ls_std::Float> getValue();
-      void setValue(const std::shared_ptr<ls_std::Float>& _value);
-
-    private:
-
-      std::shared_ptr<ls_std::Float> value {};
-      nlohmann::json jsonObject {};
-
-      void _assignValue(const std::shared_ptr<ls_std::Float>& _value);
-      void _update();
-  };
-}
-
-#endif

+ 0 - 45
include/ls_std/serialization/boxing/SerializableJSONInteger.hpp

@@ -1,45 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-21
- * Changed:         2020-11-26
- *
- * */
-
-#ifndef LS_STD_SERIALIZABLE_JSON_INTEGER_HPP
-#define LS_STD_SERIALIZABLE_JSON_INTEGER_HPP
-
-#include <ls_std/serialization/ISerializable.hpp>
-#include <ls_std/base/Class.hpp>
-#include <ls_std/boxing/Integer.hpp>
-#include <ls_std/lib/nlohmann_json/include/nlohmann/json.hpp>
-
-namespace ls_std {
-  class SerializableJSONInteger : public Class, public ISerializable {
-    public:
-
-      explicit SerializableJSONInteger(const std::shared_ptr<ls_std::Integer>& _value);
-      ~SerializableJSONInteger() override = default;
-
-      // implementation
-
-      ls_std::byte_field marshal() override;
-      void unmarshal(const ls_std::byte_field& _data) override;
-
-      // additional functionality
-
-      std::shared_ptr<ls_std::Integer> getValue();
-      void setValue(const std::shared_ptr<ls_std::Integer>& _value);
-
-    private:
-
-      std::shared_ptr<ls_std::Integer> value {};
-      nlohmann::json jsonObject {};
-
-      void _assignValue(const std::shared_ptr<ls_std::Integer>& _value);
-      void _update();
-  };
-}
-
-#endif

+ 0 - 45
include/ls_std/serialization/boxing/SerializableJSONLong.hpp

@@ -1,45 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-25
- * Changed:         2020-11-26
- *
- * */
-
-#ifndef LS_STD_SERIALIZABLE_JSON_LONG_HPP
-#define LS_STD_SERIALIZABLE_JSON_LONG_HPP
-
-#include <ls_std/base/Class.hpp>
-#include <ls_std/serialization/ISerializable.hpp>
-#include <ls_std/boxing/Long.hpp>
-#include <ls_std/lib/nlohmann_json/include/nlohmann/json.hpp>
-
-namespace ls_std {
-  class SerializableJSONLong : public Class, public ISerializable {
-    public:
-
-      explicit SerializableJSONLong(const std::shared_ptr<ls_std::Long>& _value);
-      ~SerializableJSONLong() override = default;
-
-      // implementation
-
-      ls_std::byte_field marshal() override;
-      void unmarshal(const ls_std::byte_field& _data) override;
-
-      // additional functionality
-
-      std::shared_ptr<ls_std::Long> getValue();
-      void setValue(const std::shared_ptr<ls_std::Long>& _value);
-
-    private:
-
-      nlohmann::json jsonObject {};
-      std::shared_ptr<ls_std::Long> value {};
-
-      void _assignValue(const std::shared_ptr<ls_std::Long>& _value);
-      void _update();
-  };
-}
-
-#endif

+ 0 - 45
include/ls_std/serialization/boxing/SerializableJSONString.hpp

@@ -1,45 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-30
- * Changed:         2020-11-26
- *
- * */
-
-#ifndef LS_STD_SERIALIZABLE_JSON_STRING_HPP
-#define LS_STD_SERIALIZABLE_JSON_STRING_HPP
-
-#include <memory>
-#include <ls_std/lib/nlohmann_json/include/nlohmann/json.hpp>
-#include <ls_std/serialization/ISerializable.hpp>
-#include <ls_std/boxing/String.hpp>
-
-namespace ls_std {
-  class SerializableJSONString : public Class, public ISerializable {
-    public:
-
-      explicit SerializableJSONString(const std::shared_ptr<ls_std::String>& _value);
-      ~SerializableJSONString() override = default;
-
-      // implementation
-
-      ls_std::byte_field marshal() override;
-      void unmarshal(const ls_std::byte_field& _data) override;
-
-      // additional functionality
-
-      std::shared_ptr<ls_std::String> getValue();
-      void setValue(const std::shared_ptr<ls_std::String>& _value);
-
-    private:
-
-      nlohmann::json jsonObject {};
-      std::shared_ptr<ls_std::String> value {};
-
-      void _assignValue(const std::shared_ptr<ls_std::String>& _value);
-      void _update();
-  };
-}
-
-#endif

+ 12 - 10
include/ls_std/serialization/event/SerializableJSONEvent.hpp → include/ls_std/serialization/json/event/SerializableJsonEvent.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-07
- * Changed:         2020-12-20
+ * Changed:         2021-05-02
  *
  * */
 
@@ -16,29 +16,31 @@
 #include <memory>
 #include <ls_std/lib/nlohmann_json/include/nlohmann/json.hpp>
 
-namespace ls_std {
-  class SerializableJSONEvent : public ls_std::Class, public ls_std::ISerializable {
+namespace ls_std
+{
+  class SerializableJsonEvent : public ls_std::Class, public ls_std::ISerializable
+  {
     public:
 
-      explicit SerializableJSONEvent(const std::shared_ptr<ls_std::Event>& _value);
-      ~SerializableJSONEvent() override = default;
+      explicit SerializableJsonEvent(const std::shared_ptr<ls_std::Event> &_value);
+      ~SerializableJsonEvent() override = default;
 
       // implementation
 
       ls_std::byte_field marshal() override;
-      void unmarshal(const ls_std::byte_field& _data) override;
+      void unmarshal(const ls_std::byte_field &_data) override;
 
       // additional functionality
 
       std::shared_ptr<ls_std::Event> getValue();
-      void setValue(const std::shared_ptr<ls_std::Event>& _value);
+      void setValue(const std::shared_ptr<ls_std::Event> &_value);
 
     private:
 
-      nlohmann::json jsonObject {};
-      std::shared_ptr<ls_std::Event> value {};
+      nlohmann::json jsonObject{};
+      std::shared_ptr<ls_std::Event> value{};
 
-      void _assignValue(const std::shared_ptr<ls_std::Event>& _value);
+      void _assignValue(const std::shared_ptr<ls_std::Event> &_value);
       void _unmarshalParameterList();
       void _update();
       void _updateEventParameterList();

+ 12 - 10
include/ls_std/serialization/logic/SerializableJSONState.hpp → include/ls_std/serialization/json/logic/SerializableJsonState.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-15
- * Changed:         2020-11-26
+ * Changed:         2021-05-02
  *
  * */
 
@@ -16,29 +16,31 @@
 #include <ls_std/serialization/ISerializable.hpp>
 #include <ls_std/base/Class.hpp>
 
-namespace ls_std {
-  class SerializableJSONState : public Class, public ISerializable {
+namespace ls_std
+{
+  class SerializableJsonState : public ls_std::Class, public ls_std::ISerializable
+  {
     public:
 
-      explicit SerializableJSONState(const std::shared_ptr<ls_std::State>& _value);
-      ~SerializableJSONState() override = default;
+      explicit SerializableJsonState(const std::shared_ptr<ls_std::State> &_value);
+      ~SerializableJsonState() override = default;
 
       // implementation
 
       ls_std::byte_field marshal() override;
-      void unmarshal(const ls_std::byte_field& _data) override;
+      void unmarshal(const ls_std::byte_field &_data) override;
 
       // additional functionality
 
       std::shared_ptr<ls_std::State> getValue();
-      void setValue(const std::shared_ptr<ls_std::State>& _value);
+      void setValue(const std::shared_ptr<ls_std::State> &_value);
 
     private:
 
-      nlohmann::json jsonObject {};
-      std::shared_ptr<ls_std::State> value {};
+      nlohmann::json jsonObject{};
+      std::shared_ptr<ls_std::State> value{};
 
-      void _assignValue(const std::shared_ptr<ls_std::State>& _value);
+      void _assignValue(const std::shared_ptr<ls_std::State> &_value);
       void _clear();
       void _unmarshalStateConnections();
       void _update();

+ 12 - 10
include/ls_std/serialization/logic/SerializableJSONStateConnection.hpp → include/ls_std/serialization/json/logic/SerializableJsonStateConnection.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-14
- * Changed:         2020-11-26
+ * Changed:         2021-05-02
  *
  * */
 
@@ -16,29 +16,31 @@
 #include <ls_std/serialization/ISerializable.hpp>
 #include <ls_std/logic/StateConnection.hpp>
 
-namespace ls_std {
-  class SerializableJSONStateConnection : public Class, public ISerializable {
+namespace ls_std
+{
+  class SerializableJsonStateConnection : public ls_std::Class, public ls_std::ISerializable
+  {
     public:
 
-      explicit SerializableJSONStateConnection(const std::shared_ptr<ls_std::StateConnection>& _value);
-      ~SerializableJSONStateConnection() override = default;
+      explicit SerializableJsonStateConnection(const std::shared_ptr<ls_std::StateConnection> &_value);
+      ~SerializableJsonStateConnection() override = default;
 
       // implementation
 
       ls_std::byte_field marshal() override;
-      void unmarshal(const ls_std::byte_field& _data) override;
+      void unmarshal(const ls_std::byte_field &_data) override;
 
       // additional functionality
 
       std::shared_ptr<ls_std::StateConnection> getValue();
-      void setValue(const std::shared_ptr<ls_std::StateConnection>& _value);
+      void setValue(const std::shared_ptr<ls_std::StateConnection> &_value);
 
     private:
 
-      nlohmann::json jsonObject {};
-      std::shared_ptr<ls_std::StateConnection> value {};
+      nlohmann::json jsonObject{};
+      std::shared_ptr<ls_std::StateConnection> value{};
 
-      void _assignValue(const std::shared_ptr<ls_std::StateConnection>& _value);
+      void _assignValue(const std::shared_ptr<ls_std::StateConnection> &_value);
       void _clear();
       void _update();
   };

+ 12 - 10
include/ls_std/serialization/logic/SerializableJSONStateMachine.hpp → include/ls_std/serialization/json/logic/SerializableJsonStateMachine.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-17
- * Changed:         2020-11-26
+ * Changed:         2021-05-02
  *
  * */
 
@@ -16,29 +16,31 @@
 #include <memory>
 #include <ls_std/lib/nlohmann_json/include/nlohmann/json.hpp>
 
-namespace ls_std {
-  class SerializableJSONStateMachine : public Class, public ISerializable {
+namespace ls_std
+{
+  class SerializableJsonStateMachine : public ls_std::Class, public ls_std::ISerializable
+  {
     public:
 
-      explicit SerializableJSONStateMachine(const std::shared_ptr<ls_std::StateMachine>& _value);
-      ~SerializableJSONStateMachine() override = default;
+      explicit SerializableJsonStateMachine(const std::shared_ptr<ls_std::StateMachine> &_value);
+      ~SerializableJsonStateMachine() override = default;
 
       // implementation
 
       ls_std::byte_field marshal() override;
-      void unmarshal(const ls_std::byte_field& _data) override;
+      void unmarshal(const ls_std::byte_field &_data) override;
 
       // additional functionality
 
       std::shared_ptr<ls_std::StateMachine> getValue();
-      void setValue(const std::shared_ptr<ls_std::StateMachine>& _value);
+      void setValue(const std::shared_ptr<ls_std::StateMachine> &_value);
 
     private:
 
-      nlohmann::json jsonObject {};
-      std::shared_ptr<ls_std::StateMachine> value {};
+      nlohmann::json jsonObject{};
+      std::shared_ptr<ls_std::StateMachine> value{};
 
-      void _assignValue(const std::shared_ptr<ls_std::StateMachine>& _value);
+      void _assignValue(const std::shared_ptr<ls_std::StateMachine> &_value);
       void _unmarshalCurrentState();
       void _unmarshalStates();
       void _update();

+ 15 - 9
include/ls_std/time/Date.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2020-11-26
+ * Changed:         2021-05-22
  *
  * */
 
@@ -13,8 +13,10 @@
 #include <ls_std/base/Class.hpp>
 #include <ctime>
 
-namespace ls_std {
-  class Date : public Class {
+namespace ls_std
+{
+  class Date : public ls_std::Class
+  {
     public:
 
       Date();
@@ -22,13 +24,15 @@ namespace ls_std {
 
       // arithmetic operators
 
-      ls_std::Date& operator+(int _value);
-      ls_std::Date& operator-(int _value);
+      ls_std::Date &operator+(int _value);
+      ls_std::Date &operator-(int _value);
+      ls_std::Date &operator+=(int _value);
+      ls_std::Date &operator-=(int _value);
 
       // additional functionality
 
-      bool after(const ls_std::Date& _foreignDate) const;
-      bool before(const ls_std::Date& _foreignDate) const;
+      bool after(const ls_std::Date &_foreignDate) const;
+      bool before(const ls_std::Date &_foreignDate) const;
       int getDay();
       int getHour();
       int getMinute();
@@ -41,9 +45,11 @@ namespace ls_std {
 
     private:
 
-      time_t timestamp {};
-      tm* localTime {};
+      time_t timestamp{};
+      tm *localTime{};
 
+      void _decrementByDays(int _value);
+      void _incrementByDays(int _value);
       void _init();
   };
 }

+ 5 - 3
include/ls_std/utils/RegexUtils.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-18
- * Changed:         2020-11-06
+ * Changed:         2021-04-23
  *
  * */
 
@@ -13,8 +13,10 @@
 #include <string>
 #include <regex>
 
-namespace ls_std {
-  class RegexUtils {
+namespace ls_std
+{
+  class RegexUtils
+  {
     public:
 
       RegexUtils() = default;

+ 18 - 11
include/ls_std/utils/STLUtils.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2020-11-06
+ * Changed:         2021-04-23
  *
  * */
 
@@ -13,26 +13,33 @@
 #include <algorithm>
 #include <list>
 
-namespace ls_std {
-  class STLUtils {
+namespace ls_std
+{
+  class STLUtils
+  {
     public:
 
       STLUtils() = default;
       ~STLUtils() = default;
 
       template<class container, class dataType>
-      static bool contains(container _container, const dataType& _value) {
+      static bool contains(container _container, const dataType &_value)
+      {
         return std::find(_container.begin(), _container.end(), _value) != _container.end();
       }
 
       template<class dataType>
-      static dataType getListElementAt(const std::list<dataType>& _list, size_t _index) {
-        dataType value {};
-        size_t counter {};
-
-        if(_index < _list.size()) {
-          for(const auto& _value : _list) {
-            if(counter == _index) {
+      static dataType getListElementAt(const std::list<dataType> &_list, size_t _index)
+      {
+        dataType value{};
+        size_t counter{};
+
+        if (_index < _list.size())
+        {
+          for (const auto &_value : _list)
+          {
+            if (counter == _index)
+            {
               value = _value;
               break;
             }

+ 9 - 13
include/ls_std/utils/WindowsUtils.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-06
- * Changed:         2020-12-06
+ * Changed:         2021-04-23
  *
  * */
 
@@ -14,25 +14,21 @@
 #include <string>
 #include <windows.h>
 
-namespace ls_std {
-  class WindowsUtils {
+namespace ls_std
+{
+  class WindowsUtils
+  {
     public:
 
       WindowsUtils() = default;
       ~WindowsUtils() = default;
 
-      static std::string getMessageFromErrorCode(const int& _errorCode) {
+      static std::string getMessageFromErrorCode(const int &_errorCode)
+      {
         ls_std::byte messageBuffer[256 + 1];
+        FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, _errorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), messageBuffer, sizeof(messageBuffer), nullptr);
 
-        FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
-                       nullptr,
-                       _errorCode,
-                       MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
-                       messageBuffer,
-                       sizeof (messageBuffer),
-                       nullptr);
-
-        return std::string {messageBuffer};
+        return std::string{messageBuffer};
       }
   };
 }

+ 16 - 4
source/ls_std/base/Class.cpp

@@ -3,17 +3,29 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-07
- * Changed:         2020-11-25
+ * Changed:         2021-04-24
  *
  * */
 
 #include <ls_std/base/Class.hpp>
+#include <ls_std/exception/IllegalArgumentException.hpp>
 
-ls_std::Class::Class(std::string _name):
-name(std::move(_name))
-{}
+ls_std::Class::Class(const std::string &_name)
+{
+  this->_assignClassName(_name);
+}
 
 std::string ls_std::Class::getClassName()
 {
   return this->name;
 }
+
+void ls_std::Class::_assignClassName(const std::string &_name)
+{
+  if (_name.empty())
+  {
+    throw ls_std::IllegalArgumentException{};
+  }
+
+  this->name = _name;
+}

+ 19 - 13
source/ls_std/base/Version.cpp

@@ -3,22 +3,22 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-28
- * Changed:         2020-11-26
+ * Changed:         2021-04-24
  *
  * */
 
 #include <regex>
 #include <ls_std/base/Version.hpp>
 
-ls_std::Version::Version(ls_std::version_type _majorVersion, ls_std::version_type _minorVersion, ls_std::version_type _patchVersion) :
-majorVersion(_majorVersion),
-minorVersion(_minorVersion),
-patchVersion(_patchVersion)
+ls_std::Version::Version(ls_std::version_type _majorVersion, ls_std::version_type _minorVersion, ls_std::version_type _patchVersion)
+    : majorVersion(_majorVersion),
+      minorVersion(_minorVersion),
+      patchVersion(_patchVersion)
 {}
 
 ls_std::byte_field ls_std::Version::marshal()
 {
-  ls_std::byte_field data {};
+  ls_std::byte_field data{};
 
   data += std::to_string(this->majorVersion) + ".";
   data += std::to_string(this->minorVersion) + ".";
@@ -30,12 +30,11 @@ ls_std::byte_field ls_std::Version::marshal()
 void ls_std::Version::unmarshal(const ls_std::byte_field &_data)
 {
   std::string field = _data;
-  std::string subSequence {};
-  size_t position;
 
-  if(ls_std::Version::_isValid(_data)) {
-    position = field.find('.');
-    subSequence = field.substr(0, position);
+  if (ls_std::Version::_isValid(_data))
+  {
+    size_t position = field.find('.');
+    std::string subSequence = field.substr(0, position);
     this->majorVersion = std::stoi(subSequence);
     field.erase(0, position + 1);
 
@@ -85,6 +84,13 @@ void ls_std::Version::setPatchVersion(ls_std::version_type _patch)
 
 bool ls_std::Version::_isValid(const std::string &_versionString)
 {
-  static std::regex versionRegex {R"(\d+[.]\d+[.]\d+)"};
-  return std::regex_match(_versionString.begin(), _versionString.end(), versionRegex);
+  bool isValidVersionString{};
+  static std::regex versionRegex{R"(\d+[.]\d+[.]\d+)"};
+
+  if (!_versionString.empty())
+  {
+    isValidVersionString = std::regex_match(_versionString.begin(), _versionString.end(), versionRegex);
+  }
+
+  return isValidVersionString;
 }

+ 32 - 63
source/ls_std/boxing/Boolean.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-09
- * Changed:         2020-11-26
+ * Changed:         2021-07-08
  *
  * */
 
@@ -14,8 +14,9 @@
 ls_std::Boolean::Boolean() : ls_std::Class("Boolean")
 {}
 
-ls_std::Boolean::Boolean(bool _value) : ls_std::Class("Boolean"),
-value(_value)
+ls_std::Boolean::Boolean(bool _value)
+    : ls_std::Class("Boolean"),
+      value(_value)
 {}
 
 ls_std::Boolean::operator bool() const
@@ -23,13 +24,13 @@ ls_std::Boolean::operator bool() const
   return this->value;
 }
 
-ls_std::Boolean & ls_std::Boolean::operator=(int _value)
+ls_std::Boolean &ls_std::Boolean::operator=(int _value)
 {
   this->value = _value;
   return *this;
 }
 
-ls_std::Boolean & ls_std::Boolean::operator=(bool _value)
+ls_std::Boolean &ls_std::Boolean::operator=(bool _value)
 {
   this->value = _value;
   return *this;
@@ -65,100 +66,68 @@ bool ls_std::Boolean::operator||(int _value) const
   return this->value || _value;
 }
 
-ls_std::byte_field ls_std::Boolean::load() {
-  ls_std::byte_field data {};
-
-  if(this->storable != nullptr && this->serializable != nullptr) {
-    data = this->storable->load();
-    this->serializable->unmarshal(data);
-  }
-
-  return data;
-}
-
-ls_std::byte_field ls_std::Boolean::marshal() {
-  ls_std::byte_field data {};
-
-  if(this->serializable != nullptr) {
-    data = this->serializable->marshal();
-  }
-
-  return data;
-}
-
 void ls_std::Boolean::parse(std::string _parseText)
 {
   std::transform(_parseText.begin(), _parseText.end(), _parseText.begin(), ::tolower);
 
-  if(_parseText != this->TRUE_STRING && _parseText != this->FALSE_STRING) {
-    throw ls_std::IllegalArgumentException {};
-  } else {
-    if(_parseText == this->TRUE_STRING) {
+  if (_parseText != this->TRUE_STRING && _parseText != this->FALSE_STRING)
+  {
+    throw ls_std::IllegalArgumentException{};
+  }
+  else
+  {
+    if (_parseText == this->TRUE_STRING)
+    {
       this->value = true;
     }
 
-    if(_parseText == this->FALSE_STRING) {
+    if (_parseText == this->FALSE_STRING)
+    {
       this->value = false;
     }
   }
 }
 
-void ls_std::Boolean::save(const ls_std::byte_field &_data) {
-  if(this->serializable != nullptr) {
-    if(_data.empty()) {
-      this->storable->save(this->serializable->marshal());
-    } else {
-      this->storable->save(_data);
-    }
-  }
-}
-
 std::string ls_std::Boolean::toString()
 {
   return this->_toString();
 }
 
-void ls_std::Boolean::unmarshal(const ls_std::byte_field &_data) {
-  if(this->serializable != nullptr) {
-    this->serializable->unmarshal(_data);
-  }
-}
-
-bool ls_std::Boolean::getValue() const {
+bool ls_std::Boolean::getValue() const
+{
   return this->value;
 }
 
-void ls_std::Boolean::setSerializable(std::shared_ptr<ISerializable> _serializable) {
-  this->serializable = std::move(_serializable);
-}
-
-void ls_std::Boolean::setStorable(std::shared_ptr<IStorable> _storable) {
-  this->storable = std::move(_storable);
-}
-
-bool ls_std::Boolean::XOR(const ls_std::Boolean &_leftExpression, const ls_std::Boolean &_rightExpression) {
+bool ls_std::Boolean::XOR(const ls_std::Boolean &_leftExpression, const ls_std::Boolean &_rightExpression)
+{
   return (_leftExpression && !_rightExpression) || (!_leftExpression && _rightExpression);
 }
 
-bool ls_std::Boolean::XOR(const ls_std::Boolean &_leftExpression, bool _rightExpression) {
+bool ls_std::Boolean::XOR(const ls_std::Boolean &_leftExpression, bool _rightExpression)
+{
   return (_leftExpression && !_rightExpression) || (!_leftExpression && _rightExpression);
 }
 
-bool ls_std::Boolean::XOR(bool _leftExpression, const ls_std::Boolean &_rightExpression) {
+bool ls_std::Boolean::XOR(bool _leftExpression, const ls_std::Boolean &_rightExpression)
+{
   return (_leftExpression && !_rightExpression) || (!_leftExpression && _rightExpression);
 }
 
-bool ls_std::Boolean::XOR(bool _leftExpression, bool _rightExpression) {
+bool ls_std::Boolean::XOR(bool _leftExpression, bool _rightExpression)
+{
   return (_leftExpression && !_rightExpression) || (!_leftExpression && _rightExpression);
 }
 
 std::string ls_std::Boolean::_toString() const
 {
-  std::string booleanString {};
+  std::string booleanString{};
 
-  if(this->value) {
+  if (this->value)
+  {
     booleanString = this->TRUE_STRING;
-  } else {
+  }
+  else
+  {
     booleanString = this->FALSE_STRING;
   }
 

+ 96 - 89
source/ls_std/boxing/Double.cpp

@@ -3,224 +3,231 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2020-11-26
+ * Changed:         2021-07-12
  *
  * */
 
 #include <cmath>
 #include <ls_std/boxing/Double.hpp>
+#include <ls_std/exception/IllegalArgumentException.hpp>
 
-ls_std::Double::Double() : ls_std::Class("Double"),
-epsilon(0.00000001)
-{}
+ls_std::Double::Double() : ls_std::Class("Double")
+{
+  this->_assignEpsilon(0.00000001);
+}
 
-ls_std::Double::Double(double _value) : ls_std::Class("Double"),
-epsilon(0.00000001),
-value(_value)
-{}
+ls_std::Double::Double(double _value)
+    : ls_std::Class("Double"),
+      value(_value)
+{
+  this->_assignEpsilon(0.00000001);
+}
 
-ls_std::Double::operator double() const {
+ls_std::Double::operator double() const
+{
   return this->value;
 }
 
-ls_std::Double & ls_std::Double::operator=(double _value) {
+ls_std::Double &ls_std::Double::operator=(double _value)
+{
   this->value = _value;
   return *this;
 }
 
-double ls_std::Double::operator-() const {
+double ls_std::Double::operator-() const
+{
   return -this->value;
 }
 
-double ls_std::Double::operator+(const ls_std::Double &_double) const {
+double ls_std::Double::operator+(const ls_std::Double &_double) const
+{
   return this->value + _double;
 }
 
-double ls_std::Double::operator+(double _value) const {
+double ls_std::Double::operator+(double _value) const
+{
   return this->value + _value;
 }
 
-double ls_std::Double::operator*(const ls_std::Double &_double) const {
+double ls_std::Double::operator*(const ls_std::Double &_double) const
+{
   return this->value * _double;
 }
 
-double ls_std::Double::operator*(double _value) const {
+double ls_std::Double::operator*(double _value) const
+{
   return this->value * _value;
 }
 
-double ls_std::Double::operator-(const ls_std::Double &_double) const {
+double ls_std::Double::operator-(const ls_std::Double &_double) const
+{
   return this->value - _double;
 }
 
-double ls_std::Double::operator-(double _value) const {
+double ls_std::Double::operator-(double _value) const
+{
   return this->value - _value;
 }
 
-double ls_std::Double::operator/(const ls_std::Double &_double) const {
+double ls_std::Double::operator/(const ls_std::Double &_double) const
+{
   return this->value / _double;
 }
 
-double ls_std::Double::operator/(double _value) const {
+double ls_std::Double::operator/(double _value) const
+{
   return this->value / _value;
 }
 
-ls_std::Double & ls_std::Double::operator+=(const ls_std::Double &_double) {
+ls_std::Double &ls_std::Double::operator+=(const ls_std::Double &_double)
+{
   this->value += _double;
   return *this;
 }
 
-ls_std::Double & ls_std::Double::operator+=(double _value) {
+ls_std::Double &ls_std::Double::operator+=(double _value)
+{
   this->value += _value;
   return *this;
 }
 
-ls_std::Double & ls_std::Double::operator-=(const ls_std::Double &_double) {
+ls_std::Double &ls_std::Double::operator-=(const ls_std::Double &_double)
+{
   this->value -= _double;
   return *this;
 }
 
-ls_std::Double & ls_std::Double::operator-=(double _value) {
+ls_std::Double &ls_std::Double::operator-=(double _value)
+{
   this->value -= _value;
   return *this;
 }
 
-ls_std::Double & ls_std::Double::operator*=(const ls_std::Double &_double) {
+ls_std::Double &ls_std::Double::operator*=(const ls_std::Double &_double)
+{
   this->value *= _double;
   return *this;
 }
 
-ls_std::Double & ls_std::Double::operator*=(double _value) {
+ls_std::Double &ls_std::Double::operator*=(double _value)
+{
   this->value *= _value;
   return *this;
 }
 
-ls_std::Double & ls_std::Double::operator/=(const ls_std::Double &_double) {
+ls_std::Double &ls_std::Double::operator/=(const ls_std::Double &_double)
+{
   this->value /= _double;
   return *this;
 }
 
-ls_std::Double & ls_std::Double::operator/=(double _value) {
+ls_std::Double &ls_std::Double::operator/=(double _value)
+{
   this->value /= _value;
   return *this;
 }
 
-bool ls_std::Double::operator==(const ls_std::Double &_double) const {
+bool ls_std::Double::operator==(const ls_std::Double &_double) const
+{
   return std::fabs(this->value - _double) < this->epsilon;
 }
 
-bool ls_std::Double::operator==(double _value) const {
+bool ls_std::Double::operator==(double _value) const
+{
   return std::fabs(this->value - _value) < this->epsilon;
 }
 
-bool ls_std::Double::operator!=(const ls_std::Double &_double) const {
+bool ls_std::Double::operator!=(const ls_std::Double &_double) const
+{
   return std::fabs(this->value - _double) >= this->epsilon;
 }
 
-bool ls_std::Double::operator!=(double _value) const {
+bool ls_std::Double::operator!=(double _value) const
+{
   return std::fabs(this->value - _value) >= this->epsilon;
 }
 
-bool ls_std::Double::operator>(const ls_std::Double &_double) const {
+bool ls_std::Double::operator>(const ls_std::Double &_double) const
+{
   return this->value > _double;
 }
 
-bool ls_std::Double::operator>(double _value) const {
+bool ls_std::Double::operator>(double _value) const
+{
   return this->value > _value;
 }
 
-bool ls_std::Double::operator>=(const ls_std::Double &_double) const {
+bool ls_std::Double::operator>=(const ls_std::Double &_double) const
+{
   return this->value >= _double;
 }
 
-bool ls_std::Double::operator>=(double _value) const {
+bool ls_std::Double::operator>=(double _value) const
+{
   return this->value >= _value;
 }
 
-bool ls_std::Double::operator<(const ls_std::Double &_double) const {
+bool ls_std::Double::operator<(const ls_std::Double &_double) const
+{
   return this->value < _double;
 }
 
-bool ls_std::Double::operator<(double _value) const {
+bool ls_std::Double::operator<(double _value) const
+{
   return this->value < _value;
 }
 
-bool ls_std::Double::operator<=(const ls_std::Double &_double) const {
+bool ls_std::Double::operator<=(const ls_std::Double &_double) const
+{
   return this->value <= _double;
 }
 
-bool ls_std::Double::operator<=(double _value) const {
+bool ls_std::Double::operator<=(double _value) const
+{
   return this->value <= _value;
 }
 
-void ls_std::Double::operator++() {
+void ls_std::Double::operator++()
+{
   this->value += 1.0f;
 }
 
-void ls_std::Double::operator--() {
+void ls_std::Double::operator--()
+{
   this->value -= 1.0f;
 }
 
-ls_std::byte_field ls_std::Double::load() {
-  ls_std::byte_field data {};
-
-  if(this->storable != nullptr && this->serializable != nullptr) {
-    data = this->storable->load();
-    this->serializable->unmarshal(data);
-  }
-
-  return data;
-}
-
-ls_std::byte_field ls_std::Double::marshal() {
-  ls_std::byte_field data {};
-
-  if(this->serializable != nullptr) {
-    data = this->serializable->marshal();
-  }
-
-  return data;
-}
-
-void ls_std::Double::parse(std::string _parseText) {
+void ls_std::Double::parse(std::string _parseText)
+{
   this->value = std::stod(_parseText);
 }
 
-void ls_std::Double::save(const ls_std::byte_field &_data) {
-  if(this->serializable != nullptr) {
-    if(_data.empty()) {
-      this->storable->save(this->serializable->marshal());
-    } else {
-      this->storable->save(_data);
-    }
-  }
-}
-
-std::string ls_std::Double::toString() {
+std::string ls_std::Double::toString()
+{
   return std::to_string(this->value);
 }
 
-void ls_std::Double::unmarshal(const ls_std::byte_field &_data) {
-  if(this->serializable != nullptr) {
-    this->serializable->unmarshal(_data);
-  }
-}
-
-double ls_std::Double::getEpsilon() {
+double ls_std::Double::getEpsilon()
+{
   return this->epsilon;
 }
 
-double ls_std::Double::getValue() {
+double ls_std::Double::getValue()
+{
   return this->value;
 }
 
-void ls_std::Double::setEpsilon(double _epsilon) {
-  this->epsilon = _epsilon;
+void ls_std::Double::setEpsilon(double _epsilon)
+{
+  this->_assignEpsilon(_epsilon);
 }
 
-void ls_std::Double::setSerializable(std::shared_ptr<ISerializable> _serializable) {
-  this->serializable = std::move(_serializable);
-}
+void ls_std::Double::_assignEpsilon(double _epsilon)
+{
+  if (_epsilon <= 0.0)
+  {
+    throw ls_std::IllegalArgumentException{};
+  }
 
-void ls_std::Double::setStorable(std::shared_ptr<IStorable> _storable) {
-  this->storable = std::move(_storable);
+  this->epsilon = _epsilon;
 }

+ 90 - 88
source/ls_std/boxing/Float.cpp

@@ -3,228 +3,230 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2020-11-26
+ * Changed:         2021-07-12
  *
  * */
 
 #include <cmath>
 #include <ls_std/boxing/Float.hpp>
+#include <ls_std/exception/IllegalArgumentException.hpp>
 
-ls_std::Float::Float() : ls_std::Class("Float"),
-epsilon(0.00001f)
+ls_std::Float::Float()
+    : ls_std::Class("Float"),
+      epsilon(0.00001f)
 {}
 
-ls_std::Float::Float(float _value) : ls_std::Class("Float"),
-epsilon(0.00001f),
-value(_value)
+ls_std::Float::Float(float _value)
+    : ls_std::Class("Float"),
+      epsilon(0.00001f),
+      value(_value)
 {}
 
-ls_std::Float::operator float() const {
+ls_std::Float::operator float() const
+{
   return this->value;
 }
 
-ls_std::Float & ls_std::Float::operator=(float _value) {
+ls_std::Float &ls_std::Float::operator=(float _value)
+{
   this->value = _value;
   return *this;
 }
 
-float ls_std::Float::operator-() const {
+float ls_std::Float::operator-() const
+{
   return -this->value;
 }
 
-float ls_std::Float::operator+(const ls_std::Float &_float) const {
+float ls_std::Float::operator+(const ls_std::Float &_float) const
+{
   return this->value + _float;
 }
 
-float ls_std::Float::operator+(float _value) const {
+float ls_std::Float::operator+(float _value) const
+{
   return this->value + _value;
 }
 
-float ls_std::Float::operator*(const ls_std::Float &_float) const {
+float ls_std::Float::operator*(const ls_std::Float &_float) const
+{
   return this->value * _float;
 }
 
-float ls_std::Float::operator*(float _value) const {
+float ls_std::Float::operator*(float _value) const
+{
   return this->value * _value;
 }
 
-float ls_std::Float::operator-(const ls_std::Float &_float) const {
+float ls_std::Float::operator-(const ls_std::Float &_float) const
+{
   return this->value - _float;
 }
 
-float ls_std::Float::operator-(float _value) const {
+float ls_std::Float::operator-(float _value) const
+{
   return this->value - _value;
 }
 
-float ls_std::Float::operator/(const ls_std::Float &_float) const {
+float ls_std::Float::operator/(const ls_std::Float &_float) const
+{
   return this->value / _float;
 }
 
-float ls_std::Float::operator/(float _value) const {
+float ls_std::Float::operator/(float _value) const
+{
   return this->value / _value;
 }
 
-ls_std::Float & ls_std::Float::operator+=(const ls_std::Float &_float) {
+ls_std::Float &ls_std::Float::operator+=(const ls_std::Float &_float)
+{
   this->value += _float;
   return *this;
 }
 
-ls_std::Float & ls_std::Float::operator+=(float _value) {
+ls_std::Float &ls_std::Float::operator+=(float _value)
+{
   this->value += _value;
   return *this;
 }
 
-ls_std::Float & ls_std::Float::operator-=(const ls_std::Float &_float) {
+ls_std::Float &ls_std::Float::operator-=(const ls_std::Float &_float)
+{
   this->value -= _float;
   return *this;
 }
 
-ls_std::Float & ls_std::Float::operator-=(float _value) {
+ls_std::Float &ls_std::Float::operator-=(float _value)
+{
   this->value -= _value;
   return *this;
 }
 
-ls_std::Float & ls_std::Float::operator*=(const ls_std::Float &_float) {
+ls_std::Float &ls_std::Float::operator*=(const ls_std::Float &_float)
+{
   this->value *= _float;
   return *this;
 }
 
-ls_std::Float & ls_std::Float::operator*=(float _value) {
+ls_std::Float &ls_std::Float::operator*=(float _value)
+{
   this->value *= _value;
   return *this;
 }
 
-ls_std::Float & ls_std::Float::operator/=(const ls_std::Float &_float) {
+ls_std::Float &ls_std::Float::operator/=(const ls_std::Float &_float)
+{
   this->value /= _float;
   return *this;
 }
 
-ls_std::Float & ls_std::Float::operator/=(float _value) {
+ls_std::Float &ls_std::Float::operator/=(float _value)
+{
   this->value /= _value;
   return *this;
 }
 
-bool ls_std::Float::operator==(const ls_std::Float &_float) const {
+bool ls_std::Float::operator==(const ls_std::Float &_float) const
+{
   return std::fabs(this->value - _float) < this->epsilon;
 }
 
-bool ls_std::Float::operator==(float _value) const {
+bool ls_std::Float::operator==(float _value) const
+{
   return std::fabs(this->value - _value) < this->epsilon;
 }
 
-bool ls_std::Float::operator!=(const ls_std::Float &_float) const {
+bool ls_std::Float::operator!=(const ls_std::Float &_float) const
+{
   return std::fabs(this->value - _float) >= this->epsilon;
 }
 
-bool ls_std::Float::operator!=(float _value) const {
+bool ls_std::Float::operator!=(float _value) const
+{
   return std::fabs(this->value - _value) >= this->epsilon;
 }
 
-bool ls_std::Float::operator>(const ls_std::Float &_float) const {
+bool ls_std::Float::operator>(const ls_std::Float &_float) const
+{
   return this->value > _float;
 }
 
-bool ls_std::Float::operator>(float _value) const {
+bool ls_std::Float::operator>(float _value) const
+{
   return this->value > _value;
 }
 
-bool ls_std::Float::operator>=(const ls_std::Float &_float) const {
+bool ls_std::Float::operator>=(const ls_std::Float &_float) const
+{
   return this->value >= _float;
 }
 
-bool ls_std::Float::operator>=(float _value) const {
+bool ls_std::Float::operator>=(float _value) const
+{
   return this->value >= _value;
 }
 
-bool ls_std::Float::operator<(const ls_std::Float &_float) const {
+bool ls_std::Float::operator<(const ls_std::Float &_float) const
+{
   return this->value < _float;
 }
 
-bool ls_std::Float::operator<(float _value) const {
+bool ls_std::Float::operator<(float _value) const
+{
   return this->value < _value;
 }
 
-bool ls_std::Float::operator<=(const ls_std::Float &_float) const {
+bool ls_std::Float::operator<=(const ls_std::Float &_float) const
+{
   return this->value <= _float;
 }
 
-bool ls_std::Float::operator<=(float _value) const {
+bool ls_std::Float::operator<=(float _value) const
+{
   return this->value <= _value;
 }
 
-void ls_std::Float::operator++() {
+void ls_std::Float::operator++()
+{
   this->value += 1.0f;
 }
 
-void ls_std::Float::operator--() {
-  this->value -= 1.0f;
-}
-
-ls_std::byte_field ls_std::Float::load()
+void ls_std::Float::operator--()
 {
-  ls_std::byte_field data {};
-
-  if(this->storable != nullptr && this->serializable != nullptr) {
-    data = this->storable->load();
-    this->serializable->unmarshal(data);
-  }
-
-  return data;
+  this->value -= 1.0f;
 }
 
-ls_std::byte_field ls_std::Float::marshal()
+void ls_std::Float::parse(std::string _parseText)
 {
-  ls_std::byte_field data {};
-
-  if(this->serializable != nullptr) {
-    data = this->serializable->marshal();
-  }
-
-  return data;
-}
-
-void ls_std::Float::parse(std::string _parseText) {
   this->value = std::stof(_parseText);
 }
 
-void ls_std::Float::save(const ls_std::byte_field& _data)
+std::string ls_std::Float::toString()
 {
-  if(this->serializable != nullptr) {
-    if(_data.empty()) {
-      this->storable->save(this->serializable->marshal());
-    } else {
-      this->storable->save(_data);
-    }
-  }
-}
-
-std::string ls_std::Float::toString() {
   return std::to_string(this->value);
 }
 
-void ls_std::Float::unmarshal(const ls_std::byte_field& _data)
+float ls_std::Float::getEpsilon()
 {
-  if(this->serializable != nullptr) {
-    this->serializable->unmarshal(_data);
-  }
-}
-
-float ls_std::Float::getEpsilon() {
   return this->epsilon;
 }
 
-float ls_std::Float::getValue() {
+float ls_std::Float::getValue()
+{
   return this->value;
 }
 
-void ls_std::Float::setEpsilon(float _epsilon) {
-  this->epsilon = _epsilon;
+void ls_std::Float::setEpsilon(float _epsilon)
+{
+  this->_assignEpsilon(_epsilon);
 }
 
-void ls_std::Float::setSerializable(std::shared_ptr<ISerializable> _serializable) {
-  this->serializable = std::move(_serializable);
-}
+void ls_std::Float::_assignEpsilon(float _epsilon)
+{
+  if (_epsilon <= 0.0)
+  {
+    throw ls_std::IllegalArgumentException{};
+  }
 
-void ls_std::Float::setStorable(std::shared_ptr<IStorable> _storable) {
-  this->storable = std::move(_storable);
+  this->epsilon = _epsilon;
 }

+ 26 - 71
source/ls_std/boxing/Integer.cpp

@@ -3,15 +3,16 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-07
- * Changed:         2020-11-26
+ * Changed:         2021-07-14
  *
  * */
 
 #include <ls_std/boxing/Integer.hpp>
 #include <ls_std/exception/IllegalArithmeticOperationException.hpp>
 
-ls_std::Integer::Integer(int _value) : ls_std::Class("Integer"),
-value(_value)
+ls_std::Integer::Integer(int _value)
+    : ls_std::Class("Integer"),
+      value(_value)
 {}
 
 ls_std::Integer::Integer() : ls_std::Class("Integer")
@@ -22,7 +23,7 @@ ls_std::Integer::operator int() const
   return this->value;
 }
 
-ls_std::Integer& ls_std::Integer::operator=(int _value)
+ls_std::Integer &ls_std::Integer::operator=(int _value)
 {
   this->value = _value;
   return *this;
@@ -65,8 +66,9 @@ int ls_std::Integer::operator-(int _value) const
 
 int ls_std::Integer::operator/(const ls_std::Integer &_integer) const
 {
-  if(_integer == 0) {
-    throw ls_std::IllegalArithmeticOperationException {};
+  if (_integer == 0)
+  {
+    throw ls_std::IllegalArithmeticOperationException{};
   }
 
   return this->value / _integer;
@@ -74,8 +76,9 @@ int ls_std::Integer::operator/(const ls_std::Integer &_integer) const
 
 int ls_std::Integer::operator/(int _value) const
 {
-  if(_value == 0) {
-    throw ls_std::IllegalArithmeticOperationException {};
+  if (_value == 0)
+  {
+    throw ls_std::IllegalArithmeticOperationException{};
   }
 
   return this->value / _value;
@@ -91,56 +94,58 @@ int ls_std::Integer::operator%(int _value) const
   return this->value % _value;
 }
 
-ls_std::Integer & ls_std::Integer::operator+=(const ls_std::Integer &_integer)
+ls_std::Integer &ls_std::Integer::operator+=(const ls_std::Integer &_integer)
 {
   this->value += _integer;
   return *this;
 }
 
-ls_std::Integer & ls_std::Integer::operator+=(int _value)
+ls_std::Integer &ls_std::Integer::operator+=(int _value)
 {
   this->value += _value;
   return *this;
 }
 
-ls_std::Integer & ls_std::Integer::operator-=(const ls_std::Integer &_integer)
+ls_std::Integer &ls_std::Integer::operator-=(const ls_std::Integer &_integer)
 {
   this->value -= _integer;
   return *this;
 }
 
-ls_std::Integer & ls_std::Integer::operator-=(int _value)
+ls_std::Integer &ls_std::Integer::operator-=(int _value)
 {
   this->value -= _value;
   return *this;
 }
 
-ls_std::Integer & ls_std::Integer::operator*=(const ls_std::Integer &_integer)
+ls_std::Integer &ls_std::Integer::operator*=(const ls_std::Integer &_integer)
 {
   this->value *= _integer;
   return *this;
 }
 
-ls_std::Integer & ls_std::Integer::operator*=(int _value)
+ls_std::Integer &ls_std::Integer::operator*=(int _value)
 {
   this->value *= _value;
   return *this;
 }
 
-ls_std::Integer & ls_std::Integer::operator/=(const ls_std::Integer &_integer)
+ls_std::Integer &ls_std::Integer::operator/=(const ls_std::Integer &_integer)
 {
-  if(_integer == 0) {
-    throw ls_std::IllegalArithmeticOperationException {};
+  if (_integer == 0)
+  {
+    throw ls_std::IllegalArithmeticOperationException{};
   }
 
   this->value /= _integer;
   return *this;
 }
 
-ls_std::Integer & ls_std::Integer::operator/=(int _value)
+ls_std::Integer &ls_std::Integer::operator/=(int _value)
 {
-  if(_value == 0) {
-    throw ls_std::IllegalArithmeticOperationException {};
+  if (_value == 0)
+  {
+    throw ls_std::IllegalArithmeticOperationException{};
   }
 
   this->value /= _value;
@@ -247,67 +252,17 @@ void ls_std::Integer::operator--()
   this->value -= 1;
 }
 
-ls_std::byte_field ls_std::Integer::load()
-{
-  ls_std::byte_field data {};
-
-  if(this->storable != nullptr && this->serializable != nullptr) {
-    data = this->storable->load();
-    this->serializable->unmarshal(data);
-  }
-
-  return data;
-}
-
-ls_std::byte_field ls_std::Integer::marshal()
-{
-  ls_std::byte_field data {};
-
-  if(this->serializable != nullptr) {
-    data = this->serializable->marshal();
-  }
-
-  return data;
-}
-
 void ls_std::Integer::parse(std::string _parseText)
 {
   this->value = std::stoi(_parseText);
 }
 
-void ls_std::Integer::save(const ls_std::byte_field& _data)
-{
-  if(this->serializable != nullptr) {
-    if(_data.empty()) {
-      this->storable->save(this->serializable->marshal());
-    } else {
-      this->storable->save(_data);
-    }
-  }
-}
-
 std::string ls_std::Integer::toString()
 {
   return std::to_string(this->value);
 }
 
-void ls_std::Integer::unmarshal(const ls_std::byte_field& _data)
+int ls_std::Integer::getValue() const
 {
-  if(this->serializable != nullptr) {
-    this->serializable->unmarshal(_data);
-  }
-}
-
-int ls_std::Integer::getValue() const {
   return this->value;
 }
-
-void ls_std::Integer::setSerializable(std::shared_ptr<ISerializable> _serializable)
-{
-  this->serializable = std::move(_serializable);
-}
-
-void ls_std::Integer::setStorable(std::shared_ptr<IStorable> _storable)
-{
-  this->storable = std::move(_storable);
-}

+ 27 - 70
source/ls_std/boxing/Long.cpp

@@ -3,15 +3,16 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2020-11-26
+ * Changed:         2021-07-14
  *
  * */
 
 #include <ls_std/boxing/Long.hpp>
 #include <ls_std/exception/IllegalArithmeticOperationException.hpp>
 
-ls_std::Long::Long(ls_std::long_type _value) : ls_std::Class("Long"),
-value(_value)
+ls_std::Long::Long(ls_std::long_type _value)
+    : ls_std::Class("Long"),
+      value(_value)
 {}
 
 ls_std::Long::Long() : ls_std::Class("Long")
@@ -22,7 +23,7 @@ ls_std::Long::operator ls_std::long_type() const
   return this->value;
 }
 
-ls_std::Long& ls_std::Long::operator=(ls_std::long_type _value)
+ls_std::Long &ls_std::Long::operator=(ls_std::long_type _value)
 {
   this->value = _value;
   return *this;
@@ -65,8 +66,9 @@ ls_std::long_type ls_std::Long::operator-(ls_std::long_type _value) const
 
 ls_std::long_type ls_std::Long::operator/(const ls_std::Long &_long) const
 {
-  if(_long == (ls_std::long_type) 0) {
-    throw ls_std::IllegalArithmeticOperationException {};
+  if (_long == (ls_std::long_type) 0)
+  {
+    throw ls_std::IllegalArithmeticOperationException{};
   }
 
   return this->value / _long;
@@ -74,8 +76,9 @@ ls_std::long_type ls_std::Long::operator/(const ls_std::Long &_long) const
 
 ls_std::long_type ls_std::Long::operator/(ls_std::long_type _value) const
 {
-  if(_value == 0) {
-    throw ls_std::IllegalArithmeticOperationException {};
+  if (_value == 0)
+  {
+    throw ls_std::IllegalArithmeticOperationException{};
   }
 
   return this->value / _value;
@@ -91,56 +94,58 @@ ls_std::long_type ls_std::Long::operator%(ls_std::long_type _value) const
   return this->value % _value;
 }
 
-ls_std::Long & ls_std::Long::operator+=(const ls_std::Long &_long)
+ls_std::Long &ls_std::Long::operator+=(const ls_std::Long &_long)
 {
   this->value += _long;
   return *this;
 }
 
-ls_std::Long & ls_std::Long::operator+=(ls_std::long_type _value)
+ls_std::Long &ls_std::Long::operator+=(ls_std::long_type _value)
 {
   this->value += _value;
   return *this;
 }
 
-ls_std::Long & ls_std::Long::operator-=(const ls_std::Long &_long)
+ls_std::Long &ls_std::Long::operator-=(const ls_std::Long &_long)
 {
   this->value -= _long;
   return *this;
 }
 
-ls_std::Long & ls_std::Long::operator-=(ls_std::long_type _value)
+ls_std::Long &ls_std::Long::operator-=(ls_std::long_type _value)
 {
   this->value -= _value;
   return *this;
 }
 
-ls_std::Long & ls_std::Long::operator*=(const ls_std::Long &_long)
+ls_std::Long &ls_std::Long::operator*=(const ls_std::Long &_long)
 {
   this->value *= _long;
   return *this;
 }
 
-ls_std::Long & ls_std::Long::operator*=(ls_std::long_type _value)
+ls_std::Long &ls_std::Long::operator*=(ls_std::long_type _value)
 {
   this->value *= _value;
   return *this;
 }
 
-ls_std::Long & ls_std::Long::operator/=(const ls_std::Long &_long)
+ls_std::Long &ls_std::Long::operator/=(const ls_std::Long &_long)
 {
-  if(_long == (ls_std::long_type) 0) {
-    throw ls_std::IllegalArithmeticOperationException {};
+  if (_long == (ls_std::long_type) 0)
+  {
+    throw ls_std::IllegalArithmeticOperationException{};
   }
 
   this->value /= _long;
   return *this;
 }
 
-ls_std::Long & ls_std::Long::operator/=(ls_std::long_type _value)
+ls_std::Long &ls_std::Long::operator/=(ls_std::long_type _value)
 {
-  if(_value == 0) {
-    throw ls_std::IllegalArithmeticOperationException {};
+  if (_value == 0)
+  {
+    throw ls_std::IllegalArithmeticOperationException{};
   }
 
   this->value /= _value;
@@ -247,43 +252,9 @@ void ls_std::Long::operator--()
   this->value -= 1;
 }
 
-ls_std::byte_field ls_std::Long::load()
-{
-  ls_std::byte_field data {};
-
-  if(this->storable != nullptr && this->serializable != nullptr) {
-    data = this->storable->load();
-    this->serializable->unmarshal(data);
-  }
-
-  return data;
-}
-
-ls_std::byte_field ls_std::Long::marshal()
-{
-  ls_std::byte_field data {};
-
-  if(this->serializable != nullptr) {
-    data = this->serializable->marshal();
-  }
-
-  return data;
-}
-
 void ls_std::Long::parse(std::string _parseText)
 {
-  this->value = std::stoi(_parseText);
-}
-
-void ls_std::Long::save(const ls_std::byte_field& _data)
-{
-  if(this->serializable != nullptr) {
-    if(_data.empty()) {
-      this->storable->save(this->serializable->marshal());
-    } else {
-      this->storable->save(_data);
-    }
-  }
+  this->value = std::stoll(_parseText);
 }
 
 std::string ls_std::Long::toString()
@@ -291,21 +262,7 @@ std::string ls_std::Long::toString()
   return std::to_string(this->value);
 }
 
-void ls_std::Long::unmarshal(const ls_std::byte_field& _data)
+ls_std::long_type ls_std::Long::getValue() const
 {
-  if(this->serializable != nullptr) {
-    this->serializable->unmarshal(_data);
-  }
-}
-
-ls_std::long_type ls_std::Long::getValue() const {
   return this->value;
 }
-
-void ls_std::Long::setSerializable(std::shared_ptr<ISerializable> _serializable) {
-  this->serializable = std::move(_serializable);
-}
-
-void ls_std::Long::setStorable(std::shared_ptr<IStorable> _storable) {
-  this->storable = std::move(_storable);
-}

+ 69 - 81
source/ls_std/boxing/String.cpp

@@ -3,142 +3,128 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2020-11-26
+ * Changed:         2021-07-12
  *
  * */
 
 #include <algorithm>
 #include <ls_std/boxing/String.hpp>
+#include <ls_std/exception/IllegalArgumentException.hpp>
 
 ls_std::String::String() : ls_std::Class("String")
 {}
 
-ls_std::String::String(std::string _value) : ls_std::Class("String"),
-value(std::move(_value))
+ls_std::String::String(std::string _value)
+    : ls_std::Class("String"),
+      value(std::move(_value))
 {}
 
-ls_std::String::operator const char*() const {
+ls_std::String::operator const char *() const
+{
   return this->value.c_str();
 }
 
-ls_std::String::operator std::string() const {
+ls_std::String::operator std::string() const
+{
   return this->value;
 }
 
-ls_std::String & ls_std::String::operator=(std::string _value) {
+ls_std::String &ls_std::String::operator=(std::string _value)
+{
   this->value = std::move(_value);
   return *this;
 }
 
-std::string ls_std::String::operator+(ls_std::String _string) const {
+std::string ls_std::String::operator+(ls_std::String _string) const
+{
   return this->value + _string.toString();
 }
 
-std::string ls_std::String::operator+(const std::string& _string) const {
+std::string ls_std::String::operator+(const std::string &_string) const
+{
   return this->value + _string;
 }
 
-std::string ls_std::String::operator+(const char *_string) const {
+std::string ls_std::String::operator+(const char *_string) const
+{
   return this->value + _string;
 }
 
-std::string ls_std::String::operator-(int _number) {
+std::string ls_std::String::operator-(int _number)
+{
   std::string copy = this->value;
   return copy.substr(0, copy.size() - _number);
 }
 
-ls_std::String & ls_std::String::operator+=(ls_std::String _string) {
+ls_std::String &ls_std::String::operator+=(ls_std::String _string)
+{
   this->value = this->value + _string.toString();
   return *this;
 }
 
-ls_std::String & ls_std::String::operator+=(const std::string &_text) {
+ls_std::String &ls_std::String::operator+=(const std::string &_text)
+{
   this->value = this->value + _text;
   return *this;
 }
 
-bool ls_std::String::operator==(ls_std::String _string) {
+bool ls_std::String::operator==(ls_std::String _string)
+{
   return this->value == _string.toString();
 }
 
-bool ls_std::String::operator==(const std::string& _value) {
+bool ls_std::String::operator==(const std::string &_value)
+{
   return this->value == _value;
 }
 
-bool ls_std::String::operator==(const char *_value) {
+bool ls_std::String::operator==(const char *_value)
+{
   return this->value == _value;
 }
 
-bool ls_std::String::operator!=(ls_std::String _string) {
+bool ls_std::String::operator!=(ls_std::String _string)
+{
   return this->value != _string.toString();
 }
 
-bool ls_std::String::operator!=(const std::string& _value) {
+bool ls_std::String::operator!=(const std::string &_value)
+{
   return this->value != _value;
 }
 
-bool ls_std::String::operator!=(const char *_value) {
+bool ls_std::String::operator!=(const char *_value)
+{
   return this->value != _value;
 }
 
-ls_std::byte_field ls_std::String::load() {
-  ls_std::byte_field data {};
-
-  if(this->storable != nullptr && this->serializable != nullptr) {
-    data = this->storable->load();
-    this->serializable->unmarshal(data);
-  }
-
-  return data;
-}
-
-ls_std::byte_field ls_std::String::marshal() {
-  ls_std::byte_field data {};
-
-  if(this->serializable != nullptr) {
-    data = this->serializable->marshal();
-  }
-
-  return data;
-}
-
-void ls_std::String::parse(std::string _parseText) {
+void ls_std::String::parse(std::string _parseText)
+{
   this->value = std::move(_parseText);
 }
 
-void ls_std::String::save(const ls_std::byte_field &_data) {
-  if(this->serializable != nullptr) {
-    if(_data.empty()) {
-      this->storable->save(this->serializable->marshal());
-    } else {
-      this->storable->save(_data);
-    }
-  }
-}
-
-std::string ls_std::String::toString() {
+std::string ls_std::String::toString()
+{
   return this->value;
 }
 
-void ls_std::String::unmarshal(const ls_std::byte_field &_data) {
-  if(this->serializable != nullptr) {
-    this->serializable->unmarshal(_data);
-  }
-}
-
-bool ls_std::String::contains(const std::string& _text) {
+bool ls_std::String::contains(const std::string &_text)
+{
   return this->value.find(_text) != std::string::npos;
 }
 
-bool ls_std::String::endsWith(const std::string &_text) {
+bool ls_std::String::endsWith(const std::string &_text)
+{
   return this->value.rfind(_text) == (this->value.size() - _text.size());
 }
 
-bool ls_std::String::equalsIgnoreCase(ls_std::String _string) {
+bool ls_std::String::equalsIgnoreCase(ls_std::String _string)
+{
   return this->toLowerCase() == _string.toLowerCase();
 }
 
-bool ls_std::String::equalsIgnoreCase(std::string _text) {
+bool ls_std::String::equalsIgnoreCase(std::string _text)
+{
   return this->toLowerCase() == ls_std::String{std::move(_text)}.toLowerCase();
 }
 
@@ -150,62 +136,64 @@ std::vector<ls_std::byte> ls_std::String::getByteData()
   return byteData;
 }
 
-std::string ls_std::String::padLeft(size_t _width, const char _fillCharacter) {
+std::string ls_std::String::padLeft(size_t _width, const char _fillCharacter)
+{
   return ls_std::String::_createFillContent(this->value, _width, _fillCharacter) + this->value;
 }
 
-std::string ls_std::String::padRight(size_t _width, const char _fillCharacter) {
+std::string ls_std::String::padRight(size_t _width, const char _fillCharacter)
+{
   return this->value + ls_std::String::_createFillContent(this->value, _width, _fillCharacter);
 }
 
-std::string ls_std::String::reverse() {
+std::string ls_std::String::reverse()
+{
   std::string copy = this->value;
   std::reverse(copy.begin(), copy.end());
 
   return copy;
 }
 
-void ls_std::String::setSerializable(std::shared_ptr<ISerializable> _serializable) {
-  this->serializable = std::move(_serializable);
-}
-
-void ls_std::String::setStorable(std::shared_ptr<IStorable> _storable) {
-  this->storable = std::move(_storable);
-}
-
-bool ls_std::String::startsWith(const std::string &_text) {
+bool ls_std::String::startsWith(const std::string &_text)
+{
   return this->value.rfind(_text, 0) == 0;
 }
 
-std::string ls_std::String::toLowerCase() {
+std::string ls_std::String::toLowerCase()
+{
   std::string copy = this->value;
   std::transform(copy.begin(), copy.end(), copy.begin(), ::tolower);
 
   return copy;
 }
 
-std::string ls_std::String::toUpperCase() {
+std::string ls_std::String::toUpperCase()
+{
   std::string copy = this->value;
   std::transform(copy.begin(), copy.end(), copy.begin(), ::toupper);
 
   return copy;
 }
 
-std::string ls_std::String::_buildCharacterChain(size_t _amount, const char _fillCharacter) {
-  std::string fillContent {};
+std::string ls_std::String::_buildCharacterChain(size_t _amount, const char _fillCharacter)
+{
+  std::string fillContent{};
 
-  for(size_t iteration {} ; iteration < _amount ; iteration++) {
+  for (size_t iteration{}; iteration < _amount; iteration++)
+  {
     fillContent += _fillCharacter;
   }
 
   return fillContent;
 }
 
-std::string ls_std::String::_createFillContent(const std::string& _text, size_t _width, const char _fillCharacter) {
+std::string ls_std::String::_createFillContent(const std::string &_text, size_t _width, const char _fillCharacter)
+{
   size_t fillSize = _text.size() > _width ? 0 : _width - _text.size();
-  std::string fillContent {};
+  std::string fillContent{};
 
-  if(fillSize > 0) {
+  if (fillSize > 0)
+  {
     fillContent = ls_std::String::_buildCharacterChain(fillSize, _fillCharacter);
   }
 

+ 15 - 34
source/ls_std/event/Event.cpp

@@ -3,41 +3,28 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-26
- * Changed:         2020-12-23
+ * Changed:         2021-07-14
  *
  * */
 
 #include <ls_std/event/Event.hpp>
 #include <ls_std/exception/IllegalArgumentException.hpp>
 
-ls_std::Event::Event(const ls_std::event_id& _id) : ls_std::Class("Event")
+ls_std::Event::Event(const ls_std::event_id &_id) : ls_std::Class("Event")
 {
   this->_assignId(_id);
 }
 
-ls_std::byte_field ls_std::Event::marshal()
+bool ls_std::Event::addParameter(const ls_std::event_parameter &_eventParameter)
 {
-  ls_std::byte_field data {};
+  bool wasAdded{};
 
-  if(this->serializable != nullptr) {
-    data = this->serializable->marshal();
+  if (!this->_hasParameter(_eventParameter.first))
+  {
+    wasAdded = this->parameterList.insert(_eventParameter).second;
   }
 
-  return data;
-}
-
-void ls_std::Event::unmarshal(const ls_std::byte_field &_data)
-{
-  if(this->serializable != nullptr) {
-    this->serializable->unmarshal(_data);
-  }
-}
-
-void ls_std::Event::addParameter(const ls_std::event_parameter &_eventParameter)
-{
-  if(!this->_hasParameter(_eventParameter.first)) {
-    this->parameterList.insert(_eventParameter);
-  }
+  return wasAdded;
 }
 
 void ls_std::Event::clearParameterList()
@@ -55,22 +42,21 @@ ls_std::event_parameter_list ls_std::Event::getParameterList()
   return this->parameterList;
 }
 
-void ls_std::Event::removeParameter(const ls_std::event_parameter_id &_id)
+bool ls_std::Event::removeParameter(const ls_std::event_parameter_id &_id)
 {
-  if(this->_hasParameter(_id)) {
-    this->parameterList.erase(_id);
-  }
+  return this->parameterList.erase(_id) == 1;
 }
 
-void ls_std::Event::setId(const ls_std::event_id&  _id)
+void ls_std::Event::setId(const ls_std::event_id &_id)
 {
   this->_assignId(_id);
 }
 
-void ls_std::Event::_assignId(const ls_std::event_id& _id)
+void ls_std::Event::_assignId(const ls_std::event_id &_id)
 {
-  if(_id.empty()) {
-    throw ls_std::IllegalArgumentException {};
+  if (_id.empty())
+  {
+    throw ls_std::IllegalArgumentException{};
   }
 
   this->id = _id;
@@ -80,8 +66,3 @@ bool ls_std::Event::_hasParameter(const ls_std::event_id &_id)
 {
   return this->parameterList.find(_id) != this->parameterList.end();
 }
-
-void ls_std::Event::setSerializable(std::shared_ptr<ISerializable> _serializable)
-{
-  this->serializable = std::move(_serializable);
-}

+ 16 - 4
source/ls_std/event/EventHandler.cpp

@@ -3,17 +3,29 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2020-11-28
+ * Changed:         2021-05-27
  *
  * */
 
 #include <ls_std/event/EventHandler.hpp>
+#include <ls_std/exception/IllegalArgumentException.hpp>
 
-ls_std::EventHandler::EventHandler(ls_std::event_id  _id) : ls_std::Narrator(),
-id(std::move(_id))
-{}
+ls_std::EventHandler::EventHandler(const ls_std::event_id& _id) : ls_std::Narrator()
+{
+  this->_assignId(_id);
+}
 
 ls_std::event_id ls_std::EventHandler::getId()
 {
   return this->id;
 }
+
+void ls_std::EventHandler::_assignId(const ls_std::event_id &_id)
+{
+  if (_id.empty())
+  {
+    throw ls_std::IllegalArgumentException{};
+  }
+
+  this->id = _id;
+}

+ 62 - 13
source/ls_std/event/EventManager.cpp

@@ -3,47 +3,96 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2020-11-29
+ * Changed:         2021-05-27
  *
  * */
 
 #include <ls_std/event/EventManager.hpp>
+#include <ls_std/exception/EventNotSubscribedException.hpp>
+#include <ls_std/exception/EventNotHandledException.hpp>
+#include <ls_std/exception/IllegalArgumentException.hpp>
 
 ls_std::EventManager::EventManager() : ls_std::Class("EventManager")
 {}
 
-void ls_std::EventManager::subscribe(const ls_std::event_id &_id, const std::shared_ptr<IListener> &_listener)
+void ls_std::EventManager::subscribe(const ls_std::event_id &_id, const std::shared_ptr<ls_std::IListener> &_listener)
 {
-  if(this->_hasEventHandler(_id)) {
+  if (_id.empty() || _listener == nullptr)
+  {
+    throw ls_std::IllegalArgumentException{};
+  }
+
+  if (this->_hasEventHandler(_id))
+  {
     this->eventHandlers.at(_id)->addListener(_listener);
   }
+  else
+  {
+    throw ls_std::EventNotSubscribedException{};
+  }
 }
 
-void ls_std::EventManager::unsubscribe(const ls_std::event_id &_id, const std::shared_ptr<IListener> &_listener)
+void ls_std::EventManager::unsubscribe(const ls_std::event_id &_id, const std::shared_ptr<ls_std::IListener> &_listener)
 {
-  if(this->_hasEventHandler(_id)) {
+  if (_id.empty() || _listener == nullptr)
+  {
+    throw ls_std::IllegalArgumentException{};
+  }
+
+  if (this->_hasEventHandler(_id))
+  {
     this->eventHandlers.at(_id)->removeListener(_listener);
   }
 }
 
-void ls_std::EventManager::addEventHandler(const std::shared_ptr<ls_std::EventHandler> &_eventHandler)
+bool ls_std::EventManager::addEventHandler(const std::shared_ptr<ls_std::EventHandler> &_eventHandler)
 {
-  if(!this->_hasEventHandler(_eventHandler->getId())) {
+  bool wasAdded{};
+
+  if (_eventHandler == nullptr)
+  {
+    throw ls_std::IllegalArgumentException{};
+  }
+
+  if (!this->_hasEventHandler(_eventHandler->getId()))
+  {
     std::pair<ls_std::event_id, std::shared_ptr<ls_std::EventHandler>> element = std::make_pair(_eventHandler->getId(), _eventHandler);
-    this->eventHandlers.insert(element);
+    wasAdded = this->eventHandlers.insert(element).second;
   }
+
+  return wasAdded;
 }
 
 void ls_std::EventManager::fire(ls_std::Event _event)
 {
-  if(this->_hasEventHandler(_event.getId())) {
+  if (this->_hasEventHandler(_event.getId()))
+  {
     this->eventHandlers.at(_event.getId())->tell(_event);
   }
+  else
+  {
+    throw ls_std::EventNotHandledException{};
+  }
+}
+
+bool ls_std::EventManager::hasEventHandler(const ls_std::event_id &_id)
+{
+  if (_id.empty())
+  {
+    throw ls_std::IllegalArgumentException{};
+  }
+
+  return this->_hasEventHandler(_id);
 }
 
-void ls_std::EventManager::removeEventHandler(const std::shared_ptr<ls_std::EventHandler> &_eventHandler)
+bool ls_std::EventManager::removeEventHandler(const std::shared_ptr<ls_std::EventHandler> &_eventHandler)
 {
-  this->_removeEventHandler(_eventHandler);
+  if (_eventHandler == nullptr)
+  {
+    throw ls_std::IllegalArgumentException{};
+  }
+
+  return this->_removeEventHandler(_eventHandler);
 }
 
 bool ls_std::EventManager::_hasEventHandler(const ls_std::event_id &_id)
@@ -51,7 +100,7 @@ bool ls_std::EventManager::_hasEventHandler(const ls_std::event_id &_id)
   return this->eventHandlers.find(_id) != this->eventHandlers.end();
 }
 
-void ls_std::EventManager::_removeEventHandler(const std::shared_ptr<ls_std::EventHandler> &_eventHandler)
+bool ls_std::EventManager::_removeEventHandler(const std::shared_ptr<ls_std::EventHandler> &_eventHandler)
 {
-  this->eventHandlers.erase(_eventHandler->getId());
+  return this->eventHandlers.erase(_eventHandler->getId()) == 1;
 }

+ 234 - 108
source/ls_std/io/File.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-15
- * Changed:         2020-11-26
+ * Changed:         2021-09-26
  *
  * */
 
@@ -18,15 +18,21 @@
 #include <sys/stat.h>
 
 #if defined(unix) || defined(__APPLE__)
+
 #include <unistd.h>
+
 #endif
 
 #ifdef _WIN32
+
 #include <direct.h>
+#include <tchar.h>
+
 #endif
 
-ls_std::File::File(std::string _absoluteFilePath) : ls_std::Class("File"),
-absoluteFilePath(ls_std::File::_normalizePath(std::move(_absoluteFilePath)))
+ls_std::File::File(std::string _absoluteFilePath)
+    : ls_std::Class("File"),
+      absoluteFilePath(ls_std::File::_normalizePath(std::move(_absoluteFilePath)))
 {}
 
 bool ls_std::File::operator==(ls_std::File &_file)
@@ -49,10 +55,10 @@ bool ls_std::File::canRead()
   bool readable;
 
   #if defined(unix) || defined(__APPLE__)
-    readable = ls_std::File::_isReadableUnix(this->absoluteFilePath);
+  readable = ls_std::File::_isReadableUnix(this->absoluteFilePath);
   #endif
   #ifdef _WIN32
-    readable = ls_std::File::_isReadableWindows(this->absoluteFilePath);
+  readable = ls_std::File::_isReadableWindows(this->absoluteFilePath);
   #endif
 
   return readable;
@@ -65,10 +71,13 @@ bool ls_std::File::canWrite()
 
 void ls_std::File::createNewFile()
 {
-  if(!ls_std::File::_exists(this->absoluteFilePath)) {
-    std::ofstream file {this->absoluteFilePath};
+  if (!ls_std::File::_exists(this->absoluteFilePath))
+  {
+    std::ofstream file{this->absoluteFilePath};
     file.close();
-  } else {
+  }
+  else
+  {
     throw ls_std::FileOperationException{};
   }
 }
@@ -78,7 +87,8 @@ bool ls_std::File::exists()
   return ls_std::File::_exists(this->absoluteFilePath);
 }
 
-std::string ls_std::File::getAbsoluteFilePath() {
+std::string ls_std::File::getAbsoluteFilePath()
+{
   return this->absoluteFilePath;
 }
 
@@ -88,14 +98,15 @@ std::string ls_std::File::getName()
 
   // if it's a directory, remove separator from end, if it does exist
 
-  if(ls_std::File::_isDirectory(this->absoluteFilePath)) {
+  if (ls_std::File::_isDirectory(this->absoluteFilePath))
+  {
     copy.erase(std::remove_if(copy.end() - 1, copy.end(), ls_std::FilePathSeparatorMatch()), copy.end());
   }
 
   // now get the file / directory name
 
   auto base = std::find_if(copy.rbegin(), copy.rend(), ls_std::FilePathSeparatorMatch()).base();
-  return std::string(base, copy.end());
+  return std::string{base, copy.end()};
 }
 
 std::string ls_std::File::getParent()
@@ -103,11 +114,26 @@ std::string ls_std::File::getParent()
   return ls_std::File::_getParent(this->absoluteFilePath);
 }
 
+std::string ls_std::File::getWorkingDirectory()
+{
+  std::string workingDirectory{};
+
+  #if defined(unix) || defined(__APPLE__)
+  workingDirectory = ls_std::File::_getWorkingDirectoryUnix();
+  #endif
+  #ifdef _WIN32
+  workingDirectory = ls_std::File::_getWorkingDirectoryWindows();
+  #endif
+
+  return workingDirectory;
+}
+
 long ls_std::File::getSize()
 {
-  std::streampos fileSize {};
+  std::streampos fileSize{};
 
-  if(ls_std::File::_exists(this->absoluteFilePath)) {
+  if (ls_std::File::_exists(this->absoluteFilePath))
+  {
     std::ifstream fileHandler{this->absoluteFilePath, std::ios::in};
     fileSize = fileHandler.tellg();
     fileHandler.seekg(0, std::ios::end);
@@ -115,7 +141,7 @@ long ls_std::File::getSize()
     fileHandler.close();
   }
 
-  return fileSize;
+  return (long) fileSize;
 }
 
 bool ls_std::File::isDirectory()
@@ -135,9 +161,10 @@ time_t ls_std::File::lastModified()
 
 std::list<std::string> ls_std::File::list()
 {
-  std::list<std::string> fileList {};
+  std::list<std::string> fileList{};
 
-  if(ls_std::File::_isDirectory(this->absoluteFilePath)) {
+  if (ls_std::File::_isDirectory(this->absoluteFilePath))
+  {
     fileList = ls_std::File::_list(this->absoluteFilePath);
   }
 
@@ -146,9 +173,10 @@ std::list<std::string> ls_std::File::list()
 
 std::list<std::string> ls_std::File::listFiles()
 {
-  std::list<std::string> fileList {};
+  std::list<std::string> fileList{};
 
-  if(ls_std::File::_isDirectory(this->absoluteFilePath)) {
+  if (ls_std::File::_isDirectory(this->absoluteFilePath))
+  {
     fileList = ls_std::File::_listFiles(this->absoluteFilePath);
   }
 
@@ -157,20 +185,24 @@ std::list<std::string> ls_std::File::listFiles()
 
 void ls_std::File::makeDirectory()
 {
-  if(ls_std::File::_mkdir(this->absoluteFilePath)) {
-    throw ls_std::FileOperationException {};
+  if (ls_std::File::_mkdir(this->absoluteFilePath))
+  {
+    throw ls_std::FileOperationException{};
   }
 }
 
-void ls_std::File::makeDirectories() {
+void ls_std::File::makeDirectories()
+{
   std::vector<std::string> subDirectories = ls_std::File::_splitIntoSubDirectoryNames(this->absoluteFilePath);
   const char separator = ls_std::FilePathSeparator::get();
-  std::string currentHierarchy {};
+  std::string currentHierarchy{};
 
-  for(const auto& subDirectory : subDirectories) {
+  for (const auto &subDirectory: subDirectories)
+  {
     currentHierarchy += subDirectory;
 
-    if(!ls_std::File::_exists(currentHierarchy)) {
+    if (!ls_std::File::_exists(currentHierarchy))
+    {
       ls_std::File::_mkdir(currentHierarchy);
     }
 
@@ -180,13 +212,13 @@ void ls_std::File::makeDirectories() {
 
 void ls_std::File::remove()
 {
-  if(ls_std::File::_isFile(this->absoluteFilePath)) {
-    if(std::remove(this->absoluteFilePath.c_str())) {
-      throw ls_std::FileOperationException{};
-    }
+  if (ls_std::File::_isFile(this->absoluteFilePath))
+  {
+    std::remove(this->absoluteFilePath.c_str());
   }
 
-  if(ls_std::File::_isDirectory(this->absoluteFilePath)) {
+  if (ls_std::File::_isDirectory(this->absoluteFilePath))
+  {
     ls_std::File::_remove(this->absoluteFilePath);
   }
 }
@@ -195,7 +227,8 @@ bool ls_std::File::renameTo(const std::string &_newName)
 {
   bool renamed = ls_std::File::_renameTo(this->absoluteFilePath, _newName);
 
-  if(renamed) {
+  if (renamed)
+  {
     this->absoluteFilePath = _newName;
   }
 
@@ -208,42 +241,55 @@ void ls_std::File::reset(const std::string &_newPath)
 }
 
 #ifdef _WIN32
-void ls_std::File::_addToFileListWindows(const std::string& _path, bool _withDirectories, WIN32_FIND_DATA _data, std::list<std::string>& _list)
+
+void ls_std::File::_addToFileListWindows(const std::string &_path, bool _withDirectories, WIN32_FIND_DATA _data, std::list<std::string> &_list)
 {
   const char separator = ls_std::FilePathSeparator::get();
   std::string absolutePath = _path + separator + _data.cFileName;
 
-  if(_withDirectories) {
+  if (_withDirectories)
+  {
     _list.emplace_back(absolutePath);
-  } else {
-    if(ls_std::File::_isFile(absolutePath)) {
+  }
+  else
+  {
+    if (ls_std::File::_isFile(absolutePath))
+    {
       _list.emplace_back(absolutePath);
     }
   }
 }
+
 #endif
 
 #if defined(unix) || defined(__APPLE__)
-void ls_std::File::_addToFileListUnix(const std::string& _path, bool _withDirectories, dirent* directoryEntity, std::list<std::string>& _list)
+
+void ls_std::File::_addToFileListUnix(const std::string &_path, bool _withDirectories, dirent *directoryEntity, std::list<std::string> &_list)
 {
   const char separator = ls_std::FilePathSeparator::get();
   std::string absolutePath = _path + separator + directoryEntity->d_name;
 
-  if(_withDirectories) {
+  if (_withDirectories)
+  {
     _list.emplace_back(absolutePath);
-  } else {
-    if(ls_std::File::_isFile(absolutePath)) {
+  }
+  else
+  {
+    if (ls_std::File::_isFile(absolutePath))
+    {
       _list.emplace_back(absolutePath);
     }
   }
 }
+
 #endif
 
 bool ls_std::File::_equals(ls_std::File &_file, ls_std::File &_foreignFile)
 {
   bool isEqual = _file.getAbsoluteFilePath() == _foreignFile.getAbsoluteFilePath();
 
-  if(_file.exists() && _foreignFile.exists()) {
+  if (_file.exists() && _foreignFile.exists())
+  {
     isEqual = isEqual && _file.canRead() == _foreignFile.canRead();
     isEqual = isEqual && _file.canWrite() == _foreignFile.canWrite();
     isEqual = isEqual && _file.canExecute() == _foreignFile.canExecute();
@@ -252,32 +298,76 @@ bool ls_std::File::_equals(ls_std::File &_file, ls_std::File &_foreignFile)
   return isEqual;
 }
 
-bool ls_std::File::_exists(const std::string& _path)
+bool ls_std::File::_exists(const std::string &_path)
 {
-  struct stat _stat {};
+  struct stat _stat{};
   return (stat(_path.c_str(), &_stat) == 0);
 }
 
 std::string ls_std::File::_getParent(const std::string &_path)
 {
-  std::string parent {};
+  std::string parent{};
   std::vector<std::string> subDirectoryNames = ls_std::File::_splitIntoSubDirectoryNames(_path);
   const char separator = ls_std::FilePathSeparator::get();
   subDirectoryNames.pop_back();
 
-  for(auto const& subDirectoryName : subDirectoryNames) {
+  for (auto const &subDirectoryName: subDirectoryNames)
+  {
     parent += subDirectoryName + separator;
   }
 
   return parent;
 }
 
-bool ls_std::File::_isDirectory(const std::string& _path)
+#if defined(unix) || defined(__APPLE__)
+
+std::string ls_std::File::_getWorkingDirectoryUnix()
+{
+  std::string workingDirectory{};
+  char buffer[PATH_MAX];
+
+  if (getcwd(buffer, sizeof(buffer)) == nullptr)
+  {
+    throw ls_std::FileOperationException{};
+  }
+  else
+  {
+    workingDirectory = std::string(buffer);
+  }
+
+  return workingDirectory;
+}
+
+#endif
+
+#ifdef _WIN32
+
+std::string ls_std::File::_getWorkingDirectoryWindows()
 {
-  bool match {};
-  struct stat _stat {};
+  std::string workingDirectory{};
+  TCHAR buffer[MAX_PATH];
 
-  if(stat(_path.c_str(), &_stat) == 0) {
+  if (!GetCurrentDirectory(MAX_PATH, buffer))
+  {
+    throw ls_std::FileOperationException{};
+  }
+  else
+  {
+    workingDirectory = std::string(buffer);
+  }
+
+  return workingDirectory;
+}
+
+#endif
+
+bool ls_std::File::_isDirectory(const std::string &_path)
+{
+  bool match{};
+  struct stat _stat{};
+
+  if (stat(_path.c_str(), &_stat) == 0)
+  {
     match = _stat.st_mode & (unsigned short) S_IFDIR;
   }
 
@@ -286,12 +376,14 @@ bool ls_std::File::_isDirectory(const std::string& _path)
 
 bool ls_std::File::_isExecutable(const std::string &_path)
 {
-  bool executable {};
+  bool executable{};
 
-  if(ls_std::File::_exists(_path)) {
-    struct stat _stat {};
+  if (ls_std::File::_exists(_path))
+  {
+    struct stat _stat{};
 
-    if(stat(_path.c_str(), &_stat) == 0) {
+    if (stat(_path.c_str(), &_stat) == 0)
+    {
       executable = (_stat.st_mode & (unsigned short) S_IEXEC) != 0;
     }
   }
@@ -299,12 +391,13 @@ bool ls_std::File::_isExecutable(const std::string &_path)
   return executable;
 }
 
-bool ls_std::File::_isFile(const std::string& _path)
+bool ls_std::File::_isFile(const std::string &_path)
 {
-  bool match {};
-  struct stat _stat {};
+  bool match{};
+  struct stat _stat{};
 
-  if(stat(_path.c_str(), &_stat) == 0) {
+  if (stat(_path.c_str(), &_stat) == 0)
+  {
     match = _stat.st_mode & (unsigned) S_IFREG;
   }
 
@@ -312,47 +405,62 @@ bool ls_std::File::_isFile(const std::string& _path)
 }
 
 #if defined(unix) || defined(__APPLE__)
+
 bool ls_std::File::_isReadableUnix(const std::string &_path)
 {
-  bool readable {};
+  bool readable{};
 
-  if(ls_std::File::_exists(_path)) {
-    struct stat _stat {};
+  if (ls_std::File::_exists(_path))
+  {
+    struct stat _stat{};
 
-    if(stat(_path.c_str(), &_stat) == 0) {
+    if (stat(_path.c_str(), &_stat) == 0)
+    {
       readable = (_stat.st_mode & (unsigned) S_IREAD) != 0;
     }
   }
+  else
+  {
+    throw ls_std::FileOperationException{};
+  }
 
   return readable;
 }
+
 #endif
 
 #ifdef _WIN32
+
 bool ls_std::File::_isReadableWindows(const std::string &_path)
 {
   bool readable;
-  WIN32_FIND_DATA data {};
+  WIN32_FIND_DATA data{};
   HANDLE handleFind = FindFirstFile(_path.c_str(), &data);
 
-  if(handleFind != INVALID_HANDLE_VALUE) {
+  if (handleFind != INVALID_HANDLE_VALUE)
+  {
     readable = GetFileAttributes(data.cFileName) & (unsigned) FILE_ATTRIBUTE_READONLY;
-  } else {
-    throw ls_std::FileOperationException {};
+  }
+  else
+  {
+    throw ls_std::FileOperationException{};
   }
 
   return readable;
 }
+
 #endif
 
 bool ls_std::File::_isWritable(const std::string &_path)
 {
-  bool writable {};
+  bool writable{};
 
-  if(ls_std::File::_exists(_path)) {
-    struct stat _stat {};
+  if (ls_std::File::_exists(_path))
+  {
+    struct stat _stat{};
 
-    if(stat(_path.c_str(), &_stat) == 0) {
+    if (stat(_path.c_str(), &_stat) == 0)
+    {
       writable = (_stat.st_mode & (unsigned) S_IWRITE) != 0;
     }
   }
@@ -362,10 +470,11 @@ bool ls_std::File::_isWritable(const std::string &_path)
 
 time_t ls_std::File::_lastModified(const std::string &_path)
 {
-  time_t lastModifiedTimeStamp {};
-  struct stat _stat {};
+  time_t lastModifiedTimeStamp{};
+  struct stat _stat{};
 
-  if(stat(_path.c_str(), &_stat) == 0) {
+  if (stat(_path.c_str(), &_stat) == 0)
+  {
     lastModifiedTimeStamp = _stat.st_mtime;
   }
 
@@ -374,13 +483,13 @@ time_t ls_std::File::_lastModified(const std::string &_path)
 
 std::list<std::string> ls_std::File::_list(const std::string &_path)
 {
-  std::list<std::string> filesInDirectory {};
+  std::list<std::string> filesInDirectory{};
 
   #if defined(unix) || defined(__APPLE__)
-    filesInDirectory = ls_std::File::_listUnix(_path, true);
+  filesInDirectory = ls_std::File::_listUnix(_path, true);
   #endif
   #ifdef _WIN32
-    filesInDirectory = ls_std::File::_listWindows(_path, true);
+  filesInDirectory = ls_std::File::_listWindows(_path, true);
   #endif
 
   return filesInDirectory;
@@ -388,65 +497,72 @@ std::list<std::string> ls_std::File::_list(const std::string &_path)
 
 std::list<std::string> ls_std::File::_listFiles(const std::string &_path)
 {
-  std::list<std::string> filesInDirectory {};
+  std::list<std::string> filesInDirectory{};
 
   #if defined(unix) || defined(__APPLE__)
-    filesInDirectory = ls_std::File::_listUnix(_path, false);
+  filesInDirectory = ls_std::File::_listUnix(_path, false);
   #endif
   #ifdef _WIN32
-    filesInDirectory = ls_std::File::_listWindows(_path, false);
+  filesInDirectory = ls_std::File::_listWindows(_path, false);
   #endif
 
   return filesInDirectory;
 }
 
 #if defined(unix) || defined(__APPLE__)
+
 std::list<std::string> ls_std::File::_listUnix(const std::string &_path, bool withDirectories)
 {
-  std::list<std::string> filesInDirectory {};
-  DIR* directory = opendir(_path.c_str());
-  struct dirent* directoryEntity;
-  std::string absolutePath {};
+  std::list<std::string> filesInDirectory{};
+  DIR *directory = opendir(_path.c_str());
+  struct dirent *directoryEntity;
+  std::string absolutePath{};
 
-  while((directoryEntity = readdir(directory)) != nullptr) {
+  while ((directoryEntity = readdir(directory)) != nullptr)
+  {
     ls_std::File::_addToFileListUnix(_path, withDirectories, directoryEntity, filesInDirectory);
   }
 
   closedir(directory);
   return filesInDirectory;
 }
+
 #endif
 
 #ifdef _WIN32
+
 std::list<std::string> ls_std::File::_listWindows(const std::string &_path, bool withDirectories)
 {
-  std::list<std::string> filesInDirectory {};
-  WIN32_FIND_DATA data {};
+  std::list<std::string> filesInDirectory{};
+  WIN32_FIND_DATA data{};
   HANDLE hFind;
-  std::string pattern {_path + ls_std::FilePathSeparator::get() + "*"};
+  std::string pattern{_path + ls_std::FilePathSeparator::get() + "*"};
 
-  if((hFind = FindFirstFile(pattern.c_str(), &data)) != INVALID_HANDLE_VALUE) {
-    do {
+  if ((hFind = FindFirstFile(pattern.c_str(), &data)) != INVALID_HANDLE_VALUE)
+  {
+    do
+    {
       ls_std::File::_addToFileListWindows(_path, withDirectories, data, filesInDirectory);
-    }
-    while(FindNextFile(hFind, &data) != 0);
+    } while (FindNextFile(hFind, &data) != 0);
 
     FindClose(hFind);
   }
 
   return filesInDirectory;
 }
+
 #endif
 
-int ls_std::File::_mkdir(const std::string& _path) {
+int ls_std::File::_mkdir(const std::string &_path)
+{
   int result;
 
   #ifdef _WIN32
-    result = mkdir(_path.c_str());
+  result = mkdir(_path.c_str());
   #endif
 
   #if defined(unix) || defined(__APPLE__)
-    result = mkdir(_path.c_str(), 0777);
+  result = mkdir(_path.c_str(), 0777);
   #endif
 
   return result;
@@ -460,21 +576,25 @@ std::string ls_std::File::_normalizePath(std::string _path)
   return _path;
 }
 
-std::string ls_std::File::_reduceSeparators(const std::string& _path)
+std::string ls_std::File::_reduceSeparators(const std::string &_path)
 {
   static const char separator = {ls_std::FilePathSeparator::get()};
-  std::string normalizedPath {};
-  int index {};
+  std::string normalizedPath{};
+  int index{};
 
-  while(index  < _path.size()) {
-    if(_path[index] == separator) {
+  while (index < _path.size())
+  {
+    if (_path[index] == separator)
+    {
       normalizedPath += _path[index];
 
-      do {
+      do
+      {
         index++;
-      }
-      while(_path[index] == separator);
-    } else {
+      } while (_path[index] == separator);
+    }
+    else
+    {
       normalizedPath += _path[index];
       index++;
     }
@@ -489,22 +609,26 @@ void ls_std::File::_remove(const std::string &_path)
   ls_std::File::_removeUnix(_path);
   #endif
   #ifdef _WIN32
-    ls_std::File::_removeWindows(_path);
+  ls_std::File::_removeWindows(_path);
   #endif
 }
 
 #if defined(unix) || defined(__APPLE__)
+
 void ls_std::File::_removeUnix(const std::string &_path)
 {
   rmdir(_path.c_str());
 }
+
 #endif
 
 #ifdef _WIN32
+
 void ls_std::File::_removeWindows(const std::string &_path)
 {
   _rmdir(_path.c_str());
 }
+
 #endif
 
 bool ls_std::File::_renameTo(const std::string &_oldName, const std::string &_newName)
@@ -518,23 +642,25 @@ std::string ls_std::File::_replaceWrongSeparator(std::string _path)
   static const char windowsSeparator = ls_std::FilePathSeparator::getWindowsFilePathSeparator();
 
   #if defined(unix) || defined(__APPLE__)
-    std::replace(_path.begin(), _path.end(), windowsSeparator, unixSeparator);
+  std::replace(_path.begin(), _path.end(), windowsSeparator, unixSeparator);
   #endif
 
   #ifdef _WIN32
-    std::replace(_path.begin(), _path.end(), unixSeparator, windowsSeparator);
+  std::replace(_path.begin(), _path.end(), unixSeparator, windowsSeparator);
   #endif
 
   return _path;
 }
 
-std::vector<std::string> ls_std::File::_splitIntoSubDirectoryNames(const std::string& _path) {
-  std::vector<std::string> subDirectoryNames {};
-  std::stringstream _stream {_path};
-  std::string subDirectoryName {};
+std::vector<std::string> ls_std::File::_splitIntoSubDirectoryNames(const std::string &_path)
+{
+  std::vector<std::string> subDirectoryNames{};
+  std::stringstream _stream{_path};
+  std::string subDirectoryName{};
   const char separator = ls_std::FilePathSeparator::get();
 
-  while(std::getline(_stream, subDirectoryName, separator)) {
+  while (std::getline(_stream, subDirectoryName, separator))
+  {
     subDirectoryNames.push_back(subDirectoryName);
   }
 

Some files were not shown because too many files changed in this diff