Эх сурвалжийг харах

Merged in dev (pull request #2)

Dev
Patrick-Christopher Mattulat 4 жил өмнө
parent
commit
398767d088
100 өөрчлөгдсөн 1719 нэмэгдсэн , 845 устгасан
  1. 23 4
      CMakeLists.txt
  2. 9 6
      README.md
  3. 2 2
      include/ls_std/base/Class.hpp
  4. 11 11
      include/ls_std/base/Version.hpp
  5. 11 11
      include/ls_std/boxing/Boolean.hpp
  6. 21 21
      include/ls_std/boxing/Double.hpp
  7. 21 21
      include/ls_std/boxing/Float.hpp
  8. 25 25
      include/ls_std/boxing/Integer.hpp
  9. 25 25
      include/ls_std/boxing/Long.hpp
  10. 9 9
      include/ls_std/boxing/String.hpp
  11. 37 0
      include/ls_std/event/Event.hpp
  12. 35 0
      include/ls_std/event/EventHandler.hpp
  13. 47 0
      include/ls_std/event/EventManager.hpp
  14. 25 0
      include/ls_std/event/EventTypes.hpp
  15. 29 0
      include/ls_std/event/IEventSubscriber.hpp
  16. 5 5
      include/ls_std/io/File.hpp
  17. 5 5
      include/ls_std/io/FileOutputStream.hpp
  18. 7 7
      include/ls_std/io/FileReader.hpp
  19. 7 7
      include/ls_std/io/FileWriter.hpp
  20. 2 2
      include/ls_std/io/logging/LogLevel.hpp
  21. 2 2
      include/ls_std/io/logging/Logger.hpp
  22. 2 2
      include/ls_std/io/xml/XMLAttribute.hpp
  23. 3 3
      include/ls_std/io/xml/XMLDeclaration.hpp
  24. 2 2
      include/ls_std/io/xml/XMLDocument.hpp
  25. 13 13
      include/ls_std/io/xml/XMLNode.hpp
  26. 71 0
      include/ls_std/io/xml/XMLParser.hpp
  27. 7 7
      include/ls_std/io/xml/XMLParserMock.hpp
  28. 6 37
      include/ls_std/io/xml/XMLReader.hpp
  29. 26 0
      include/ls_std/logic/IListener.hpp
  30. 37 0
      include/ls_std/logic/Narrator.hpp
  31. 13 13
      include/ls_std/logic/State.hpp
  32. 8 8
      include/ls_std/logic/StateConnection.hpp
  33. 11 11
      include/ls_std/logic/StateMachine.hpp
  34. 8 2
      include/ls_std/ls_std.hpp
  35. 9 2
      include/ls_std/serialization/boxing/SerializableJSONBoolean.hpp
  36. 9 2
      include/ls_std/serialization/boxing/SerializableJSONDouble.hpp
  37. 9 2
      include/ls_std/serialization/boxing/SerializableJSONFloat.hpp
  38. 9 2
      include/ls_std/serialization/boxing/SerializableJSONInteger.hpp
  39. 9 2
      include/ls_std/serialization/boxing/SerializableJSONLong.hpp
  40. 9 2
      include/ls_std/serialization/boxing/SerializableJSONString.hpp
  41. 6 5
      include/ls_std/serialization/logic/SerializableJSONState.hpp
  42. 3 2
      include/ls_std/serialization/logic/SerializableJSONStateConnection.hpp
  43. 11 4
      include/ls_std/serialization/logic/SerializableJSONStateMachine.hpp
  44. 6 6
      include/ls_std/time/Date.hpp
  45. 5 5
      source/ls_std/base/Version.cpp
  46. 8 8
      source/ls_std/boxing/Boolean.cpp
  47. 17 17
      source/ls_std/boxing/Double.cpp
  48. 17 17
      source/ls_std/boxing/Float.cpp
  49. 20 20
      source/ls_std/boxing/Integer.cpp
  50. 20 20
      source/ls_std/boxing/Long.cpp
  51. 8 8
      source/ls_std/boxing/String.cpp
  52. 43 0
      source/ls_std/event/Event.cpp
  53. 19 0
      source/ls_std/event/EventHandler.cpp
  54. 57 0
      source/ls_std/event/EventManager.cpp
  55. 5 5
      source/ls_std/io/File.cpp
  56. 3 3
      source/ls_std/io/FileOutputStream.cpp
  57. 4 4
      source/ls_std/io/FileReader.cpp
  58. 3 3
      source/ls_std/io/FileWriter.cpp
  59. 2 2
      source/ls_std/io/logging/LogLevel.cpp
  60. 2 2
      source/ls_std/io/logging/Logger.cpp
  61. 2 2
      source/ls_std/io/xml/XMLAttribute.cpp
  62. 2 2
      source/ls_std/io/xml/XMLDeclaration.cpp
  63. 2 2
      source/ls_std/io/xml/XMLDocument.cpp
  64. 5 5
      source/ls_std/io/xml/XMLNode.cpp
  65. 371 0
      source/ls_std/io/xml/XMLParser.cpp
  66. 23 0
      source/ls_std/io/xml/XMLParserMock.cpp
  67. 16 338
      source/ls_std/io/xml/XMLReader.cpp
  68. 0 23
      source/ls_std/io/xml/XMLReaderMock.cpp
  69. 13 0
      source/ls_std/logic/IListener.cpp
  70. 45 0
      source/ls_std/logic/Narrator.cpp
  71. 7 7
      source/ls_std/logic/State.cpp
  72. 4 4
      source/ls_std/logic/StateConnection.cpp
  73. 4 4
      source/ls_std/logic/StateMachine.cpp
  74. 12 2
      source/ls_std/serialization/json/boxing/SerializableJSONBoolean.cpp
  75. 12 2
      source/ls_std/serialization/json/boxing/SerializableJSONDouble.cpp
  76. 12 2
      source/ls_std/serialization/json/boxing/SerializableJSONFloat.cpp
  77. 12 2
      source/ls_std/serialization/json/boxing/SerializableJSONInteger.cpp
  78. 12 2
      source/ls_std/serialization/json/boxing/SerializableJSONLong.cpp
  79. 12 2
      source/ls_std/serialization/json/boxing/SerializableJSONString.cpp
  80. 10 5
      source/ls_std/serialization/json/logic/SerializableJSONState.cpp
  81. 7 2
      source/ls_std/serialization/json/logic/SerializableJSONStateConnection.cpp
  82. 14 4
      source/ls_std/serialization/json/logic/SerializableJSONStateMachine.cpp
  83. 4 4
      source/ls_std/time/Date.cpp
  84. 2 2
      test/cases/boxing/BooleanTest.cpp
  85. 2 2
      test/cases/boxing/DoubleTest.cpp
  86. 2 2
      test/cases/boxing/FloatTest.cpp
  87. 2 2
      test/cases/boxing/IntegerTest.cpp
  88. 2 2
      test/cases/boxing/LongTest.cpp
  89. 1 1
      test/cases/boxing/StringTest.cpp
  90. 33 0
      test/cases/event/EventHandlerTest.cpp
  91. 104 0
      test/cases/event/EventManagerTest.cpp
  92. 76 0
      test/cases/event/EventTest.cpp
  93. 2 2
      test/cases/io/FileOutputStreamTest.cpp
  94. 2 2
      test/cases/io/FileReaderTest.cpp
  95. 2 2
      test/cases/io/FileTest.cpp
  96. 2 2
      test/cases/io/FileWriterTest.cpp
  97. 2 2
      test/cases/io/StorableFileTest.cpp
  98. 2 2
      test/cases/io/logging/LoggerTest.cpp
  99. 2 2
      test/cases/io/xml/XMLDocumentTest.cpp
  100. 2 2
      test/cases/io/xml/XMLNodeTest.cpp

+ 23 - 4
CMakeLists.txt

@@ -4,7 +4,7 @@
 
 cmake_minimum_required(VERSION 3.17)
 set(PROJECT_NAME ls_std)
-set(RELEASE_VERSION 2020.2.3)
+set(RELEASE_VERSION 2020.3.0)
 project(${PROJECT_NAME})
 
 ##########################################################
@@ -22,6 +22,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
 
 message("${PROJECT_NAME}: Adding include directories...")
 
+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}/include)
 
@@ -70,8 +71,14 @@ set(SOURCE_FILES
         ${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/XMLReaderMock.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/StandardOutputWriter.cpp)
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XMLParserMock.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/event/Event.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/event/EventHandler.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/event/EventManager.cpp)
 
 set(TEST_FILES
         ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/IntegerTest.cpp
@@ -112,7 +119,19 @@ set(TEST_FILES
         ${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/XMLReaderMockTest.cpp)
+        ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XMLParserMockTest.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/event/EventTest.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/NewsAgency.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/DailyNewsAgency.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/SeriousNewsEvent.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/GossipNewsEvent.cpp
+        ${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)
 
 ##########################################################
 # Build

+ 9 - 6
README.md

@@ -1,4 +1,4 @@
-# Lynar Studios - Standard Library 2020.2.3 #
+# Lynar Studios - Standard Library 2020.3.0 #
 
 This is a cross-platform standard library written in C++ which provides basic functionality and implementation, like:
  
@@ -11,15 +11,18 @@ This is a cross-platform standard library written in C++ which provides basic fu
 - JSON
 - XML
 - Logger Class
+- Event Handling
 
 It has been tested on __Windows__, __Linux__ and __MacOS__ systems.
 
-### Change Log ###
+### Changelog ###
 
-- added missing nullptr exception handling inside serialization class constructors
-- fixed serialization assignment
-- replaced include directives in source files
-- reduced complexity inside SerializableJSONState class
+- added event handling functionality
+- added observer pattern classes
+- added xml parser class by reducing complexity of xml reader class
+- ls_std::Class is now polymorphic
+- fixed some include directives 
+- made existing serialization classes flyweight classes
 
 ### Documentation ###
 

+ 2 - 2
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-06
+ * Changed:         2020-11-14
  *
  * */
 
@@ -17,7 +17,7 @@ namespace ls_std {
     public:
 
       explicit Class(std::string _name);
-      ~Class() = default;
+      virtual ~Class() = default;
 
       std::string getClassName();
 

+ 11 - 11
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-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -18,7 +18,7 @@ namespace ls_std {
   class Version : public ISerializable {
     public:
 
-      explicit Version(version_type _majorVersion, version_type _minorVersion, version_type _patchVersion);
+      explicit Version(ls_std::version_type _majorVersion, ls_std::version_type _minorVersion, ls_std::version_type _patchVersion);
       ~Version() = default;
 
       // implementation
@@ -28,19 +28,19 @@ namespace ls_std {
 
       // other functionality
 
-      version_type getMajorVersion() const;
-      version_type getMinorVersion() const;
-      version_type getPatchVersion() const;
+      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);
-      void setMajorVersion(version_type _major);
-      void setMinorVersion(version_type _minor);
-      void setPatchVersion(version_type _patch);
+      void setMajorVersion(ls_std::version_type _major);
+      void setMinorVersion(ls_std::version_type _minor);
+      void setPatchVersion(ls_std::version_type _patch);
 
     private:
 
-      version_type majorVersion {};
-      version_type minorVersion {};
-      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);
   };

+ 11 - 11
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-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -22,7 +22,7 @@ namespace ls_std {
 
       explicit Boolean(bool _value);
       Boolean();
-      ~Boolean() = default;
+      ~Boolean() override = default;
 
       // conversion operator
 
@@ -30,26 +30,26 @@ namespace ls_std {
 
       // assignment operators
 
-      Boolean& operator=(int _value);
-      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 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 Boolean& _boolean) {
+      friend bool operator!(const ls_std::Boolean& _boolean) {
         return !_boolean.value;
       }
 
-      bool operator&&(const Boolean& _boolean) const;
+      bool operator&&(const ls_std::Boolean& _boolean) const;
       bool operator&&(bool _value) const;
       bool operator&&(int _value) const;
-      bool operator||(const 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
@@ -68,9 +68,9 @@ namespace ls_std {
       bool getValue() const;
       void setSerializable(std::shared_ptr<ISerializable> _serializable);
       void setStorable(std::shared_ptr<IStorable> _storable);
-      static bool XOR(const Boolean& _leftExpression, const Boolean& _rightExpression);
-      static bool XOR(const Boolean& _leftExpression, bool _rightExpression);
-      static bool XOR(bool _leftExpression, const 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:

+ 21 - 21
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-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -22,7 +22,7 @@ namespace ls_std {
 
       Double();
       explicit Double(double _value);
-      ~Double() = default;
+      ~Double() override = default;
 
       // conversion operator
 
@@ -30,44 +30,44 @@ namespace ls_std {
 
       // assignment operators
 
-      Double& operator=(double _value);
+      ls_std::Double& operator=(double _value);
 
       // arithmetic operators
 
       double operator-() const;
-      double operator+(const Double& _double) const;
+      double operator+(const ls_std::Double& _double) const;
       double operator+(double _value) const;
-      double operator*(const Double& _double) const;
+      double operator*(const ls_std::Double& _double) const;
       double operator*(double _value) const;
-      double operator-(const Double& _double) const;
+      double operator-(const ls_std::Double& _double) const;
       double operator-(double _value) const;
-      double operator/(const Double& _double) const;
+      double operator/(const ls_std::Double& _double) const;
       double operator/(double _value) const;
 
       // compound operators
 
-      Double& operator+=(const Double& _double);
-      Double& operator+=(double _value);
-      Double& operator-=(const Double& _double);
-      Double& operator-=(double _value);
-      Double& operator*=(const Double& _double);
-      Double& operator*=(double _value);
-      Double& operator/=(const Double& _double);
-      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 Double& _double) const;
+      bool operator==(const ls_std::Double& _double) const;
       bool operator==(double _value) const;
-      bool operator!=(const Double& _double) const;
+      bool operator!=(const ls_std::Double& _double) const;
       bool operator!=(double _value) const;
-      bool operator>(const Double& _double) const;
+      bool operator>(const ls_std::Double& _double) const;
       bool operator>(double _value) const;
-      bool operator>=(const Double& _double) const;
+      bool operator>=(const ls_std::Double& _double) const;
       bool operator>=(double _value) const;
-      bool operator<(const Double& _double) const;
+      bool operator<(const ls_std::Double& _double) const;
       bool operator<(double _value) const;
-      bool operator<=(const Double& _double) const;
+      bool operator<=(const ls_std::Double& _double) const;
       bool operator<=(double _value) const;
 
       // increment / decrement operator

+ 21 - 21
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-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -22,7 +22,7 @@ namespace ls_std {
 
       Float();
       explicit Float(float _value);
-      ~Float() = default;
+      ~Float() override = default;
 
       // conversion operator
 
@@ -30,44 +30,44 @@ namespace ls_std {
 
       // assignment operators
 
-      Float& operator=(float _value);
+      ls_std::Float& operator=(float _value);
 
       // arithmetic operators
 
       float operator-() const;
-      float operator+(const Float& _float) const;
+      float operator+(const ls_std::Float& _float) const;
       float operator+(float _value) const;
-      float operator*(const Float& _float) const;
+      float operator*(const ls_std::Float& _float) const;
       float operator*(float _value) const;
-      float operator-(const Float& _float) const;
+      float operator-(const ls_std::Float& _float) const;
       float operator-(float _value) const;
-      float operator/(const Float& _float) const;
+      float operator/(const ls_std::Float& _float) const;
       float operator/(float _value) const;
 
       // compound operators
 
-      Float& operator+=(const Float& _float);
-      Float& operator+=(float _value);
-      Float& operator-=(const Float& _float);
-      Float& operator-=(float _value);
-      Float& operator*=(const Float& _float);
-      Float& operator*=(float _value);
-      Float& operator/=(const Float& _float);
-      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 Float& _float) const;
+      bool operator==(const ls_std::Float& _float) const;
       bool operator==(float _value) const;
-      bool operator!=(const Float& _float) const;
+      bool operator!=(const ls_std::Float& _float) const;
       bool operator!=(float _value) const;
-      bool operator>(const Float& _float) const;
+      bool operator>(const ls_std::Float& _float) const;
       bool operator>(float _value) const;
-      bool operator>=(const Float& _float) const;
+      bool operator>=(const ls_std::Float& _float) const;
       bool operator>=(float _value) const;
-      bool operator<(const Float& _float) const;
+      bool operator<(const ls_std::Float& _float) const;
       bool operator<(float _value) const;
-      bool operator<=(const Float& _float) const;
+      bool operator<=(const ls_std::Float& _float) const;
       bool operator<=(float _value) const;
 
       // increment / decrement operator

+ 25 - 25
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-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -22,7 +22,7 @@ namespace ls_std {
 
       explicit Integer(int _value);
       Integer();
-      ~Integer() = default;
+      ~Integer() override = default;
 
       // conversion operator
 
@@ -30,58 +30,58 @@ namespace ls_std {
 
       // assignment operators
 
-      Integer& operator=(int _value);
+      ls_std::Integer& operator=(int _value);
 
       // arithmetic operators
 
       int operator-() const;
-      int operator+(const Integer& _integer) const;
+      int operator+(const ls_std::Integer& _integer) const;
       int operator+(int _value) const;
-      int operator*(const Integer& _integer) const;
+      int operator*(const ls_std::Integer& _integer) const;
       int operator*(int _value) const;
-      int operator-(const Integer& _integer) const;
+      int operator-(const ls_std::Integer& _integer) const;
       int operator-(int _value) const;
-      int operator/(const Integer& _integer) const;
+      int operator/(const ls_std::Integer& _integer) const;
       int operator/(int _value) const;
-      int operator%(const Integer& _integer) const;
+      int operator%(const ls_std::Integer& _integer) const;
       int operator%(int _value) const;
 
       // compound operators
 
-      Integer& operator+=(const Integer& _integer);
-      Integer& operator+=(int _value);
-      Integer& operator-=(const Integer& _integer);
-      Integer& operator-=(int _value);
-      Integer& operator*=(const Integer& _integer);
-      Integer& operator*=(int _value);
-      Integer& operator/=(const Integer& _integer);
-      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 Integer& _integer) const;
+      bool operator==(const ls_std::Integer& _integer) const;
       bool operator==(int _value) const;
-      bool operator!=(const Integer& _integer) const;
+      bool operator!=(const ls_std::Integer& _integer) const;
       bool operator!=(int _value) const;
-      bool operator>(const Integer& _integer) const;
+      bool operator>(const ls_std::Integer& _integer) const;
       bool operator>(int _value) const;
-      bool operator>=(const Integer& _integer) const;
+      bool operator>=(const ls_std::Integer& _integer) const;
       bool operator>=(int _value) const;
-      bool operator<(const Integer& _integer) const;
+      bool operator<(const ls_std::Integer& _integer) const;
       bool operator<(int _value) const;
-      bool operator<=(const Integer& _integer) const;
+      bool operator<=(const ls_std::Integer& _integer) const;
       bool operator<=(int _value) const;
 
       // logical operators
 
-      friend bool operator!(const Integer& _integer) {
+      friend bool operator!(const ls_std::Integer& _integer) {
         return !_integer.value;
       }
 
-      bool operator&&(const Integer& _integer) const;
+      bool operator&&(const ls_std::Integer& _integer) const;
       bool operator&&(int _value) const;
       bool operator&&(bool _expression) const;
-      bool operator||(const Integer& _integer) const;
+      bool operator||(const ls_std::Integer& _integer) const;
       bool operator||(int _value) const;
       bool operator||(bool _expression) const;
 

+ 25 - 25
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-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -23,7 +23,7 @@ namespace ls_std {
 
       explicit Long(ls_std::long_type _value);
       Long();
-      ~Long() = default;
+      ~Long() override = default;
 
       // conversion operator
 
@@ -31,58 +31,58 @@ namespace ls_std {
 
       // assignment operators
 
-      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 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 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 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 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 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
 
-      Long& operator+=(const Long& _long);
-      Long& operator+=(ls_std::long_type _value);
-      Long& operator-=(const Long& _long);
-      Long& operator-=(ls_std::long_type _value);
-      Long& operator*=(const Long& _long);
-      Long& operator*=(ls_std::long_type _value);
-      Long& operator/=(const Long& _long);
-      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 Long& _long) const;
+      bool operator==(const ls_std::Long& _long) const;
       bool operator==(ls_std::long_type _value) const;
-      bool operator!=(const Long& _long) const;
+      bool operator!=(const ls_std::Long& _long) const;
       bool operator!=(ls_std::long_type _value) const;
-      bool operator>(const Long& _long) const;
+      bool operator>(const ls_std::Long& _long) const;
       bool operator>(ls_std::long_type _value) const;
-      bool operator>=(const Long& _long) const;
+      bool operator>=(const ls_std::Long& _long) const;
       bool operator>=(ls_std::long_type _value) const;
-      bool operator<(const Long& _long) const;
+      bool operator<(const ls_std::Long& _long) const;
       bool operator<(ls_std::long_type _value) const;
-      bool operator<=(const 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 Long& _long) {
+      friend bool operator!(const ls_std::Long& _long) {
         return !_long.value;
       }
 
-      bool operator&&(const 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 Long& _long) const;
+      bool operator||(const ls_std::Long& _long) const;
       bool operator||(ls_std::long_type _value) const;
       bool operator||(bool _expression) const;
 

+ 9 - 9
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-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -24,7 +24,7 @@ namespace ls_std {
 
       String();
       explicit String(std::string _value);
-      ~String() = default;
+      ~String() override = default;
 
       // conversion operator
 
@@ -33,26 +33,26 @@ namespace ls_std {
 
       // assignment operators
 
-      String& operator=(std::string _value);
+      ls_std::String& operator=(std::string _value);
 
       // arithmetic operators
 
-      std::string operator+(String _string) const;
+      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-(int _number);
 
       // compound operators
 
-      String& operator+=(String _string);
-      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==(String _string);
+      bool operator==(ls_std::String _string);
       bool operator==(const std::string& _value);
       bool operator==(const char* _value);
-      bool operator!=(String _string);
+      bool operator!=(ls_std::String _string);
       bool operator!=(const std::string& _value);
       bool operator!=(const char* _value);
 
@@ -69,7 +69,7 @@ namespace ls_std {
 
       bool contains(const std::string& _text);
       bool endsWith(const std::string& _text);
-      bool equalsIgnoreCase(String _string);
+      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);

+ 37 - 0
include/ls_std/event/Event.hpp

@@ -0,0 +1,37 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-11-26
+ * Changed:         2020-11-29
+ *
+ * */
+
+#ifndef LS_STD_EVENT_HPP
+#define LS_STD_EVENT_HPP
+
+#include <ls_std/base/Class.hpp>
+#include "EventTypes.hpp"
+
+namespace ls_std {
+  class Event : public ls_std::Class {
+    public:
+
+      explicit Event(ls_std::event_id  _id);
+      ~Event() override = default;
+
+      void addParameter(const ls_std::event_parameter& _eventParameter);
+      ls_std::event_id getId();
+      ls_std::event_parameter_list getParameterList();
+      void removeParameter(const ls_std::event_parameter_id& _id);
+
+    private:
+
+      ls_std::event_id id {};
+      ls_std::event_parameter_list parameterList {};
+
+      bool _hasParameter(const ls_std::event_id&  _id);
+  };
+}
+
+#endif

+ 35 - 0
include/ls_std/event/EventHandler.hpp

@@ -0,0 +1,35 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-11-27
+ * Changed:         2020-11-28
+ *
+ * */
+
+#ifndef LS_STD_EVENT_HANDLER_HPP
+#define LS_STD_EVENT_HANDLER_HPP
+
+#include <ls_std/base/Class.hpp>
+#include <list>
+#include <memory>
+#include <ls_std/logic/IListener.hpp>
+#include "Event.hpp"
+#include <ls_std/logic/Narrator.hpp>
+
+namespace ls_std {
+  class EventHandler : public ls_std::Narrator {
+    public:
+
+      explicit EventHandler(ls_std::event_id  _id);
+      ~EventHandler() override = default;
+
+      ls_std::event_id getId();
+
+    private:
+
+      ls_std::event_id id {};
+  };
+}
+
+#endif

+ 47 - 0
include/ls_std/event/EventManager.hpp

@@ -0,0 +1,47 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-11-27
+ * Changed:         2020-11-29
+ *
+ * */
+
+#ifndef LS_STD_EVENT_MANAGER_HPP
+#define LS_STD_EVENT_MANAGER_HPP
+
+#include <ls_std/base/Class.hpp>
+#include <map>
+#include <ls_std/event/EventTypes.hpp>
+#include <memory>
+#include "EventHandler.hpp"
+#include "IEventSubscriber.hpp"
+
+namespace ls_std {
+  class EventManager : public ls_std::Class, public ls_std::IEventSubscriber {
+    public:
+
+      explicit EventManager();
+      ~EventManager() override = default;
+
+      // 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;
+
+      // additional functionality
+
+      void 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);
+
+    private:
+
+      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);
+  };
+}
+
+#endif

+ 25 - 0
include/ls_std/event/EventTypes.hpp

@@ -0,0 +1,25 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-11-26
+ * Changed:         2020-11-26
+ *
+ * */
+
+#ifndef LS_STD_EVENT_TYPES_HPP
+#define LS_STD_EVENT_TYPES_HPP
+
+#include <string>
+#include <vector>
+#include <map>
+
+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>;
+}
+
+#endif

+ 29 - 0
include/ls_std/event/IEventSubscriber.hpp

@@ -0,0 +1,29 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-11-27
+ * Changed:         2020-11-29
+ *
+ * */
+
+#ifndef LS_STD_I_EVENT_SUBSCRIBER_HPP
+#define LS_STD_I_EVENT_SUBSCRIBER_HPP
+
+#include "EventTypes.hpp"
+#include <memory>
+#include <ls_std/logic/IListener.hpp>
+
+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;
+  };
+}
+
+#endif

+ 5 - 5
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-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -30,12 +30,12 @@ namespace ls_std {
     public:
 
       explicit File(std::string _absoluteFilePath);
-      ~File() = default;
+      ~File() override = default;
 
       // comparison operators
 
-      bool operator==(File& _file);
-      bool operator!=(File& _file);
+      bool operator==(ls_std::File& _file);
+      bool operator!=(ls_std::File& _file);
 
       // additional functionality
 
@@ -69,7 +69,7 @@ namespace ls_std {
       #ifdef _WIN32
         static void _addToFileListWindows(const std::string& _path, bool _withDirectories, WIN32_FIND_DATA _data, std::list<std::string>& _list);
       #endif
-      static bool _equals(File& _file, File& _foreignFile);
+      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);

+ 5 - 5
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-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -19,9 +19,9 @@ namespace ls_std {
   class FileOutputStream : public Class, public IWriter {
     public:
 
-      explicit FileOutputStream(File& _file);
-      explicit FileOutputStream(File& _file, bool _append);
-      ~FileOutputStream();
+      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;
@@ -29,7 +29,7 @@ namespace ls_std {
     private:
 
       bool append {};
-      File file;
+      ls_std::File file;
       std::ofstream outputStream {};
 
       void _close();

+ 7 - 7
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-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -15,20 +15,20 @@
 #include "IReader.hpp"
 
 namespace ls_std {
-  class FileReader : public Class, IReader {
+  class FileReader : public Class, public IReader {
     public:
 
-      explicit FileReader(File& _file);
-      ~FileReader() = default;
+      explicit FileReader(ls_std::File& _file);
+      ~FileReader() override = default;
 
       ls_std::byte_field read() override;
-      void reset(File& _file);
+      void reset(ls_std::File& _file);
 
     private:
 
-      File file;
+      ls_std::File file;
 
-      static void _init(File &_file);
+      static void _init(ls_std::File &_file);
   };
 }
 

+ 7 - 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-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -15,20 +15,20 @@
 #include "File.hpp"
 
 namespace ls_std {
-  class FileWriter : public Class, IWriter {
+  class FileWriter : public Class, public IWriter {
     public:
 
-      explicit FileWriter(File& _file);
-      ~FileWriter() = default;
+      explicit FileWriter(ls_std::File& _file);
+      ~FileWriter() override = default;
 
-      void reset(File& _file);
+      void reset(ls_std::File& _file);
       bool write(const ls_std::byte_field& _data) override;
 
     private:
 
-      File file;
+      ls_std::File file;
 
-      static void _init(File& _file);
+      static void _init(ls_std::File& _file);
   };
 }
 

+ 2 - 2
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-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -20,7 +20,7 @@ namespace ls_std {
 
       explicit LogLevel(const ls_std::LogLevelValue& _value);
       LogLevel();
-      ~LogLevel() = default;
+      ~LogLevel() override = default;
 
       operator unsigned char() const;
       LogLevel& operator=(const ls_std::LogLevelValue& _value);

+ 2 - 2
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-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -22,7 +22,7 @@ namespace ls_std {
     public:
 
       explicit Logger(const std::shared_ptr<ls_std::IWriter>& _writer);
-      ~Logger() = default;
+      ~Logger() override = default;
 
       void debug(const ls_std::byte* _data);
       void error(const ls_std::byte* _data);

+ 2 - 2
include/ls_std/io/xml/XMLAttribute.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-23
- * Changed:         2020-11-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -18,7 +18,7 @@ namespace ls_std {
     public:
 
       explicit XMLAttribute(std::string _name);
-      ~XMLAttribute() = default;
+      ~XMLAttribute() override = default;
 
       std::string getName();
       std::string getValue();

+ 3 - 3
include/ls_std/io/xml/XMLDeclaration.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-27
- * Changed:         2020-11-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -18,7 +18,7 @@ namespace ls_std {
     public:
 
       explicit XMLDeclaration(std::string _version);
-      ~XMLDeclaration() = default;
+      ~XMLDeclaration() override = default;
 
       std::string getEncoding();
       std::string getStandalone();
@@ -34,7 +34,7 @@ namespace ls_std {
       ls_std::XMLAttribute standalone {"standalone"};
       ls_std::XMLAttribute version {"version"};
 
-      static std::string _toXMLAttribute(XMLAttribute _attribute);
+      static std::string _toXMLAttribute(ls_std::XMLAttribute _attribute);
   };
 }
 

+ 2 - 2
include/ls_std/io/xml/XMLDocument.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-27
- * Changed:         2020-11-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -20,7 +20,7 @@ namespace ls_std {
     public:
 
       XMLDocument();
-      ~XMLDocument() = default;
+      ~XMLDocument() override = default;
 
       std::shared_ptr<ls_std::XMLDeclaration> getDeclaration();
       std::shared_ptr<ls_std::XMLNode> getRootElement();

+ 13 - 13
include/ls_std/io/xml/XMLNode.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-24
- * Changed:         2020-11-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -20,25 +20,25 @@ namespace ls_std {
     public:
 
       explicit XMLNode(std::string _name);
-      ~XMLNode() = default;
+      ~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<XMLNode>& _child, const std::shared_ptr<XMLNode>& _search);
-      bool addChildBefore(const std::shared_ptr<XMLNode>& _child, const std::shared_ptr<XMLNode>& _search);
-      bool addChildToBeginning(const std::shared_ptr<XMLNode>& _child);
-      bool addChildToEnd(const std::shared_ptr<XMLNode>& _child);
+      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<XMLAttribute>> getAttributes();
-      std::list<std::shared_ptr<XMLNode>> getChildren();
-      std::list<std::shared_ptr<XMLNode>> getChildren(const std::string& _name);
+      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<XMLNode>& _child);
+      bool hasChild(const std::shared_ptr<ls_std::XMLNode>& _child);
       void removeFirstAttribute();
       void removeLastAttribute();
       void removeFirstChild();
@@ -53,15 +53,15 @@ namespace ls_std {
 
     private:
 
-      std::list<std::shared_ptr<XMLAttribute>> attributes {};
-      std::list<std::shared_ptr<XMLNode>> children {};
+      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<XMLNode>& _child);
+      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);

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

@@ -0,0 +1,71 @@
+/*
+ * 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

+ 7 - 7
include/ls_std/io/xml/XMLReaderMock.hpp → include/ls_std/io/xml/XMLParserMock.hpp

@@ -3,21 +3,21 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-18
- * Changed:         2020-11-06
+ * Changed:         2020-11-26
  *
  * */
 
-#ifndef LS_STD_XML_READER_MOCK_HPP
-#define LS_STD_XML_READER_MOCK_HPP
+#ifndef LS_STD_XML_PARSER_MOCK_HPP
+#define LS_STD_XML_PARSER_MOCK_HPP
 
-#include "XMLReader.hpp"
+#include "XMLParser.hpp"
 
 namespace ls_std {
-  class XMLReaderMock : public XMLReader {
+  class XMLParserMock : public XMLParser {
     public:
 
-      XMLReaderMock();
-      ~XMLReaderMock() = default;
+      XMLParserMock();
+      ~XMLParserMock() override = default;
 
       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);

+ 6 - 37
include/ls_std/io/xml/XMLReader.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-08
- * Changed:         2020-11-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -19,11 +19,11 @@
 #include <list>
 
 namespace ls_std {
-  class XMLReader : public Class, IReader {
+  class XMLReader : public Class, public IReader {
     public:
 
       explicit XMLReader(const std::shared_ptr<ls_std::XMLDocument>& _document, const std::string& _absolutePath);
-      ~XMLReader() = default;
+      ~XMLReader() override = default;
 
       // implementation
 
@@ -32,47 +32,16 @@ namespace ls_std {
       // 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);
 
-    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 {};
       ls_std::File xmlFile;
 
-      void _analyze(const ls_std::byte_field &_data, std::string::size_type _index);
-      static void _checkDocumentExistence(const std::shared_ptr<ls_std::XMLDocument>& _document);
-      static void _checkFileExistence(ls_std::File _xmlFile);
-      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();
+      void _assignDocument(const std::shared_ptr<ls_std::XMLDocument>& _document);
+      void _assignFile(ls_std::File _xmlFile);
   };
 }
 

+ 26 - 0
include/ls_std/logic/IListener.hpp

@@ -0,0 +1,26 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-11-14
+ * Changed:         2020-11-29
+ *
+ * */
+
+#ifndef LS_STD_I_LISTENER_HPP
+#define LS_STD_I_LISTENER_HPP
+
+#include <ls_std/base/Class.hpp>
+
+namespace ls_std {
+  class IListener : public Class {
+    public:
+
+      IListener();
+      ~IListener() override = default;
+
+      virtual void listen(const ls_std::Class& _info) = 0;
+  };
+}
+
+#endif

+ 37 - 0
include/ls_std/logic/Narrator.hpp

@@ -0,0 +1,37 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-11-14
+ * Changed:         2020-11-28
+ *
+ * */
+
+#ifndef LS_STD_NARRATOR_HPP
+#define LS_STD_NARRATOR_HPP
+
+#include <ls_std/base/Class.hpp>
+#include "IListener.hpp"
+#include <list>
+#include <memory>
+
+namespace ls_std {
+  class Narrator : public Class {
+    public:
+
+      Narrator();
+      ~Narrator() override = default;
+
+      void 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);
+
+    private:
+
+      std::list<std::shared_ptr<ls_std::IListener>> listeners {};
+  };
+}
+
+#endif

+ 13 - 13
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-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -17,27 +17,27 @@
 #include "StateConnection.hpp"
 
 namespace ls_std {
-  class State : public Class {
+  class State : public ls_std::Class {
     public:
 
-      explicit State(StateId _id);
-      ~State() = default;
+      explicit State(ls_std::StateId _id);
+      ~State() override = default;
 
-      bool addStateConnection(const StateConnectionId& _connectionId, const std::shared_ptr<State>& _connectedState);
-      bool addStateConnection(const std::shared_ptr<StateConnection>& _connection);
+      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<StateConnectionId, std::shared_ptr<StateConnection>> getConnectedStates();
-      StateId getId();
-      bool hasConnection(const StateConnectionId& _connectionId);
-      void setId(StateId _id);
+      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);
 
     private:
 
-      std::unordered_map<StateConnectionId, std::shared_ptr<StateConnection>> connectedStates {};
-      StateId id {};
+      std::unordered_map<ls_std::StateConnectionId, std::shared_ptr<ls_std::StateConnection>> connectedStates {};
+      ls_std::StateId id {};
 
       void _clearConnections();
-      bool _hasConnection(const StateConnectionId& _connectionId);
+      bool _hasConnection(const ls_std::StateConnectionId& _connectionId);
   };
 }
 

+ 8 - 8
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-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -18,21 +18,21 @@ namespace ls_std {
   class StateConnection : public Class {
     public:
 
-      explicit StateConnection(StateConnectionId _connectionId, StateId _stateId);
-      ~StateConnection() = default;
+      explicit StateConnection(ls_std::StateConnectionId _connectionId, ls_std::StateId _stateId);
+      ~StateConnection() override = default;
 
       StateConnectionId getConnectionId();
-      StateId getStateId();
+      ls_std::StateId getStateId();
       bool isPassable() const;
-      void setConnectionId(StateConnectionId _connectionId);
-      void setStateId(StateId _stateId);
+      void setConnectionId(ls_std::StateConnectionId _connectionId);
+      void setStateId(ls_std::StateId _stateId);
       void updatePassCondition(bool _condition);
 
     private:
 
       bool condition {};
-      StateConnectionId connectionId {};
-      StateId stateId {};
+      ls_std::StateConnectionId connectionId {};
+      ls_std::StateId stateId {};
   };
 }
 

+ 11 - 11
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-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -23,29 +23,29 @@ namespace ls_std {
     public:
 
       explicit StateMachine(std::string _name);
-      ~StateMachine() = default;
+      ~StateMachine() override = default;
 
-      bool addState(const std::shared_ptr<State>& _state);
-      std::shared_ptr<State> getCurrentState();
+      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<State>> getStates();
-      bool hasState(const StateId& _id);
+      std::unordered_map<StateId, std::shared_ptr<ls_std::State>> getStates();
+      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 StateId& _id);
+      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<StateId, std::shared_ptr<State>> states {};
+      std::unordered_map<ls_std::StateId, std::shared_ptr<ls_std::State>> states {};
 
-      std::vector<StateId> _getNextValidStates();
-      void _remember(const StateId& _id);
-      bool _hasState(const StateId& _id);
+      std::vector<ls_std::StateId> _getNextValidStates();
+      void _remember(const ls_std::StateId& _id);
+      bool _hasState(const ls_std::StateId& _id);
   };
 }
 

+ 8 - 2
include/ls_std/ls_std.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-29
- * Changed:         2020-11-06
+ * Changed:         2020-11-27
  *
  * */
 
@@ -30,7 +30,6 @@
 #include "io/logging/LogLevel.hpp"
 #include "io/logging/LogLevelValue.hpp"
 #include "io/logging/Logger.hpp"
-#include "io/xml/XMLReaderMock.hpp"
 #include "io/xml/XMLReader.hpp"
 #include "io/xml/XMLParseMode.hpp"
 #include "io/xml/XMLParseData.hpp"
@@ -38,6 +37,7 @@
 #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"
@@ -71,4 +71,10 @@
 #include "utils/RegexUtils.hpp"
 #include "utils/STLUtils.hpp"
 
+#include "event/Event.hpp"
+#include "event/EventTypes.hpp"
+#include "event/EventHandler.hpp"
+#include "event/IEventSubscriber.hpp"
+#include "event/EventManager.hpp"
+
 #endif

+ 9 - 2
include/ls_std/serialization/boxing/SerializableJSONBoolean.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-04
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -21,11 +21,18 @@ namespace ls_std {
     public:
 
       explicit SerializableJSONBoolean(const std::shared_ptr<ls_std::Boolean>& _value);
-      ~SerializableJSONBoolean() = default;
+      ~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 {};

+ 9 - 2
include/ls_std/serialization/boxing/SerializableJSONDouble.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-04
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -21,11 +21,18 @@ namespace ls_std {
     public:
 
       explicit SerializableJSONDouble(const std::shared_ptr<ls_std::Double>& _value);
-      ~SerializableJSONDouble() = default;
+      ~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 {};

+ 9 - 2
include/ls_std/serialization/boxing/SerializableJSONFloat.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-04
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -21,11 +21,18 @@ namespace ls_std {
     public:
 
       explicit SerializableJSONFloat(const std::shared_ptr<ls_std::Float>& _value);
-      ~SerializableJSONFloat() = default;
+      ~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 {};

+ 9 - 2
include/ls_std/serialization/boxing/SerializableJSONInteger.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-21
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -20,11 +20,18 @@ namespace ls_std {
     public:
 
       explicit SerializableJSONInteger(const std::shared_ptr<ls_std::Integer>& _value);
-      ~SerializableJSONInteger() = default;
+      ~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 {};

+ 9 - 2
include/ls_std/serialization/boxing/SerializableJSONLong.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-25
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -20,11 +20,18 @@ namespace ls_std {
     public:
 
       explicit SerializableJSONLong(const std::shared_ptr<ls_std::Long>& _value);
-      ~SerializableJSONLong() = default;
+      ~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 {};

+ 9 - 2
include/ls_std/serialization/boxing/SerializableJSONString.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-30
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -20,11 +20,18 @@ namespace ls_std {
     public:
 
       explicit SerializableJSONString(const std::shared_ptr<ls_std::String>& _value);
-      ~SerializableJSONString() = default;
+      ~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 {};

+ 6 - 5
include/ls_std/serialization/logic/SerializableJSONState.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-15
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -20,8 +20,8 @@ namespace ls_std {
   class SerializableJSONState : public Class, public ISerializable {
     public:
 
-      explicit SerializableJSONState(const std::shared_ptr<State>& _value);
-      ~SerializableJSONState() = default;
+      explicit SerializableJSONState(const std::shared_ptr<ls_std::State>& _value);
+      ~SerializableJSONState() override = default;
 
       // implementation
 
@@ -30,14 +30,15 @@ namespace ls_std {
 
       // additional functionality
 
-      void setValue(const std::shared_ptr<State>& _value);
+      std::shared_ptr<ls_std::State> getValue();
+      void setValue(const std::shared_ptr<ls_std::State>& _value);
 
     private:
 
       nlohmann::json jsonObject {};
       std::shared_ptr<ls_std::State> value {};
 
-      void _assignValue(const std::shared_ptr<State>& _value);
+      void _assignValue(const std::shared_ptr<ls_std::State>& _value);
       void _clear();
       void _unmarshalStateConnections();
       void _update();

+ 3 - 2
include/ls_std/serialization/logic/SerializableJSONStateConnection.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-14
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -21,7 +21,7 @@ namespace ls_std {
     public:
 
       explicit SerializableJSONStateConnection(const std::shared_ptr<ls_std::StateConnection>& _value);
-      ~SerializableJSONStateConnection() = default;
+      ~SerializableJSONStateConnection() override = default;
 
       // implementation
 
@@ -30,6 +30,7 @@ namespace ls_std {
 
       // additional functionality
 
+      std::shared_ptr<ls_std::StateConnection> getValue();
       void setValue(const std::shared_ptr<ls_std::StateConnection>& _value);
 
     private:

+ 11 - 4
include/ls_std/serialization/logic/SerializableJSONStateMachine.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-17
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -20,18 +20,25 @@ namespace ls_std {
   class SerializableJSONStateMachine : public Class, public ISerializable {
     public:
 
-      explicit SerializableJSONStateMachine(const std::shared_ptr<StateMachine>& _value);
-      ~SerializableJSONStateMachine() = 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;
 
+      // additional functionality
+
+      std::shared_ptr<ls_std::StateMachine> getValue();
+      void setValue(const std::shared_ptr<ls_std::StateMachine>& _value);
+
     private:
 
       nlohmann::json jsonObject {};
       std::shared_ptr<ls_std::StateMachine> value {};
 
-      void _assignValue(const std::shared_ptr<StateMachine>& _value);
+      void _assignValue(const std::shared_ptr<ls_std::StateMachine>& _value);
       void _unmarshalCurrentState();
       void _unmarshalStates();
       void _update();

+ 6 - 6
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-20
+ * Changed:         2020-11-26
  *
  * */
 
@@ -18,17 +18,17 @@ namespace ls_std {
     public:
 
       Date();
-      ~Date() = default;
+      ~Date() override = default;
 
       // arithmetic operators
 
-      Date& operator+(int _value);
-      Date& operator-(int _value);
+      ls_std::Date& operator+(int _value);
+      ls_std::Date& operator-(int _value);
 
       // additional functionality
 
-      bool after(const Date& _foreignDate) const;
-      bool before(const 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();

+ 5 - 5
source/ls_std/base/Version.cpp

@@ -3,14 +3,14 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-28
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
 #include <regex>
 #include <ls_std/base/Version.hpp>
 
-ls_std::Version::Version(version_type _majorVersion, version_type _minorVersion, version_type _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)
@@ -68,17 +68,17 @@ bool ls_std::Version::isValid(const std::string &_versionString)
   return ls_std::Version::_isValid(_versionString);
 }
 
-void ls_std::Version::setMajorVersion(version_type _major)
+void ls_std::Version::setMajorVersion(ls_std::version_type _major)
 {
   this->majorVersion = _major;
 }
 
-void ls_std::Version::setMinorVersion(version_type _minor)
+void ls_std::Version::setMinorVersion(ls_std::version_type _minor)
 {
   this->minorVersion = _minor;
 }
 
-void ls_std::Version::setPatchVersion(version_type _patch)
+void ls_std::Version::setPatchVersion(ls_std::version_type _patch)
 {
   this->patchVersion = _patch;
 }

+ 8 - 8
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-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -11,10 +11,10 @@
 #include <ls_std/boxing/Boolean.hpp>
 #include <ls_std/exception/IllegalArgumentException.hpp>
 
-ls_std::Boolean::Boolean() : Class("Boolean")
+ls_std::Boolean::Boolean() : ls_std::Class("Boolean")
 {}
 
-ls_std::Boolean::Boolean(bool _value) : Class("Boolean"),
+ls_std::Boolean::Boolean(bool _value) : ls_std::Class("Boolean"),
 value(_value)
 {}
 
@@ -35,7 +35,7 @@ ls_std::Boolean & ls_std::Boolean::operator=(bool _value)
   return *this;
 }
 
-bool ls_std::Boolean::operator&&(const Boolean &_boolean) const
+bool ls_std::Boolean::operator&&(const ls_std::Boolean &_boolean) const
 {
   return this->value && _boolean;
 }
@@ -50,7 +50,7 @@ bool ls_std::Boolean::operator&&(int _value) const
   return this->value && _value;
 }
 
-bool ls_std::Boolean::operator||(const Boolean &_boolean) const
+bool ls_std::Boolean::operator||(const ls_std::Boolean &_boolean) const
 {
   return this->value || _boolean;
 }
@@ -136,15 +136,15 @@ void ls_std::Boolean::setStorable(std::shared_ptr<IStorable> _storable) {
   this->storable = std::move(_storable);
 }
 
-bool ls_std::Boolean::XOR(const Boolean &_leftExpression, const 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 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 Boolean &_rightExpression) {
+bool ls_std::Boolean::XOR(bool _leftExpression, const ls_std::Boolean &_rightExpression) {
   return (_leftExpression && !_rightExpression) || (!_leftExpression && _rightExpression);
 }
 

+ 17 - 17
source/ls_std/boxing/Double.cpp

@@ -3,18 +3,18 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
 #include <cmath>
 #include <ls_std/boxing/Double.hpp>
 
-ls_std::Double::Double() : Class("Double"),
+ls_std::Double::Double() : ls_std::Class("Double"),
 epsilon(0.00000001)
 {}
 
-ls_std::Double::Double(double _value) : Class("Double"),
+ls_std::Double::Double(double _value) : ls_std::Class("Double"),
 epsilon(0.00000001),
 value(_value)
 {}
@@ -32,7 +32,7 @@ double ls_std::Double::operator-() const {
   return -this->value;
 }
 
-double ls_std::Double::operator+(const Double &_double) const {
+double ls_std::Double::operator+(const ls_std::Double &_double) const {
   return this->value + _double;
 }
 
@@ -40,7 +40,7 @@ double ls_std::Double::operator+(double _value) const {
   return this->value + _value;
 }
 
-double ls_std::Double::operator*(const Double &_double) const {
+double ls_std::Double::operator*(const ls_std::Double &_double) const {
   return this->value * _double;
 }
 
@@ -48,7 +48,7 @@ double ls_std::Double::operator*(double _value) const {
   return this->value * _value;
 }
 
-double ls_std::Double::operator-(const Double &_double) const {
+double ls_std::Double::operator-(const ls_std::Double &_double) const {
   return this->value - _double;
 }
 
@@ -56,7 +56,7 @@ double ls_std::Double::operator-(double _value) const {
   return this->value - _value;
 }
 
-double ls_std::Double::operator/(const Double &_double) const {
+double ls_std::Double::operator/(const ls_std::Double &_double) const {
   return this->value / _double;
 }
 
@@ -64,7 +64,7 @@ double ls_std::Double::operator/(double _value) const {
   return this->value / _value;
 }
 
-ls_std::Double & ls_std::Double::operator+=(const Double &_double) {
+ls_std::Double & ls_std::Double::operator+=(const ls_std::Double &_double) {
   this->value += _double;
   return *this;
 }
@@ -74,7 +74,7 @@ ls_std::Double & ls_std::Double::operator+=(double _value) {
   return *this;
 }
 
-ls_std::Double & ls_std::Double::operator-=(const Double &_double) {
+ls_std::Double & ls_std::Double::operator-=(const ls_std::Double &_double) {
   this->value -= _double;
   return *this;
 }
@@ -84,7 +84,7 @@ ls_std::Double & ls_std::Double::operator-=(double _value) {
   return *this;
 }
 
-ls_std::Double & ls_std::Double::operator*=(const Double &_double) {
+ls_std::Double & ls_std::Double::operator*=(const ls_std::Double &_double) {
   this->value *= _double;
   return *this;
 }
@@ -94,7 +94,7 @@ ls_std::Double & ls_std::Double::operator*=(double _value) {
   return *this;
 }
 
-ls_std::Double & ls_std::Double::operator/=(const Double &_double) {
+ls_std::Double & ls_std::Double::operator/=(const ls_std::Double &_double) {
   this->value /= _double;
   return *this;
 }
@@ -104,7 +104,7 @@ ls_std::Double & ls_std::Double::operator/=(double _value) {
   return *this;
 }
 
-bool ls_std::Double::operator==(const Double &_double) const {
+bool ls_std::Double::operator==(const ls_std::Double &_double) const {
   return std::fabs(this->value - _double) < this->epsilon;
 }
 
@@ -112,7 +112,7 @@ bool ls_std::Double::operator==(double _value) const {
   return std::fabs(this->value - _value) < this->epsilon;
 }
 
-bool ls_std::Double::operator!=(const Double &_double) const {
+bool ls_std::Double::operator!=(const ls_std::Double &_double) const {
   return std::fabs(this->value - _double) >= this->epsilon;
 }
 
@@ -120,7 +120,7 @@ bool ls_std::Double::operator!=(double _value) const {
   return std::fabs(this->value - _value) >= this->epsilon;
 }
 
-bool ls_std::Double::operator>(const Double &_double) const {
+bool ls_std::Double::operator>(const ls_std::Double &_double) const {
   return this->value > _double;
 }
 
@@ -128,7 +128,7 @@ bool ls_std::Double::operator>(double _value) const {
   return this->value > _value;
 }
 
-bool ls_std::Double::operator>=(const Double &_double) const {
+bool ls_std::Double::operator>=(const ls_std::Double &_double) const {
   return this->value >= _double;
 }
 
@@ -136,7 +136,7 @@ bool ls_std::Double::operator>=(double _value) const {
   return this->value >= _value;
 }
 
-bool ls_std::Double::operator<(const Double &_double) const {
+bool ls_std::Double::operator<(const ls_std::Double &_double) const {
   return this->value < _double;
 }
 
@@ -144,7 +144,7 @@ bool ls_std::Double::operator<(double _value) const {
   return this->value < _value;
 }
 
-bool ls_std::Double::operator<=(const Double &_double) const {
+bool ls_std::Double::operator<=(const ls_std::Double &_double) const {
   return this->value <= _double;
 }
 

+ 17 - 17
source/ls_std/boxing/Float.cpp

@@ -3,18 +3,18 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
 #include <cmath>
 #include <ls_std/boxing/Float.hpp>
 
-ls_std::Float::Float() : Class("Float"),
+ls_std::Float::Float() : ls_std::Class("Float"),
 epsilon(0.00001f)
 {}
 
-ls_std::Float::Float(float _value) : Class("Float"),
+ls_std::Float::Float(float _value) : ls_std::Class("Float"),
 epsilon(0.00001f),
 value(_value)
 {}
@@ -32,7 +32,7 @@ float ls_std::Float::operator-() const {
   return -this->value;
 }
 
-float ls_std::Float::operator+(const Float &_float) const {
+float ls_std::Float::operator+(const ls_std::Float &_float) const {
   return this->value + _float;
 }
 
@@ -40,7 +40,7 @@ float ls_std::Float::operator+(float _value) const {
   return this->value + _value;
 }
 
-float ls_std::Float::operator*(const Float &_float) const {
+float ls_std::Float::operator*(const ls_std::Float &_float) const {
   return this->value * _float;
 }
 
@@ -48,7 +48,7 @@ float ls_std::Float::operator*(float _value) const {
   return this->value * _value;
 }
 
-float ls_std::Float::operator-(const Float &_float) const {
+float ls_std::Float::operator-(const ls_std::Float &_float) const {
   return this->value - _float;
 }
 
@@ -56,7 +56,7 @@ float ls_std::Float::operator-(float _value) const {
   return this->value - _value;
 }
 
-float ls_std::Float::operator/(const Float &_float) const {
+float ls_std::Float::operator/(const ls_std::Float &_float) const {
   return this->value / _float;
 }
 
@@ -64,7 +64,7 @@ float ls_std::Float::operator/(float _value) const {
   return this->value / _value;
 }
 
-ls_std::Float & ls_std::Float::operator+=(const Float &_float) {
+ls_std::Float & ls_std::Float::operator+=(const ls_std::Float &_float) {
   this->value += _float;
   return *this;
 }
@@ -74,7 +74,7 @@ ls_std::Float & ls_std::Float::operator+=(float _value) {
   return *this;
 }
 
-ls_std::Float & ls_std::Float::operator-=(const Float &_float) {
+ls_std::Float & ls_std::Float::operator-=(const ls_std::Float &_float) {
   this->value -= _float;
   return *this;
 }
@@ -84,7 +84,7 @@ ls_std::Float & ls_std::Float::operator-=(float _value) {
   return *this;
 }
 
-ls_std::Float & ls_std::Float::operator*=(const Float &_float) {
+ls_std::Float & ls_std::Float::operator*=(const ls_std::Float &_float) {
   this->value *= _float;
   return *this;
 }
@@ -94,7 +94,7 @@ ls_std::Float & ls_std::Float::operator*=(float _value) {
   return *this;
 }
 
-ls_std::Float & ls_std::Float::operator/=(const Float &_float) {
+ls_std::Float & ls_std::Float::operator/=(const ls_std::Float &_float) {
   this->value /= _float;
   return *this;
 }
@@ -104,7 +104,7 @@ ls_std::Float & ls_std::Float::operator/=(float _value) {
   return *this;
 }
 
-bool ls_std::Float::operator==(const Float &_float) const {
+bool ls_std::Float::operator==(const ls_std::Float &_float) const {
   return std::fabs(this->value - _float) < this->epsilon;
 }
 
@@ -112,7 +112,7 @@ bool ls_std::Float::operator==(float _value) const {
   return std::fabs(this->value - _value) < this->epsilon;
 }
 
-bool ls_std::Float::operator!=(const Float &_float) const {
+bool ls_std::Float::operator!=(const ls_std::Float &_float) const {
   return std::fabs(this->value - _float) >= this->epsilon;
 }
 
@@ -120,7 +120,7 @@ bool ls_std::Float::operator!=(float _value) const {
   return std::fabs(this->value - _value) >= this->epsilon;
 }
 
-bool ls_std::Float::operator>(const Float &_float) const {
+bool ls_std::Float::operator>(const ls_std::Float &_float) const {
   return this->value > _float;
 }
 
@@ -128,7 +128,7 @@ bool ls_std::Float::operator>(float _value) const {
   return this->value > _value;
 }
 
-bool ls_std::Float::operator>=(const Float &_float) const {
+bool ls_std::Float::operator>=(const ls_std::Float &_float) const {
   return this->value >= _float;
 }
 
@@ -136,7 +136,7 @@ bool ls_std::Float::operator>=(float _value) const {
   return this->value >= _value;
 }
 
-bool ls_std::Float::operator<(const Float &_float) const {
+bool ls_std::Float::operator<(const ls_std::Float &_float) const {
   return this->value < _float;
 }
 
@@ -144,7 +144,7 @@ bool ls_std::Float::operator<(float _value) const {
   return this->value < _value;
 }
 
-bool ls_std::Float::operator<=(const Float &_float) const {
+bool ls_std::Float::operator<=(const ls_std::Float &_float) const {
   return this->value <= _float;
 }
 

+ 20 - 20
source/ls_std/boxing/Integer.cpp

@@ -3,18 +3,18 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-07
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
 #include <ls_std/boxing/Integer.hpp>
 #include <ls_std/exception/IllegalArithmeticOperationException.hpp>
 
-ls_std::Integer::Integer(int _value) : Class("Integer"),
+ls_std::Integer::Integer(int _value) : ls_std::Class("Integer"),
 value(_value)
 {}
 
-ls_std::Integer::Integer() : Class("Integer")
+ls_std::Integer::Integer() : ls_std::Class("Integer")
 {}
 
 ls_std::Integer::operator int() const
@@ -33,7 +33,7 @@ int ls_std::Integer::operator-() const
   return -this->value;
 }
 
-int ls_std::Integer::operator+(const Integer &_integer) const
+int ls_std::Integer::operator+(const ls_std::Integer &_integer) const
 {
   return this->value + _integer;
 }
@@ -43,7 +43,7 @@ int ls_std::Integer::operator+(int _value) const
   return this->value + _value;
 }
 
-int ls_std::Integer::operator*(const Integer &_integer) const
+int ls_std::Integer::operator*(const ls_std::Integer &_integer) const
 {
   return this->value * _integer;
 }
@@ -53,7 +53,7 @@ int ls_std::Integer::operator*(int _value) const
   return this->value * _value;
 }
 
-int ls_std::Integer::operator-(const Integer &_integer) const
+int ls_std::Integer::operator-(const ls_std::Integer &_integer) const
 {
   return this->value - _integer;
 }
@@ -63,7 +63,7 @@ int ls_std::Integer::operator-(int _value) const
   return this->value - _value;
 }
 
-int ls_std::Integer::operator/(const Integer &_integer) const
+int ls_std::Integer::operator/(const ls_std::Integer &_integer) const
 {
   if(_integer == 0) {
     throw ls_std::IllegalArithmeticOperationException {};
@@ -81,7 +81,7 @@ int ls_std::Integer::operator/(int _value) const
   return this->value / _value;
 }
 
-int ls_std::Integer::operator%(const Integer &_integer) const
+int ls_std::Integer::operator%(const ls_std::Integer &_integer) const
 {
   return this->value % _integer;
 }
@@ -91,7 +91,7 @@ int ls_std::Integer::operator%(int _value) const
   return this->value % _value;
 }
 
-ls_std::Integer & ls_std::Integer::operator+=(const Integer &_integer)
+ls_std::Integer & ls_std::Integer::operator+=(const ls_std::Integer &_integer)
 {
   this->value += _integer;
   return *this;
@@ -103,7 +103,7 @@ ls_std::Integer & ls_std::Integer::operator+=(int _value)
   return *this;
 }
 
-ls_std::Integer & ls_std::Integer::operator-=(const Integer &_integer)
+ls_std::Integer & ls_std::Integer::operator-=(const ls_std::Integer &_integer)
 {
   this->value -= _integer;
   return *this;
@@ -115,7 +115,7 @@ ls_std::Integer & ls_std::Integer::operator-=(int _value)
   return *this;
 }
 
-ls_std::Integer & ls_std::Integer::operator*=(const Integer &_integer)
+ls_std::Integer & ls_std::Integer::operator*=(const ls_std::Integer &_integer)
 {
   this->value *= _integer;
   return *this;
@@ -127,7 +127,7 @@ ls_std::Integer & ls_std::Integer::operator*=(int _value)
   return *this;
 }
 
-ls_std::Integer & ls_std::Integer::operator/=(const Integer &_integer)
+ls_std::Integer & ls_std::Integer::operator/=(const ls_std::Integer &_integer)
 {
   if(_integer == 0) {
     throw ls_std::IllegalArithmeticOperationException {};
@@ -147,7 +147,7 @@ ls_std::Integer & ls_std::Integer::operator/=(int _value)
   return *this;
 }
 
-bool ls_std::Integer::operator==(const Integer &_integer) const
+bool ls_std::Integer::operator==(const ls_std::Integer &_integer) const
 {
   return this->value == _integer;
 }
@@ -157,7 +157,7 @@ bool ls_std::Integer::operator==(int _value) const
   return this->value == _value;
 }
 
-bool ls_std::Integer::operator!=(const Integer &_integer) const
+bool ls_std::Integer::operator!=(const ls_std::Integer &_integer) const
 {
   return this->value != _integer;
 }
@@ -167,7 +167,7 @@ bool ls_std::Integer::operator!=(int _value) const
   return this->value != _value;
 }
 
-bool ls_std::Integer::operator>(const Integer &_integer) const
+bool ls_std::Integer::operator>(const ls_std::Integer &_integer) const
 {
   return this->value > _integer;
 }
@@ -177,7 +177,7 @@ bool ls_std::Integer::operator>(int _value) const
   return this->value > _value;
 }
 
-bool ls_std::Integer::operator>=(const Integer &_integer) const
+bool ls_std::Integer::operator>=(const ls_std::Integer &_integer) const
 {
   return this->value >= _integer;
 }
@@ -187,7 +187,7 @@ bool ls_std::Integer::operator>=(int _value) const
   return this->value >= _value;
 }
 
-bool ls_std::Integer::operator<(const Integer &_integer) const
+bool ls_std::Integer::operator<(const ls_std::Integer &_integer) const
 {
   return this->value < _integer;
 }
@@ -197,7 +197,7 @@ bool ls_std::Integer::operator<(int _value) const
   return this->value < _value;
 }
 
-bool ls_std::Integer::operator<=(const Integer &_integer) const
+bool ls_std::Integer::operator<=(const ls_std::Integer &_integer) const
 {
   return this->value <= _integer;
 }
@@ -207,7 +207,7 @@ bool ls_std::Integer::operator<=(int _value) const
   return this->value <= _value;
 }
 
-bool ls_std::Integer::operator&&(const Integer &_integer) const
+bool ls_std::Integer::operator&&(const ls_std::Integer &_integer) const
 {
   return this->value && _integer;
 }
@@ -222,7 +222,7 @@ bool ls_std::Integer::operator&&(bool _expression) const
   return this->value && _expression;
 }
 
-bool ls_std::Integer::operator||(const Integer &_integer) const
+bool ls_std::Integer::operator||(const ls_std::Integer &_integer) const
 {
   return this->value || _integer;
 }

+ 20 - 20
source/ls_std/boxing/Long.cpp

@@ -3,18 +3,18 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
 #include <ls_std/boxing/Long.hpp>
 #include <ls_std/exception/IllegalArithmeticOperationException.hpp>
 
-ls_std::Long::Long(ls_std::long_type _value) : Class("Long"),
+ls_std::Long::Long(ls_std::long_type _value) : ls_std::Class("Long"),
 value(_value)
 {}
 
-ls_std::Long::Long() : Class("Long")
+ls_std::Long::Long() : ls_std::Class("Long")
 {}
 
 ls_std::Long::operator ls_std::long_type() const
@@ -33,7 +33,7 @@ ls_std::long_type ls_std::Long::operator-() const
   return -this->value;
 }
 
-ls_std::long_type ls_std::Long::operator+(const Long &_long) const
+ls_std::long_type ls_std::Long::operator+(const ls_std::Long &_long) const
 {
   return this->value + _long;
 }
@@ -43,7 +43,7 @@ ls_std::long_type ls_std::Long::operator+(ls_std::long_type _value) const
   return this->value + _value;
 }
 
-ls_std::long_type ls_std::Long::operator*(const Long &_long) const
+ls_std::long_type ls_std::Long::operator*(const ls_std::Long &_long) const
 {
   return this->value * _long;
 }
@@ -53,7 +53,7 @@ ls_std::long_type ls_std::Long::operator*(ls_std::long_type _value) const
   return this->value * _value;
 }
 
-ls_std::long_type ls_std::Long::operator-(const Long &_long) const
+ls_std::long_type ls_std::Long::operator-(const ls_std::Long &_long) const
 {
   return this->value - _long;
 }
@@ -63,7 +63,7 @@ ls_std::long_type ls_std::Long::operator-(ls_std::long_type _value) const
   return this->value - _value;
 }
 
-ls_std::long_type ls_std::Long::operator/(const Long &_long) 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 {};
@@ -81,7 +81,7 @@ ls_std::long_type ls_std::Long::operator/(ls_std::long_type _value) const
   return this->value / _value;
 }
 
-ls_std::long_type ls_std::Long::operator%(const Long &_long) const
+ls_std::long_type ls_std::Long::operator%(const ls_std::Long &_long) const
 {
   return this->value % _long;
 }
@@ -91,7 +91,7 @@ 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 Long &_long)
+ls_std::Long & ls_std::Long::operator+=(const ls_std::Long &_long)
 {
   this->value += _long;
   return *this;
@@ -103,7 +103,7 @@ ls_std::Long & ls_std::Long::operator+=(ls_std::long_type _value)
   return *this;
 }
 
-ls_std::Long & ls_std::Long::operator-=(const Long &_long)
+ls_std::Long & ls_std::Long::operator-=(const ls_std::Long &_long)
 {
   this->value -= _long;
   return *this;
@@ -115,7 +115,7 @@ ls_std::Long & ls_std::Long::operator-=(ls_std::long_type _value)
   return *this;
 }
 
-ls_std::Long & ls_std::Long::operator*=(const Long &_long)
+ls_std::Long & ls_std::Long::operator*=(const ls_std::Long &_long)
 {
   this->value *= _long;
   return *this;
@@ -127,7 +127,7 @@ ls_std::Long & ls_std::Long::operator*=(ls_std::long_type _value)
   return *this;
 }
 
-ls_std::Long & ls_std::Long::operator/=(const 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 {};
@@ -147,7 +147,7 @@ ls_std::Long & ls_std::Long::operator/=(ls_std::long_type _value)
   return *this;
 }
 
-bool ls_std::Long::operator==(const Long &_long) const
+bool ls_std::Long::operator==(const ls_std::Long &_long) const
 {
   return this->value == _long;
 }
@@ -157,7 +157,7 @@ bool ls_std::Long::operator==(ls_std::long_type _value) const
   return this->value == _value;
 }
 
-bool ls_std::Long::operator!=(const Long &_long) const
+bool ls_std::Long::operator!=(const ls_std::Long &_long) const
 {
   return this->value != _long;
 }
@@ -167,7 +167,7 @@ bool ls_std::Long::operator!=(ls_std::long_type _value) const
   return this->value != _value;
 }
 
-bool ls_std::Long::operator>(const Long &_long) const
+bool ls_std::Long::operator>(const ls_std::Long &_long) const
 {
   return this->value > _long;
 }
@@ -177,7 +177,7 @@ bool ls_std::Long::operator>(ls_std::long_type _value) const
   return this->value > _value;
 }
 
-bool ls_std::Long::operator>=(const Long &_long) const
+bool ls_std::Long::operator>=(const ls_std::Long &_long) const
 {
   return this->value >= _long;
 }
@@ -187,7 +187,7 @@ bool ls_std::Long::operator>=(ls_std::long_type _value) const
   return this->value >= _value;
 }
 
-bool ls_std::Long::operator<(const Long &_long) const
+bool ls_std::Long::operator<(const ls_std::Long &_long) const
 {
   return this->value < _long;
 }
@@ -197,7 +197,7 @@ bool ls_std::Long::operator<(ls_std::long_type _value) const
   return this->value < _value;
 }
 
-bool ls_std::Long::operator<=(const Long &_long) const
+bool ls_std::Long::operator<=(const ls_std::Long &_long) const
 {
   return this->value <= _long;
 }
@@ -207,7 +207,7 @@ bool ls_std::Long::operator<=(ls_std::long_type _value) const
   return this->value <= _value;
 }
 
-bool ls_std::Long::operator&&(const Long &_long) const
+bool ls_std::Long::operator&&(const ls_std::Long &_long) const
 {
   return this->value && _long;
 }
@@ -222,7 +222,7 @@ bool ls_std::Long::operator&&(bool _expression) const
   return this->value && _expression;
 }
 
-bool ls_std::Long::operator||(const Long &_long) const
+bool ls_std::Long::operator||(const ls_std::Long &_long) const
 {
   return this->value || _long;
 }

+ 8 - 8
source/ls_std/boxing/String.cpp

@@ -3,17 +3,17 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
 #include <algorithm>
 #include <ls_std/boxing/String.hpp>
 
-ls_std::String::String() : Class("String")
+ls_std::String::String() : ls_std::Class("String")
 {}
 
-ls_std::String::String(std::string _value) : Class("String"),
+ls_std::String::String(std::string _value) : ls_std::Class("String"),
 value(std::move(_value))
 {}
 
@@ -30,7 +30,7 @@ ls_std::String & ls_std::String::operator=(std::string _value) {
   return *this;
 }
 
-std::string ls_std::String::operator+(String _string) const {
+std::string ls_std::String::operator+(ls_std::String _string) const {
   return this->value + _string.toString();
 }
 
@@ -47,7 +47,7 @@ std::string ls_std::String::operator-(int _number) {
   return copy.substr(0, copy.size() - _number);
 }
 
-ls_std::String & ls_std::String::operator+=(String _string) {
+ls_std::String & ls_std::String::operator+=(ls_std::String _string) {
   this->value = this->value + _string.toString();
   return *this;
 }
@@ -57,7 +57,7 @@ ls_std::String & ls_std::String::operator+=(const std::string &_text) {
   return *this;
 }
 
-bool ls_std::String::operator==(String _string) {
+bool ls_std::String::operator==(ls_std::String _string) {
   return this->value == _string.toString();
 }
 
@@ -69,7 +69,7 @@ bool ls_std::String::operator==(const char *_value) {
   return this->value == _value;
 }
 
-bool ls_std::String::operator!=(String _string) {
+bool ls_std::String::operator!=(ls_std::String _string) {
   return this->value != _string.toString();
 }
 
@@ -134,7 +134,7 @@ bool ls_std::String::endsWith(const std::string &_text) {
   return this->value.rfind(_text) == (this->value.size() - _text.size());
 }
 
-bool ls_std::String::equalsIgnoreCase(String _string) {
+bool ls_std::String::equalsIgnoreCase(ls_std::String _string) {
   return this->toLowerCase() == _string.toLowerCase();
 }
 

+ 43 - 0
source/ls_std/event/Event.cpp

@@ -0,0 +1,43 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-11-26
+ * Changed:         2020-11-29
+ *
+ * */
+
+#include <ls_std/event/Event.hpp>
+
+ls_std::Event::Event(ls_std::event_id _id) : ls_std::Class("Event"),
+id(std::move(_id))
+{}
+
+void ls_std::Event::addParameter(const ls_std::event_parameter &_eventParameter)
+{
+  if(!this->_hasParameter(_eventParameter.first)) {
+    this->parameterList.insert(_eventParameter);
+  }
+}
+
+ls_std::event_id ls_std::Event::getId()
+{
+  return this->id;
+}
+
+ls_std::event_parameter_list ls_std::Event::getParameterList()
+{
+  return this->parameterList;
+}
+
+void ls_std::Event::removeParameter(const ls_std::event_parameter_id &_id)
+{
+  if(this->_hasParameter(_id)) {
+    this->parameterList.erase(_id);
+  }
+}
+
+bool ls_std::Event::_hasParameter(const ls_std::event_id &_id)
+{
+  return this->parameterList.find(_id) != this->parameterList.end();
+}

+ 19 - 0
source/ls_std/event/EventHandler.cpp

@@ -0,0 +1,19 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-11-27
+ * Changed:         2020-11-28
+ *
+ * */
+
+#include <ls_std/event/EventHandler.hpp>
+
+ls_std::EventHandler::EventHandler(ls_std::event_id  _id) : ls_std::Narrator(),
+id(std::move(_id))
+{}
+
+ls_std::event_id ls_std::EventHandler::getId()
+{
+  return this->id;
+}

+ 57 - 0
source/ls_std/event/EventManager.cpp

@@ -0,0 +1,57 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-11-27
+ * Changed:         2020-11-29
+ *
+ * */
+
+#include <ls_std/event/EventManager.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)
+{
+  if(this->_hasEventHandler(_id)) {
+    this->eventHandlers.at(_id)->addListener(_listener);
+  }
+}
+
+void ls_std::EventManager::unsubscribe(const ls_std::event_id &_id, const std::shared_ptr<IListener> &_listener)
+{
+  if(this->_hasEventHandler(_id)) {
+    this->eventHandlers.at(_id)->removeListener(_listener);
+  }
+}
+
+void ls_std::EventManager::addEventHandler(const std::shared_ptr<ls_std::EventHandler> &_eventHandler)
+{
+  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);
+  }
+}
+
+void ls_std::EventManager::fire(ls_std::Event _event)
+{
+  if(this->_hasEventHandler(_event.getId())) {
+    this->eventHandlers.at(_event.getId())->tell(_event);
+  }
+}
+
+void ls_std::EventManager::removeEventHandler(const std::shared_ptr<ls_std::EventHandler> &_eventHandler)
+{
+  this->_removeEventHandler(_eventHandler);
+}
+
+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)
+{
+  this->eventHandlers.erase(_eventHandler->getId());
+}

+ 5 - 5
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-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -25,16 +25,16 @@
 #include <direct.h>
 #endif
 
-ls_std::File::File(std::string _absoluteFilePath) : Class("File"),
+ls_std::File::File(std::string _absoluteFilePath) : ls_std::Class("File"),
 absoluteFilePath(ls_std::File::_normalizePath(std::move(_absoluteFilePath)))
 {}
 
-bool ls_std::File::operator==(File &_file)
+bool ls_std::File::operator==(ls_std::File &_file)
 {
   return ls_std::File::_equals(*this, _file);
 }
 
-bool ls_std::File::operator!=(File &_file)
+bool ls_std::File::operator!=(ls_std::File &_file)
 {
   return !ls_std::File::_equals(*this, _file);
 }
@@ -239,7 +239,7 @@ void ls_std::File::_addToFileListUnix(const std::string& _path, bool _withDirect
 }
 #endif
 
-bool ls_std::File::_equals(File &_file, File &_foreignFile)
+bool ls_std::File::_equals(ls_std::File &_file, ls_std::File &_foreignFile)
 {
   bool isEqual = _file.getAbsoluteFilePath() == _foreignFile.getAbsoluteFilePath();
 

+ 3 - 3
source/ls_std/io/FileOutputStream.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -11,13 +11,13 @@
 #include <ls_std/exception/FileNotFoundException.hpp>
 #include <ls_std/exception/FileOperationException.hpp>
 
-ls_std::FileOutputStream::FileOutputStream(File &_file) : Class("FileOutputStream"),
+ls_std::FileOutputStream::FileOutputStream(ls_std::File &_file) : ls_std::Class("FileOutputStream"),
 file(_file)
 {
   this->_init();
 }
 
-ls_std::FileOutputStream::FileOutputStream(File &_file, bool _append) : Class("FileOutputStream"),
+ls_std::FileOutputStream::FileOutputStream(ls_std::File &_file, bool _append) : ls_std::Class("FileOutputStream"),
 append(_append),
 file(_file)
 {

+ 4 - 4
source/ls_std/io/FileReader.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -12,7 +12,7 @@
 #include <ls_std/exception/FileNotFoundException.hpp>
 #include <ls_std/exception/FileOperationException.hpp>
 
-ls_std::FileReader::FileReader(File &_file) : Class("FileReader"),
+ls_std::FileReader::FileReader(ls_std::File &_file) : ls_std::Class("FileReader"),
 file(_file)
 {
   ls_std::FileReader::_init(_file);
@@ -37,13 +37,13 @@ ls_std::byte_field ls_std::FileReader::read()
   return readData;
 }
 
-void ls_std::FileReader::reset(File &_file)
+void ls_std::FileReader::reset(ls_std::File &_file)
 {
   ls_std::FileReader::_init(_file);
   this->file = _file;
 }
 
-void ls_std::FileReader::_init(File &_file)
+void ls_std::FileReader::_init(ls_std::File &_file)
 {
   if(!_file.exists()) {
     throw ls_std::FileNotFoundException {};

+ 3 - 3
source/ls_std/io/FileWriter.cpp

@@ -12,13 +12,13 @@
 #include <ls_std/exception/FileNotFoundException.hpp>
 #include <ls_std/exception/FileOperationException.hpp>
 
-ls_std::FileWriter::FileWriter(ls_std::File &_file) : Class("FileWriter"),
+ls_std::FileWriter::FileWriter(ls_std::File &_file) : ls_std::Class("FileWriter"),
 file(_file)
 {
   ls_std::FileWriter::_init(_file);
 }
 
-void ls_std::FileWriter::reset(File &_file)
+void ls_std::FileWriter::reset(ls_std::File &_file)
 {
   ls_std::FileWriter::_init(_file);
   this->file = _file;
@@ -40,7 +40,7 @@ bool ls_std::FileWriter::write(const ls_std::byte_field& _data)
   return succeeded;
 }
 
-void ls_std::FileWriter::_init(File &_file)
+void ls_std::FileWriter::_init(ls_std::File &_file)
 {
   if(!_file.exists()) {
     throw ls_std::FileNotFoundException {};

+ 2 - 2
source/ls_std/io/logging/LogLevel.cpp

@@ -3,13 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
 #include <ls_std/io/logging/LogLevel.hpp>
 
-ls_std::LogLevel::LogLevel(const ls_std::LogLevelValue& _value) : Class("LogLevel"),
+ls_std::LogLevel::LogLevel(const ls_std::LogLevelValue& _value) : ls_std::Class("LogLevel"),
 value(_value)
 {
   this->_init();

+ 2 - 2
source/ls_std/io/logging/Logger.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -13,7 +13,7 @@
 #include <ls_std/boxing/String.hpp>
 #include <ls_std/exception/NullPointerException.hpp>
 
-ls_std::Logger::Logger(const std::shared_ptr<ls_std::IWriter> &_writer) : Class("Logger"),
+ls_std::Logger::Logger(const std::shared_ptr<ls_std::IWriter> &_writer) : ls_std::Class("Logger"),
 logLevel(ls_std::LogLevelValue::INFO)
 {
   if(_writer == nullptr) {

+ 2 - 2
source/ls_std/io/xml/XMLAttribute.cpp

@@ -3,13 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-23
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
 #include <ls_std/io/xml/XMLAttribute.hpp>
 
-ls_std::XMLAttribute::XMLAttribute(std::string _name) : Class("XMLAttribute"),
+ls_std::XMLAttribute::XMLAttribute(std::string _name) : ls_std::Class("XMLAttribute"),
 name(std::move(_name))
 {}
 

+ 2 - 2
source/ls_std/io/xml/XMLDeclaration.cpp

@@ -3,14 +3,14 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-29
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
 #include <ls_std/io/xml/XMLDeclaration.hpp>
 
 ls_std::XMLDeclaration::XMLDeclaration(std::string _version) :
-Class("XMLDeclaration")
+ls_std::Class("XMLDeclaration")
 {
   this->version.setValue(std::move(_version));
 }

+ 2 - 2
source/ls_std/io/xml/XMLDocument.cpp

@@ -3,13 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-30
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
 #include <ls_std/io/xml/XMLDocument.hpp>
 
-ls_std::XMLDocument::XMLDocument() : Class("XMLDocument")
+ls_std::XMLDocument::XMLDocument() : ls_std::Class("XMLDocument")
 {}
 
 std::shared_ptr<ls_std::XMLDeclaration> ls_std::XMLDocument::getDeclaration()

+ 5 - 5
source/ls_std/io/xml/XMLNode.cpp

@@ -3,14 +3,14 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-24
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
 #include <ls_std/io/xml/XMLNode.hpp>
 #include <ls_std/utils/STLUtils.hpp>
 
-ls_std::XMLNode::XMLNode(std::string _name) : Class("XMLNode"),
+ls_std::XMLNode::XMLNode(std::string _name) : ls_std::Class("XMLNode"),
 name(std::move(_name))
 {}
 
@@ -118,7 +118,7 @@ bool ls_std::XMLNode::addChildBefore(const std::shared_ptr<ls_std::XMLNode>& _ch
   return added;
 }
 
-bool ls_std::XMLNode::addChildToBeginning(const std::shared_ptr<XMLNode> &_child)
+bool ls_std::XMLNode::addChildToBeginning(const std::shared_ptr<ls_std::XMLNode> &_child)
 {
   bool added {};
 
@@ -130,7 +130,7 @@ bool ls_std::XMLNode::addChildToBeginning(const std::shared_ptr<XMLNode> &_child
   return added;
 }
 
-bool ls_std::XMLNode::addChildToEnd(const std::shared_ptr<XMLNode>& _child)
+bool ls_std::XMLNode::addChildToEnd(const std::shared_ptr<ls_std::XMLNode>& _child)
 {
   bool added {};
 
@@ -190,7 +190,7 @@ bool ls_std::XMLNode::hasChild(const std::string &_name)
   return this->_hasChild(_name);
 }
 
-bool ls_std::XMLNode::hasChild(const std::shared_ptr<XMLNode> &_child)
+bool ls_std::XMLNode::hasChild(const std::shared_ptr<ls_std::XMLNode> &_child)
 {
   return this->_hasChild(_child);
 }

+ 371 - 0
source/ls_std/io/xml/XMLParser.cpp

@@ -0,0 +1,371 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-11-26
+ * Changed:         2020-11-26
+ *
+ * */
+
+#include <ls_std/io/xml/XMLParser.hpp>
+#include <ls_std/exception/IllegalArgumentException.hpp>
+#include <ls_std/boxing/String.hpp>
+
+ls_std::XMLParser::XMLParser(const std::shared_ptr<ls_std::XMLDocument> &_document) : ls_std::Class("XMLParser")
+{
+  this->_assignDocument(_document);
+  this->_reset();
+}
+
+std::shared_ptr<ls_std::XMLDocument> ls_std::XMLParser::getDocument()
+{
+  return this->document;
+}
+
+void ls_std::XMLParser::parse(const ls_std::byte_field &_data)
+{
+  this->_parse(_data);
+  this->_mergeNodes();
+  this->_reset();
+}
+
+void ls_std::XMLParser::setDocument(const std::shared_ptr<ls_std::XMLDocument> &_document)
+{
+  this->_assignDocument(_document);
+}
+
+std::pair<std::string, std::string> ls_std::XMLParser::_readAttribute_(const ls_std::byte_field &_data)
+{
+  return ls_std::XMLParser::_parseAttribute(_data);
+}
+
+std::list<std::pair<std::string, std::string>> ls_std::XMLParser::_readAttributes_(ls_std::byte_field _data)
+{
+  return ls_std::XMLParser::_parseAttributes(std::move(_data));
+}
+
+void ls_std::XMLParser::_analyze(const ls_std::byte_field &_data, std::string::size_type _index)
+{
+  this->_isDeclaration(_data, _index);
+  this->_isClosingTag(_data, _index);
+  this->_isOpeningTag(_data, _index);
+  this->_isValue(_data, _index);
+}
+
+void ls_std::XMLParser::_assignDocument(const std::shared_ptr<ls_std::XMLDocument> &_document)
+{
+  if(_document == nullptr) {
+    throw ls_std::IllegalArgumentException {};
+  }
+
+  this->document = _document;
+}
+
+std::shared_ptr<ls_std::XMLDeclaration> ls_std::XMLParser::_createDeclaration(const std::list<std::pair<std::string, std::string>> &_attributes)
+{
+  std::shared_ptr<ls_std::XMLDeclaration> declaration = std::make_shared<ls_std::XMLDeclaration>("1.0");
+  std::pair<std::string, std::string> attribute = ls_std::XMLParser::_findAttribute(_attributes, "version");
+
+  if(!attribute.first.empty()) {
+    declaration->setVersion(attribute.second);
+  }
+
+  attribute = ls_std::XMLParser::_findAttribute(_attributes, "encoding");
+
+  if(!attribute.first.empty()) {
+    declaration->setEncoding(attribute.second);
+  }
+
+  attribute = ls_std::XMLParser::_findAttribute(_attributes, "standalone");
+
+  if(!attribute.first.empty()) {
+    declaration->setStandalone(attribute.second);
+  }
+
+  return declaration;
+}
+
+std::shared_ptr<ls_std::XMLNode> ls_std::XMLParser::_createNode(const std::list<std::pair<std::string, std::string>> &_attributes, const std::string &_name)
+{
+  std::shared_ptr<ls_std::XMLNode> node = std::make_shared<ls_std::XMLNode>(_name);
+  std::shared_ptr<ls_std::XMLAttribute> attribute {};
+
+  for(const auto& parsedAttribute : _attributes) {
+    attribute = std::make_shared<ls_std::XMLAttribute>(parsedAttribute.first);
+    attribute->setValue(parsedAttribute.second);
+    node->addAttributeToEnd(attribute);
+  }
+
+  return node;
+}
+
+std::pair<std::string, std::string> ls_std::XMLParser::_findAttribute(const std::list<std::pair<std::string, std::string>> &_attributes, const std::string &_name)
+{
+  std::pair<std::string, std::string> attribute {};
+
+  for(const auto& currentAttribute : _attributes) {
+    if(currentAttribute.first == _name) {
+      attribute = currentAttribute;
+      break;
+    }
+  }
+
+  return attribute;
+}
+
+size_t ls_std::XMLParser::_findAttributeEndPosition(const ls_std::byte_field &_data)
+{
+  std::string::size_type position = std::string::npos;
+  std::string::size_type counter {};
+
+  for(char letter : _data) {
+    if(letter == '"') {
+      counter++;
+    }
+
+    if(counter == 2) {
+      break;
+    }
+
+    position++;
+  }
+
+  return position;
+}
+
+ls_std::byte_field ls_std::XMLParser::_getNextTagString(const ls_std::byte_field &_data, std::string::size_type _index)
+{
+  ls_std::byte_field tag {};
+  size_t closingCharacterPosition = _index + _data.substr(_index).find('>');
+
+  if(closingCharacterPosition != std::string::npos) {
+    tag = _data.substr(_index, (closingCharacterPosition - _index) + 1);
+  }
+
+  return tag;
+}
+
+void ls_std::XMLParser::_isClosingTag(const ls_std::byte_field &_data, std::string::size_type _index)
+{
+  if(this->mode == XML_PARSE_MODE_ANALYZE && _data.substr(_index, 2) == "</") {
+    this->mode = XML_PARSE_MODE_CLOSING_TAG;
+  }
+}
+
+void ls_std::XMLParser::_isDeclaration(const ls_std::byte_field &_data, std::string::size_type _index)
+{
+  if(_data.substr(_index, 5) == "<?xml") {
+    this->mode = XML_PARSE_MODE_DECLARATION;
+  }
+}
+
+void ls_std::XMLParser::_isOpeningTag(const ls_std::byte_field &_data, std::string::size_type _index)
+{
+  if(this->mode == XML_PARSE_MODE_ANALYZE && _data.substr(_index, 1) == "<") {
+    this->mode = XML_PARSE_MODE_OPENING_TAG;
+  }
+}
+
+void ls_std::XMLParser::_isValue(const ls_std::byte_field &_data, std::string::size_type _index)
+{
+  if(this->mode == XML_PARSE_MODE_ANALYZE) {
+    std::string::size_type end = _data.substr(_index).find('<');
+    bool isValue = _data[_index - 1] == '>' && end != std::string::npos && end > 0;
+
+    if(isValue) {
+      ls_std::String value {_data.substr(_index, end)};
+
+      if(!value.contains("\n") && !value.contains("\r\n") ) {
+        this->mode = XML_PARSE_MODE_VALUE;
+      }
+    }
+  }
+}
+
+void ls_std::XMLParser::_mergeNodes()
+{
+  while(this->maxLevel > 1) {
+    this->_mergeNodesOnCurrentLevel();
+    this->maxLevel -= 1;
+  }
+
+  this->document->setRootElement(this->parseData.front().node);
+}
+
+void ls_std::XMLParser::_mergeChildrenToParentNode(const std::shared_ptr<ls_std::XMLNode> &_parent, std::list<ls_std::XMLParseData>::iterator &_iterator, uint8_t _parentLevel)
+{
+  do {
+    _iterator++;
+
+    if(_iterator == this->parseData.end()) {
+      break;
+    }
+    else {
+      if(_iterator->level == this->maxLevel) {
+        _parent->addChildToEnd(_iterator->node);
+      }
+    }
+  }
+  while(_iterator->level > _parentLevel);
+}
+
+void ls_std::XMLParser::_mergeNodesOnCurrentLevel()
+{
+  auto iterator = this->parseData.begin();
+  uint8_t parentLevel = this->maxLevel - 1;
+
+  while(iterator != this->parseData.end()) {
+    if(iterator->level == parentLevel) {
+      this->_mergeChildrenToParentNode(iterator->node, iterator, parentLevel);
+    }
+    else {
+      iterator++;
+    }
+  }
+}
+
+void ls_std::XMLParser::_parse(const ls_std::byte_field &_data)
+{
+  for(std::string::size_type index = 0 ; index < _data.size() ; index++) {
+    switch(this->mode) {
+      case XML_PARSE_MODE_ANALYZE:
+      {
+        this->_analyze(_data, index);
+      } break;
+      case XML_PARSE_MODE_DECLARATION:
+      {
+        --index;
+        index = this->_parseDeclaration(_data, index);
+        this->mode = XML_PARSE_MODE_ANALYZE;
+      } break;
+      case XML_PARSE_MODE_OPENING_TAG:
+      {
+        --index;
+        index = ls_std::XMLParser::_parseOpeningTag(_data, index);
+        this->mode = XML_PARSE_MODE_ANALYZE;
+      } break;
+      case XML_PARSE_MODE_VALUE:
+      {
+        --index;
+        index = ls_std::XMLParser::_parseValue(_data, index);
+        this->mode = XML_PARSE_MODE_ANALYZE;
+      } break;
+      case XML_PARSE_MODE_CLOSING_TAG:
+      {
+        --index;
+        index = ls_std::XMLParser::_parseClosingTag(_data, index);
+        this->mode = XML_PARSE_MODE_ANALYZE;
+      } break;
+    }
+  }
+}
+
+std::pair<std::string, std::string> ls_std::XMLParser::_parseAttribute(const ls_std::byte_field &_data)
+{
+  std::pair<std::string, std::string> parsedAttribute {};
+  parsedAttribute.first = _data.substr(0, _data.find('='));
+  parsedAttribute.second  = _data.substr(_data.find('"') + 1);
+  parsedAttribute.second.pop_back();
+
+  return parsedAttribute;
+}
+
+std::list<std::pair<std::string, std::string>> ls_std::XMLParser::_parseAttributes(ls_std::byte_field _data)
+{
+  std::list<std::pair<std::string, std::string>> attributes {};
+  size_t position = _data.find(' ');
+  _data = position == std::string::npos ? "" : _data.substr(position);
+
+  while(!_data.empty()) {
+    do {
+      position = _data.find(' ') + 1;
+    }
+    while(_data[position] == ' ');
+
+    if(_data.size() <= 3 && ls_std::String {_data}.endsWith(">")) {
+      break;
+    }
+
+    std::string attributeString = _data.substr(position, ls_std::XMLParser::_findAttributeEndPosition(_data) + 1);
+    attributes.push_back(ls_std::XMLParser::_parseAttribute(attributeString));
+    _data = _data.substr(position + attributeString.size());
+  }
+
+  return attributes;
+}
+
+size_t ls_std::XMLParser::_parseClosingTag(const ls_std::byte_field &_data, std::string::size_type _index)
+{
+  std::string tagString = ls_std::XMLParser::_getNextTagString(_data, _index);
+  this->currentLevel -= 1;
+  return tagString.empty() ? _index : _index + (tagString.size() - 1);
+}
+
+size_t ls_std::XMLParser::_parseDeclaration(const ls_std::byte_field &_data, std::string::size_type _index)
+{
+  std::string tagString = ls_std::XMLParser::_getNextTagString(_data, _index);
+  bool isValidTagString = !tagString.empty();
+
+  if(isValidTagString) {
+    std::shared_ptr<ls_std::XMLDeclaration> declaration = this->_createDeclaration(ls_std::XMLParser::_parseAttributes(tagString));
+    this->document->setDeclaration(declaration);
+  }
+
+  return !isValidTagString ? _index : _index + (tagString.size() - 1);
+}
+
+size_t ls_std::XMLParser::_parseOpeningTag(const ls_std::byte_field &_data, std::string::size_type _index)
+{
+  ls_std::String tagString {ls_std::XMLParser::_getNextTagString(_data, _index)};
+  bool isValidTagString = !tagString.toString().empty();
+  ls_std::XMLParseData singleParseData {};
+
+  if(isValidTagString) {
+    std::shared_ptr<ls_std::XMLNode> node = ls_std::XMLParser::_createNode(ls_std::XMLParser::_parseAttributes(tagString), ls_std::XMLParser::_parseTagName(tagString));
+
+    singleParseData.level = this->currentLevel;
+    singleParseData.node = node;
+    this->parseData.push_back(singleParseData);
+
+    if(!tagString.endsWith("/>")) {
+      this->currentLevel += 1;
+      this->_setMaxLevel();
+    }
+  }
+
+  return !isValidTagString ? _index : _index + (tagString.toString().size() - 1);
+}
+
+ls_std::byte_field ls_std::XMLParser::_parseTagName(const ls_std::byte_field &_data)
+{
+  std::string::size_type position = _data.find(' ');
+
+  if(position == std::string::npos) {
+    position = _data.find('>');
+  }
+
+  return _data.substr(1, position - 1);
+}
+
+size_t ls_std::XMLParser::_parseValue(const ls_std::byte_field &_data, std::string::size_type _index)
+{
+  ls_std::byte_field value = _data.substr(_index, _data.substr(_index).find('<'));
+  this->parseData.back().node->setValue(value);
+
+  return _index + (value.size() - 1);
+}
+
+void ls_std::XMLParser::_reset()
+{
+  this->currentLevel = 1;
+  this->maxLevel = 1;
+  this->mode = XML_PARSE_MODE_ANALYZE;
+  this->parseData.clear();
+}
+
+void ls_std::XMLParser::_setMaxLevel()
+{
+  if(this->currentLevel > this->maxLevel) {
+    this->maxLevel = this->currentLevel;
+  }
+}

+ 23 - 0
source/ls_std/io/xml/XMLParserMock.cpp

@@ -0,0 +1,23 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-10-18
+ * Changed:         2020-11-26
+ *
+ * */
+
+#include <ls_std/io/xml/XMLParserMock.hpp>
+
+ls_std::XMLParserMock::XMLParserMock() : ls_std::XMLParser(nullptr)
+{}
+
+std::pair<std::string, std::string> ls_std::XMLParserMock::readAttribute(const ls_std::byte_field &_data)
+{
+  return ls_std::XMLParser::_readAttribute_(_data);
+}
+
+std::list<std::pair<std::string, std::string>> ls_std::XMLParserMock::readAttributes(ls_std::byte_field _data)
+{
+  return ls_std::XMLParser::_readAttributes_(std::move(_data));
+}

+ 16 - 338
source/ls_std/io/xml/XMLReader.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-10
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -11,23 +11,19 @@
 #include <ls_std/exception/IllegalArgumentException.hpp>
 #include <ls_std/io/FileReader.hpp>
 #include <ls_std/boxing/String.hpp>
+#include <ls_std/io/xml/XMLParser.hpp>
 
-ls_std::XMLReader::XMLReader(const std::shared_ptr<ls_std::XMLDocument>& _document, const std::string& _absolutePath) :
-Class("XMLReader"),
-xmlFile(ls_std::File {_absolutePath}),
-document(_document)
+ls_std::XMLReader::XMLReader(const std::shared_ptr<ls_std::XMLDocument>& _document, const std::string& _absolutePath) : ls_std::Class("XMLReader"),
+xmlFile(ls_std::File {""})
 {
-  XMLReader::_checkDocumentExistence(_document);
-  XMLReader::_checkFileExistence(this->xmlFile);
-  this->_reset();
+  this->_assignDocument(_document);
+  this->_assignFile(ls_std::File {_absolutePath});
 }
 
 ls_std::byte_field ls_std::XMLReader::read()
 {
   ls_std::byte_field data = ls_std::FileReader {this->xmlFile}.read();
-  this->_parse(data);
-  this->_mergeNodes();
-  this->_reset();
+  ls_std::XMLParser {this->document}.parse(data);
 
   return data;
 }
@@ -37,348 +33,30 @@ std::shared_ptr<ls_std::XMLDocument> ls_std::XMLReader::getDocument()
   return this->document;
 }
 
-void ls_std::XMLReader::setFile(const ls_std::File &_xmlFile)
-{
-  XMLReader::_checkFileExistence(_xmlFile);
-  this->xmlFile = _xmlFile;
-}
-
-std::pair<std::string, std::string> ls_std::XMLReader::_readAttribute_(const ls_std::byte_field &_data)
+void ls_std::XMLReader::setDocument(const std::shared_ptr<ls_std::XMLDocument> &_document)
 {
-  return ls_std::XMLReader::_parseAttribute(_data);
+  this->_assignDocument(_document);
 }
 
-std::list<std::pair<std::string, std::string>> ls_std::XMLReader::_readAttributes_(ls_std::byte_field _data)
-{
-  return ls_std::XMLReader::_parseAttributes(std::move(_data));
-}
-
-void ls_std::XMLReader::_analyze(const ls_std::byte_field &_data, std::string::size_type _index)
+void ls_std::XMLReader::setFile(const ls_std::File &_xmlFile)
 {
-  this->_isDeclaration(_data, _index);
-  this->_isClosingTag(_data, _index);
-  this->_isOpeningTag(_data, _index);
-  this->_isValue(_data, _index);
+  this->_assignFile(_xmlFile);
 }
 
-void ls_std::XMLReader::_checkDocumentExistence(const std::shared_ptr<ls_std::XMLDocument>& _document)
+void ls_std::XMLReader::_assignDocument(const std::shared_ptr<ls_std::XMLDocument> &_document)
 {
   if(_document == nullptr) {
     throw ls_std::IllegalArgumentException {};
   }
+
+  this->document = _document;
 }
 
-void ls_std::XMLReader::_checkFileExistence(ls_std::File _xmlFile)
+void ls_std::XMLReader::_assignFile(ls_std::File _xmlFile)
 {
   if(!_xmlFile.exists()) {
     throw ls_std::IllegalArgumentException {};
   }
-}
-
-std::shared_ptr<ls_std::XMLDeclaration> ls_std::XMLReader::_createDeclaration(const std::list<std::pair<std::string, std::string>>& _attributes)
-{
-  std::shared_ptr<ls_std::XMLDeclaration> declaration = std::make_shared<ls_std::XMLDeclaration>("1.0");
-  std::pair<std::string, std::string> attribute = ls_std::XMLReader::_findAttribute(_attributes, "version");
-
-  if(!attribute.first.empty()) {
-    declaration->setVersion(attribute.second);
-  }
-
-  attribute = ls_std::XMLReader::_findAttribute(_attributes, "encoding");
-
-  if(!attribute.first.empty()) {
-    declaration->setEncoding(attribute.second);
-  }
-
-  attribute = ls_std::XMLReader::_findAttribute(_attributes, "standalone");
-
-  if(!attribute.first.empty()) {
-    declaration->setStandalone(attribute.second);
-  }
-
-  return declaration;
-}
-
-std::shared_ptr<ls_std::XMLNode> ls_std::XMLReader::_createNode(const std::list<std::pair<std::string, std::string>> &_attributes, const std::string& _name)
-{
-  std::shared_ptr<ls_std::XMLNode> node = std::make_shared<ls_std::XMLNode>(_name);
-  std::shared_ptr<ls_std::XMLAttribute> attribute {};
-
-  for(const auto& parsedAttribute : _attributes) {
-    attribute = std::make_shared<ls_std::XMLAttribute>(parsedAttribute.first);
-    attribute->setValue(parsedAttribute.second);
-    node->addAttributeToEnd(attribute);
-  }
-
-  return node;
-}
-
-std::pair<std::string, std::string> ls_std::XMLReader::_findAttribute(const std::list<std::pair<std::string, std::string>> &_attributes, const std::string &_name)
-{
-  std::pair<std::string, std::string> attribute {};
-
-  for(const auto& currentAttribute : _attributes) {
-    if(currentAttribute.first == _name) {
-      attribute = currentAttribute;
-      break;
-    }
-  }
-
-  return attribute;
-}
-
-size_t ls_std::XMLReader::_findAttributeEndPosition(const ls_std::byte_field &_data)
-{
-  std::string::size_type position = std::string::npos;
-  std::string::size_type counter {};
-
-  for(char letter : _data) {
-    if(letter == '"') {
-      counter++;
-    }
-
-    if(counter == 2) {
-      break;
-    }
-
-    position++;
-  }
-
-  return position;
-}
-
-ls_std::byte_field ls_std::XMLReader::_getNextTagString(const ls_std::byte_field &_data, std::string::size_type _index)
-{
-  ls_std::byte_field tag {};
-  size_t closingCharacterPosition = _index + _data.substr(_index).find('>');
-
-  if(closingCharacterPosition != std::string::npos) {
-    tag = _data.substr(_index, (closingCharacterPosition - _index) + 1);
-  }
-
-  return tag;
-}
-
-void ls_std::XMLReader::_isClosingTag(const ls_std::byte_field &_data, std::string::size_type _index)
-{
-  if(this->mode == XML_PARSE_MODE_ANALYZE && _data.substr(_index, 2) == "</") {
-    this->mode = XML_PARSE_MODE_CLOSING_TAG;
-  }
-}
-
-void ls_std::XMLReader::_isDeclaration(const ls_std::byte_field& _data, std::string::size_type _index)
-{
-  if(_data.substr(_index, 5) == "<?xml") {
-    this->mode = XML_PARSE_MODE_DECLARATION;
-  }
-}
-
-void ls_std::XMLReader::_isOpeningTag(const ls_std::byte_field &_data, std::string::size_type _index)
-{
-  if(this->mode == XML_PARSE_MODE_ANALYZE && _data.substr(_index, 1) == "<") {
-    this->mode = XML_PARSE_MODE_OPENING_TAG;
-  }
-}
-
-void ls_std::XMLReader::_isValue(const ls_std::byte_field &_data, std::string::size_type _index)
-{
-  if(this->mode == XML_PARSE_MODE_ANALYZE) {
-    std::string::size_type end = _data.substr(_index).find('<');
-    bool isValue = _data[_index - 1] == '>' && end != std::string::npos && end > 0;
-
-    if(isValue) {
-      ls_std::String value {_data.substr(_index, end)};
-
-      if(!value.contains("\n") && !value.contains("\r\n") ) {
-        this->mode = XML_PARSE_MODE_VALUE;
-      }
-    }
-  }
-}
-
-void ls_std::XMLReader::_mergeNodes()
-{
-  while(this->maxLevel > 1) {
-    this->_mergeNodesOnCurrentLevel();
-    this->maxLevel -= 1;
-  }
-
-  this->document->setRootElement(this->parseData.front().node);
-}
-
-void ls_std::XMLReader::_mergeChildrenToParentNode(const std::shared_ptr<ls_std::XMLNode>& _parent, std::list<ls_std::XMLParseData>::iterator& _iterator, uint8_t _parentLevel)
-{
-  do {
-    _iterator++;
 
-    if(_iterator == this->parseData.end()) {
-      break;
-    }
-    else {
-      if(_iterator->level == this->maxLevel) {
-        _parent->addChildToEnd(_iterator->node);
-      }
-    }
-  }
-  while(_iterator->level > _parentLevel);
-}
-
-void ls_std::XMLReader::_mergeNodesOnCurrentLevel() {
-  auto iterator = this->parseData.begin();
-  uint8_t parentLevel = this->maxLevel - 1;
-
-  while(iterator != this->parseData.end()) {
-    if(iterator->level == parentLevel) {
-      this->_mergeChildrenToParentNode(iterator->node, iterator, parentLevel);
-    }
-    else {
-      iterator++;
-    }
-  }
-}
-
-void ls_std::XMLReader::_parse(const ls_std::byte_field &_data)
-{
-  for(std::string::size_type index = 0 ; index < _data.size() ; index++) {
-    switch(this->mode) {
-      case XML_PARSE_MODE_ANALYZE:
-      {
-        this->_analyze(_data, index);
-      } break;
-      case XML_PARSE_MODE_DECLARATION:
-      {
-        --index;
-        index = this->_parseDeclaration(_data, index);
-        this->mode = XML_PARSE_MODE_ANALYZE;
-      } break;
-      case XML_PARSE_MODE_OPENING_TAG:
-      {
-        --index;
-        index = ls_std::XMLReader::_parseOpeningTag(_data, index);
-        this->mode = XML_PARSE_MODE_ANALYZE;
-      } break;
-      case XML_PARSE_MODE_VALUE:
-      {
-        --index;
-        index = ls_std::XMLReader::_parseValue(_data, index);
-        this->mode = XML_PARSE_MODE_ANALYZE;
-      } break;
-      case XML_PARSE_MODE_CLOSING_TAG:
-      {
-        --index;
-        index = ls_std::XMLReader::_parseClosingTag(_data, index);
-        this->mode = XML_PARSE_MODE_ANALYZE;
-      } break;
-    }
-  }
-}
-
-std::pair<std::string, std::string> ls_std::XMLReader::_parseAttribute(const ls_std::byte_field &_data)
-{
-  std::pair<std::string, std::string> parsedAttribute {};
-  parsedAttribute.first = _data.substr(0, _data.find('='));
-  parsedAttribute.second  = _data.substr(_data.find('"') + 1);
-  parsedAttribute.second.pop_back();
-
-  return parsedAttribute;
-}
-
-std::list<std::pair<std::string, std::string>> ls_std::XMLReader::_parseAttributes(ls_std::byte_field _data)
-{
-  std::list<std::pair<std::string, std::string>> attributes {};
-  size_t position = _data.find(' ');
-  _data = position == std::string::npos ? "" : _data.substr(position);
-
-  while(!_data.empty()) {
-    do {
-      position = _data.find(' ') + 1;
-    }
-    while(_data[position] == ' ');
-
-    if(_data.size() <= 3 && ls_std::String {_data}.endsWith(">")) {
-      break;
-    }
-
-    std::string attributeString = _data.substr(position, ls_std::XMLReader::_findAttributeEndPosition(_data) + 1);
-    attributes.push_back(ls_std::XMLReader::_parseAttribute(attributeString));
-    _data = _data.substr(position + attributeString.size());
-  }
-
-  return attributes;
-}
-
-size_t ls_std::XMLReader::_parseClosingTag(const ls_std::byte_field &_data, std::string::size_type _index)
-{
-  std::string tagString = ls_std::XMLReader::_getNextTagString(_data, _index);
-  this->currentLevel -= 1;
-  return tagString.empty() ? _index : _index + (tagString.size() - 1);
-}
-
-size_t ls_std::XMLReader::_parseDeclaration(const ls_std::byte_field &_data, std::string::size_type _index)
-{
-  std::string tagString = ls_std::XMLReader::_getNextTagString(_data, _index);
-  bool isValidTagString = !tagString.empty();
-
-  if(isValidTagString) {
-    std::shared_ptr<ls_std::XMLDeclaration> declaration = this->_createDeclaration(ls_std::XMLReader::_parseAttributes(tagString));
-    this->document->setDeclaration(declaration);
-  }
-
-  return !isValidTagString ? _index : _index + (tagString.size() - 1);
-}
-
-size_t ls_std::XMLReader::_parseOpeningTag(const ls_std::byte_field &_data, std::string::size_type _index)
-{
-  ls_std::String tagString {ls_std::XMLReader::_getNextTagString(_data, _index)};
-  bool isValidTagString = !tagString.toString().empty();
-  ls_std::XMLParseData singleParseData {};
-
-  if(isValidTagString) {
-    std::shared_ptr<ls_std::XMLNode> node = ls_std::XMLReader::_createNode(ls_std::XMLReader::_parseAttributes(tagString), ls_std::XMLReader::_parseTagName(tagString));
-
-    singleParseData.level = this->currentLevel;
-    singleParseData.node = node;
-    this->parseData.push_back(singleParseData);
-
-    if(!tagString.endsWith("/>")) {
-      this->currentLevel += 1;
-      this->_setMaxLevel();
-    }
-  }
-
-  return !isValidTagString ? _index : _index + (tagString.toString().size() - 1);
-}
-
-ls_std::byte_field ls_std::XMLReader::_parseTagName(const ls_std::byte_field &_data)
-{
-  std::string::size_type position = _data.find(' ');
-
-  if(position == std::string::npos) {
-    position = _data.find('>');
-  }
-
-  return _data.substr(1, position - 1);
-}
-
-size_t ls_std::XMLReader::_parseValue(const ls_std::byte_field &_data, std::string::size_type _index)
-{
-  ls_std::byte_field value = _data.substr(_index, _data.substr(_index).find('<'));
-  this->parseData.back().node->setValue(value);
-
-  return _index + (value.size() - 1);
-}
-
-void ls_std::XMLReader::_reset()
-{
-  this->currentLevel = 1;
-  this->maxLevel = 1;
-  this->mode = XML_PARSE_MODE_ANALYZE;
-  this->parseData.clear();
-}
-
-void ls_std::XMLReader::_setMaxLevel()
-{
-  if(this->currentLevel > this->maxLevel) {
-    this->maxLevel = this->currentLevel;
-  }
+  this->xmlFile = _xmlFile;
 }

+ 0 - 23
source/ls_std/io/xml/XMLReaderMock.cpp

@@ -1,23 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-10-18
- * Changed:         2020-11-25
- *
- * */
-
-#include <ls_std/io/xml/XMLReaderMock.hpp>
-
-ls_std::XMLReaderMock::XMLReaderMock() : XMLReader(nullptr, "")
-{}
-
-std::pair<std::string, std::string> ls_std::XMLReaderMock::readAttribute(const ls_std::byte_field &_data)
-{
-  return ls_std::XMLReader::_readAttribute_(_data);
-}
-
-std::list<std::pair<std::string, std::string>> ls_std::XMLReaderMock::readAttributes(ls_std::byte_field _data)
-{
-  return ls_std::XMLReader::_readAttributes_(std::move(_data));
-}

+ 13 - 0
source/ls_std/logic/IListener.cpp

@@ -0,0 +1,13 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-11-14
+ * Changed:         2020-11-26
+ *
+ * */
+
+#include "../../../include/ls_std/logic/IListener.hpp"
+
+ls_std::IListener::IListener() : ls_std::Class("IListener")
+{}

+ 45 - 0
source/ls_std/logic/Narrator.cpp

@@ -0,0 +1,45 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-11-14
+ * Changed:         2020-11-28
+ *
+ * */
+
+#include <ls_std/utils/STLUtils.hpp>
+#include "../../../include/ls_std/logic/Narrator.hpp"
+
+ls_std::Narrator::Narrator() : ls_std::Class("Narrator")
+{}
+
+void ls_std::Narrator::addListener(const std::shared_ptr<ls_std::IListener>& _listener)
+{
+  if(!ls_std::STLUtils::contains(this->listeners, _listener)) {
+    this->listeners.push_back(_listener);
+  }
+}
+
+void ls_std::Narrator::clear()
+{
+  this->listeners.clear();
+}
+
+std::list<std::shared_ptr<ls_std::IListener>> ls_std::Narrator::getListeners()
+{
+  return this->listeners;
+}
+
+void ls_std::Narrator::removeListener(const std::shared_ptr<ls_std::IListener>& _listener)
+{
+  if(ls_std::STLUtils::contains(this->listeners, _listener)) {
+    this->listeners.remove(_listener);
+  }
+}
+
+void ls_std::Narrator::tell(const ls_std::Class &_info)
+{
+  for(const auto& listener : this->listeners) {
+    listener->listen(_info);
+  }
+}

+ 7 - 7
source/ls_std/logic/State.cpp

@@ -3,17 +3,17 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-05
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
 #include <ls_std/logic/State.hpp>
 
-ls_std::State::State(ls_std::StateId _id) : Class("State"),
+ls_std::State::State(ls_std::StateId _id) : ls_std::Class("State"),
 id(std::move(_id))
 {}
 
-bool ls_std::State::addStateConnection(const StateConnectionId& _connectionId, const std::shared_ptr<State>& _connectedState)
+bool ls_std::State::addStateConnection(const ls_std::StateConnectionId& _connectionId, const std::shared_ptr<ls_std::State>& _connectedState)
 {
   bool added {};
   std::shared_ptr<ls_std::StateConnection> connection {};
@@ -27,7 +27,7 @@ bool ls_std::State::addStateConnection(const StateConnectionId& _connectionId, c
   return added;
 }
 
-bool ls_std::State::addStateConnection(const std::shared_ptr<StateConnection>& _connection)
+bool ls_std::State::addStateConnection(const std::shared_ptr<ls_std::StateConnection>& _connection)
 {
   bool added {};
 
@@ -54,12 +54,12 @@ ls_std::StateId ls_std::State::getId()
   return this->id;
 }
 
-bool ls_std::State::hasConnection(const StateConnectionId &_connectionId)
+bool ls_std::State::hasConnection(const ls_std::StateConnectionId &_connectionId)
 {
   return this->_hasConnection(_connectionId);
 }
 
-void ls_std::State::setId(StateId _id)
+void ls_std::State::setId(ls_std::StateId _id)
 {
   this->id = std::move(_id);
 }
@@ -69,7 +69,7 @@ void ls_std::State::_clearConnections()
   this->connectedStates.clear();
 }
 
-bool ls_std::State::_hasConnection(const StateConnectionId &_connectionId)
+bool ls_std::State::_hasConnection(const ls_std::StateConnectionId &_connectionId)
 {
   return this->connectedStates.find(_connectionId) != this->connectedStates.end();
 }

+ 4 - 4
source/ls_std/logic/StateConnection.cpp

@@ -3,14 +3,14 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-10
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
 #include <ls_std/logic/StateConnection.hpp>
 
 ls_std::StateConnection::StateConnection(ls_std::StateConnectionId _connectionId, ls_std::StateId _stateId) :
-Class("StateConnection"),
+ls_std::Class("StateConnection"),
 connectionId(std::move(_connectionId)),
 stateId(std::move(_stateId))
 {}
@@ -27,12 +27,12 @@ bool ls_std::StateConnection::isPassable() const {
   return this->condition;
 }
 
-void ls_std::StateConnection::setConnectionId(StateConnectionId _connectionId)
+void ls_std::StateConnection::setConnectionId(ls_std::StateConnectionId _connectionId)
 {
   this->connectionId = std::move(_connectionId);
 }
 
-void ls_std::StateConnection::setStateId(StateId _stateId)
+void ls_std::StateConnection::setStateId(ls_std::StateId _stateId)
 {
   this->stateId = std::move(_stateId);
 }

+ 4 - 4
source/ls_std/logic/StateMachine.cpp

@@ -3,18 +3,18 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-05
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
 #include <ls_std/logic/StateMachine.hpp>
 
 ls_std::StateMachine::StateMachine(std::string _name) :
-Class("StateMachine"),
+ls_std::Class("StateMachine"),
 name(std::move(_name))
 {}
 
-bool ls_std::StateMachine::addState(const std::shared_ptr<State>& _state) {
+bool ls_std::StateMachine::addState(const std::shared_ptr<ls_std::State>& _state) {
   bool condition = !this->_hasState(_state->getId());
 
   if(condition) {
@@ -42,7 +42,7 @@ std::unordered_map<ls_std::StateId, std::shared_ptr<ls_std::State>> ls_std::Stat
   return this->states;
 }
 
-bool ls_std::StateMachine::hasState(const StateId &_id)
+bool ls_std::StateMachine::hasState(const ls_std::StateId &_id)
 {
   return this->_hasState(_id);
 }

+ 12 - 2
source/ls_std/serialization/json/boxing/SerializableJSONBoolean.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-04
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -11,7 +11,7 @@
 #include <ls_std/exception/IllegalArgumentException.hpp>
 
 ls_std::SerializableJSONBoolean::SerializableJSONBoolean(const std::shared_ptr<ls_std::Boolean>& _value) :
-Class("SerializableJSONBoolean")
+ls_std::Class("SerializableJSONBoolean")
 {
   this->_assignValue(_value);
 }
@@ -31,6 +31,16 @@ void ls_std::SerializableJSONBoolean::unmarshal(const ls_std::byte_field& _data)
   }
 }
 
+std::shared_ptr<ls_std::Boolean> ls_std::SerializableJSONBoolean::getValue()
+{
+  return this->value;
+}
+
+void ls_std::SerializableJSONBoolean::setValue(const std::shared_ptr<ls_std::Boolean> &_value)
+{
+  this->_assignValue(_value);
+}
+
 void ls_std::SerializableJSONBoolean::_assignValue(const std::shared_ptr<ls_std::Boolean> &_value)
 {
   if(_value == nullptr) {

+ 12 - 2
source/ls_std/serialization/json/boxing/SerializableJSONDouble.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-04
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -11,7 +11,7 @@
 #include <ls_std/exception/IllegalArgumentException.hpp>
 
 ls_std::SerializableJSONDouble::SerializableJSONDouble(const std::shared_ptr<ls_std::Double>& _value) :
-Class("SerializableJSONDouble")
+ls_std::Class("SerializableJSONDouble")
 {
   this->_assignValue(_value);
 }
@@ -32,6 +32,16 @@ void ls_std::SerializableJSONDouble::unmarshal(const ls_std::byte_field& _data)
   }
 }
 
+std::shared_ptr<ls_std::Double> ls_std::SerializableJSONDouble::getValue()
+{
+  return this->value;
+}
+
+void ls_std::SerializableJSONDouble::setValue(const std::shared_ptr<ls_std::Double> &_value)
+{
+  this->_assignValue(_value);
+}
+
 void ls_std::SerializableJSONDouble::_assignValue(const std::shared_ptr<ls_std::Double> &_value)
 {
   if(_value == nullptr) {

+ 12 - 2
source/ls_std/serialization/json/boxing/SerializableJSONFloat.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-04
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -11,7 +11,7 @@
 #include <ls_std/exception/IllegalArgumentException.hpp>
 
 ls_std::SerializableJSONFloat::SerializableJSONFloat(const std::shared_ptr<ls_std::Float>& _value) :
-Class("SerializableJSONFloat")
+ls_std::Class("SerializableJSONFloat")
 {
   this->_assignValue(_value);
 }
@@ -32,6 +32,16 @@ void ls_std::SerializableJSONFloat::unmarshal(const ls_std::byte_field& _data)
   }
 }
 
+std::shared_ptr<ls_std::Float> ls_std::SerializableJSONFloat::getValue()
+{
+  return this->value;
+}
+
+void ls_std::SerializableJSONFloat::setValue(const std::shared_ptr<ls_std::Float> &_value)
+{
+  this->_assignValue(_value);
+}
+
 void ls_std::SerializableJSONFloat::_assignValue(const std::shared_ptr<ls_std::Float> &_value)
 {
   if(_value == nullptr) {

+ 12 - 2
source/ls_std/serialization/json/boxing/SerializableJSONInteger.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-21
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -11,7 +11,7 @@
 #include <ls_std/exception/IllegalArgumentException.hpp>
 
 ls_std::SerializableJSONInteger::SerializableJSONInteger(const std::shared_ptr<ls_std::Integer>& _value) :
-Class("SerializableJSONInteger")
+ls_std::Class("SerializableJSONInteger")
 {
   this->_assignValue(_value);
 }
@@ -32,6 +32,16 @@ void ls_std::SerializableJSONInteger::unmarshal(const ls_std::byte_field& _data)
   }
 }
 
+std::shared_ptr<ls_std::Integer> ls_std::SerializableJSONInteger::getValue()
+{
+  return this->value;
+}
+
+void ls_std::SerializableJSONInteger::setValue(const std::shared_ptr<ls_std::Integer> &_value)
+{
+  this->_assignValue(_value);
+}
+
 void ls_std::SerializableJSONInteger::_assignValue(const std::shared_ptr<ls_std::Integer> &_value)
 {
   if(_value == nullptr) {

+ 12 - 2
source/ls_std/serialization/json/boxing/SerializableJSONLong.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-25
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -11,7 +11,7 @@
 #include <ls_std/exception/IllegalArgumentException.hpp>
 
 ls_std::SerializableJSONLong::SerializableJSONLong(const std::shared_ptr<ls_std::Long>& _value) :
-Class("SerializableJSONLong")
+ls_std::Class("SerializableJSONLong")
 {
   this->_assignValue(_value);
 }
@@ -32,6 +32,16 @@ void ls_std::SerializableJSONLong::unmarshal(const ls_std::byte_field& _data)
   }
 }
 
+std::shared_ptr<ls_std::Long> ls_std::SerializableJSONLong::getValue()
+{
+  return this->value;
+}
+
+void ls_std::SerializableJSONLong::setValue(const std::shared_ptr<ls_std::Long> &_value)
+{
+  this->_assignValue(_value);
+}
+
 void ls_std::SerializableJSONLong::_assignValue(const std::shared_ptr<ls_std::Long> &_value)
 {
   if(_value == nullptr) {

+ 12 - 2
source/ls_std/serialization/json/boxing/SerializableJSONString.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-30
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -11,7 +11,7 @@
 #include <ls_std/exception/IllegalArgumentException.hpp>
 
 ls_std::SerializableJSONString::SerializableJSONString(const std::shared_ptr<ls_std::String>& _value) :
-Class("SerializableJSONString")
+ls_std::Class("SerializableJSONString")
 {
   this->_assignValue(_value);
 }
@@ -32,6 +32,16 @@ void ls_std::SerializableJSONString::unmarshal(const ls_std::byte_field& _data)
   }
 }
 
+std::shared_ptr<ls_std::String> ls_std::SerializableJSONString::getValue()
+{
+  return this->value;
+}
+
+void ls_std::SerializableJSONString::setValue(const std::shared_ptr<ls_std::String> &_value)
+{
+  this->_assignValue(_value);
+}
+
 void ls_std::SerializableJSONString::_assignValue(const std::shared_ptr<ls_std::String> &_value)
 {
   if(_value == nullptr) {

+ 10 - 5
source/ls_std/serialization/json/logic/SerializableJSONState.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-15
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -11,8 +11,8 @@
 #include <ls_std/serialization/logic/SerializableJSONStateConnection.hpp>
 #include <ls_std/exception/IllegalArgumentException.hpp>
 
-ls_std::SerializableJSONState::SerializableJSONState(const std::shared_ptr<State>& _value) :
-Class("SerializableJSONState")
+ls_std::SerializableJSONState::SerializableJSONState(const std::shared_ptr<ls_std::State>& _value) :
+ls_std::Class("SerializableJSONState")
 {
   this->_assignValue(_value);
 }
@@ -31,13 +31,18 @@ void ls_std::SerializableJSONState::unmarshal(const ls_std::byte_field &_data)
   this->value->setId(this->jsonObject["id"]);
 }
 
-void ls_std::SerializableJSONState::setValue(const std::shared_ptr<State>& _value)
+std::shared_ptr<ls_std::State> ls_std::SerializableJSONState::getValue()
+{
+  return this->value;
+}
+
+void ls_std::SerializableJSONState::setValue(const std::shared_ptr<ls_std::State>& _value)
 {
   this->_assignValue(_value);
   this->_clear();
 }
 
-void ls_std::SerializableJSONState::_assignValue(const std::shared_ptr<State> &_value)
+void ls_std::SerializableJSONState::_assignValue(const std::shared_ptr<ls_std::State> &_value)
 {
   if(_value == nullptr) {
     throw ls_std::IllegalArgumentException {};

+ 7 - 2
source/ls_std/serialization/json/logic/SerializableJSONStateConnection.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-14
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -11,7 +11,7 @@
 #include <ls_std/exception/IllegalArgumentException.hpp>
 
 ls_std::SerializableJSONStateConnection::SerializableJSONStateConnection(const std::shared_ptr<ls_std::StateConnection>& _value) :
-Class("SerializableJSONStateConnection")
+ls_std::Class("SerializableJSONStateConnection")
 {
   this->_assignValue(_value);
 }
@@ -32,6 +32,11 @@ void ls_std::SerializableJSONStateConnection::unmarshal(const ls_std::byte_field
   this->value->updatePassCondition(this->jsonObject["condition"]);
 }
 
+std::shared_ptr<ls_std::StateConnection> ls_std::SerializableJSONStateConnection::getValue()
+{
+  return this->value;
+}
+
 void ls_std::SerializableJSONStateConnection::setValue(const std::shared_ptr<ls_std::StateConnection>& _value)
 {
   this->_assignValue(_value);

+ 14 - 4
source/ls_std/serialization/json/logic/SerializableJSONStateMachine.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-17
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -11,8 +11,8 @@
 #include <ls_std/serialization/logic/SerializableJSONState.hpp>
 #include <ls_std/exception/IllegalArgumentException.hpp>
 
-ls_std::SerializableJSONStateMachine::SerializableJSONStateMachine(const std::shared_ptr<StateMachine>& _value) :
-Class("SerializableJSONStateMachine")
+ls_std::SerializableJSONStateMachine::SerializableJSONStateMachine(const std::shared_ptr<ls_std::StateMachine>& _value) :
+ls_std::Class("SerializableJSONStateMachine")
 {
   this->_assignValue(_value);
 }
@@ -33,7 +33,17 @@ void ls_std::SerializableJSONStateMachine::unmarshal(const ls_std::byte_field &_
   this->value->setName(this->jsonObject["name"]);
 }
 
-void ls_std::SerializableJSONStateMachine::_assignValue(const std::shared_ptr<StateMachine> &_value)
+std::shared_ptr<ls_std::StateMachine> ls_std::SerializableJSONStateMachine::getValue()
+{
+  return this->value;
+}
+
+void ls_std::SerializableJSONStateMachine::setValue(const std::shared_ptr<ls_std::StateMachine> &_value)
+{
+  this->_assignValue(_value);
+}
+
+void ls_std::SerializableJSONStateMachine::_assignValue(const std::shared_ptr<ls_std::StateMachine> &_value)
 {
   if(_value == nullptr) {
     throw ls_std::IllegalArgumentException {};

+ 4 - 4
source/ls_std/time/Date.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -11,7 +11,7 @@
 #include <sstream>
 #include <ls_std/time/Date.hpp>
 
-ls_std::Date::Date() : Class("Date")
+ls_std::Date::Date() : ls_std::Class("Date")
 {
   this->timestamp = std::time(nullptr);
   this->_init();
@@ -27,11 +27,11 @@ ls_std::Date & ls_std::Date::operator-(int _value) {
   return *this;
 }
 
-bool ls_std::Date::after(const Date& _foreignDate) const {
+bool ls_std::Date::after(const ls_std::Date& _foreignDate) const {
   return this->timestamp > _foreignDate.getTime();
 }
 
-bool ls_std::Date::before(const Date& _foreignDate) const {
+bool ls_std::Date::before(const ls_std::Date& _foreignDate) const {
   return this->timestamp < _foreignDate.getTime();
 }
 

+ 2 - 2
test/cases/boxing/BooleanTest.cpp

@@ -3,13 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-09
- * Changed:         2020-10-29
+ * Changed:         2020-11-29
  *
  * */
 
 #include <gtest/gtest.h>
 #include <ls_std/ls_std.hpp>
-#include "../../TestHelper.hpp"
+#include <TestHelper.hpp>
 
 namespace {
   class BooleanTest : public ::testing::Test {

+ 2 - 2
test/cases/boxing/DoubleTest.cpp

@@ -3,13 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2020-10-29
+ * Changed:         2020-11-29
  *
  * */
 
 #include <gtest/gtest.h>
 #include <ls_std/ls_std.hpp>
-#include "../../TestHelper.hpp"
+#include <TestHelper.hpp>
 
 namespace {
   class DoubleTest : public ::testing::Test {

+ 2 - 2
test/cases/boxing/FloatTest.cpp

@@ -3,13 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2020-10-29
+ * Changed:         2020-11-29
  *
  * */
 
 #include <gtest/gtest.h>
 #include <ls_std/ls_std.hpp>
-#include "../../TestHelper.hpp"
+#include <TestHelper.hpp>
 
 namespace {
   class FloatTest : public ::testing::Test {

+ 2 - 2
test/cases/boxing/IntegerTest.cpp

@@ -3,13 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-09
- * Changed:         2020-10-29
+ * Changed:         2020-11-29
  *
  * */
 
 #include <gtest/gtest.h>
 #include <ls_std/ls_std.hpp>
-#include "../../TestHelper.hpp"
+#include <TestHelper.hpp>
 
 namespace {
   class IntegerTest : public ::testing::Test {

+ 2 - 2
test/cases/boxing/LongTest.cpp

@@ -3,13 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2020-10-29
+ * Changed:         2020-11-29
  *
  * */
 
 #include <gtest/gtest.h>
 #include <ls_std/ls_std.hpp>
-#include "../../TestHelper.hpp"
+#include <TestHelper.hpp>
 
 namespace {
   class LongTest : public ::testing::Test {

+ 1 - 1
test/cases/boxing/StringTest.cpp

@@ -9,7 +9,7 @@
 
 #include <gtest/gtest.h>
 #include <ls_std/ls_std.hpp>
-#include "../../TestHelper.hpp"
+#include <TestHelper.hpp>
 
 namespace {
   class StringTest : public ::testing::Test {

+ 33 - 0
test/cases/event/EventHandlerTest.cpp

@@ -0,0 +1,33 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-11-27
+ * Changed:         2020-11-29
+ *
+ * */
+
+#include <gtest/gtest.h>
+#include <ls_std/ls_std.hpp>
+#include <ls_std_test.hpp>
+
+namespace {
+  class EventHandlerTest : public ::testing::Test {
+    protected:
+
+      EventHandlerTest() = default;
+      ~EventHandlerTest() override = default;
+
+      void SetUp() override
+      {}
+
+      void TearDown() override
+      {}
+  };
+
+  TEST_F(EventHandlerTest, getId)
+  {
+    ls_std::EventHandler eventHandler {"EventId"};
+    ASSERT_STREQ("EventId", eventHandler.getId().c_str());
+  }
+}

+ 104 - 0
test/cases/event/EventManagerTest.cpp

@@ -0,0 +1,104 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-11-27
+ * Changed:         2020-11-29
+ *
+ * */
+
+#include <gtest/gtest.h>
+#include <ls_std/ls_std.hpp>
+#include <ls_std_test.hpp>
+
+namespace {
+  class EventManagerTest : public ::testing::Test {
+    protected:
+
+      EventManagerTest() = default;
+      ~EventManagerTest() override = default;
+
+      void SetUp() override
+      {}
+
+      void TearDown() override
+      {}
+  };
+
+  TEST_F(EventManagerTest, getClassName)
+  {
+    ls_std::EventManager eventManager {};
+    ASSERT_STREQ("EventManager", eventManager.getClassName().c_str());
+  }
+
+  TEST_F(EventManagerTest, production_example)
+  {
+    std::string news, expectedNews {};
+    ls_std::event_id seriousNewsEventId = ls_std_test::SeriousNewsEvent {""}.getId();
+    ls_std::event_id gossipNewsEventId = ls_std_test::GossipNewsEvent {""}.getId();
+
+    // create event handler
+
+    std::shared_ptr<ls_std::EventHandler> seriousNewsEventHandler = std::make_shared<ls_std::EventHandler>(seriousNewsEventId);   // event id
+    std::shared_ptr<ls_std::EventHandler> gossipNewsEventHandler = std::make_shared<ls_std::EventHandler>(gossipNewsEventId);     // event id
+
+    // create and fill event manager with handler
+
+    std::shared_ptr<ls_std::EventManager> eventManager = std::make_shared<ls_std::EventManager>();
+    eventManager->addEventHandler(seriousNewsEventHandler);
+    eventManager->addEventHandler(gossipNewsEventHandler);
+
+    // create news agency (listener)
+
+    std::shared_ptr<ls_std_test::DailyNewsAgency> dailyNews = std::make_shared<ls_std_test::DailyNewsAgency>();
+    std::shared_ptr<ls_std_test::GossipNewsAgency> gossipNews = std::make_shared<ls_std_test::GossipNewsAgency>();
+
+    // fire SeriousNewsEvent event with no effect
+
+    eventManager->fire(ls_std_test::SeriousNewsEvent(news)); // event call
+    ASSERT_TRUE(dailyNews->getNews().empty());
+    ASSERT_TRUE(gossipNews->getNews().empty());
+
+    // now subscribe to SeriousNewsEvent and fire SeriousNewsEvent event
+
+    eventManager->subscribe(seriousNewsEventId, dailyNews);
+    eventManager->subscribe(seriousNewsEventId, gossipNews);
+    news = "COVID-19 is still going on!";
+    eventManager->fire(ls_std_test::SeriousNewsEvent(news)); // event call
+
+    expectedNews = "DailyNewsAgency: " + news;
+    ASSERT_STREQ(expectedNews.c_str(), dailyNews->getNews().c_str());
+    expectedNews = "GossipNewsAgency: " + news;
+    ASSERT_STREQ(expectedNews.c_str(), gossipNews->getNews().c_str());
+
+    dailyNews->clear();
+    gossipNews->clear();
+
+    // unsubscribe SeriousNewsEvent from GossipNewsAgency
+
+    eventManager->unsubscribe(seriousNewsEventId, gossipNews);
+    eventManager->fire(ls_std_test::SeriousNewsEvent(news)); // event call
+
+    expectedNews = "DailyNewsAgency: " + news;
+    ASSERT_STREQ(expectedNews.c_str(), dailyNews->getNews().c_str());
+    ASSERT_TRUE(gossipNews->getNews().empty());
+
+    dailyNews->clear();
+    gossipNews->clear();
+
+    // now let GossipNewsAgency subscribe to SeriousNewsEvent + GossipNewsEvent and fire both of them
+
+    eventManager->subscribe(gossipNewsEventId, gossipNews);
+    eventManager->subscribe(seriousNewsEventId, gossipNews);
+
+    news = "COVID-19 is still going on!";
+    eventManager->fire(ls_std_test::SeriousNewsEvent(news)); // event call
+    expectedNews = "GossipNewsAgency: " + news;
+    ASSERT_STREQ(expectedNews.c_str(), gossipNews->getNews().c_str());
+
+    news = "ape likes banana!";
+    eventManager->fire(ls_std_test::GossipNewsEvent(news)); // event call
+    expectedNews = "GossipNewsAgency: " + news;
+    ASSERT_STREQ(expectedNews.c_str(), gossipNews->getNews().c_str());
+  }
+}

+ 76 - 0
test/cases/event/EventTest.cpp

@@ -0,0 +1,76 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-11-26
+ * Changed:         2020-11-26
+ *
+ * */
+
+#include <gtest/gtest.h>
+#include <ls_std/ls_std.hpp>
+
+namespace {
+  class EventTest : public ::testing::Test {
+    protected:
+
+      EventTest() = default;
+      ~EventTest() override = default;
+
+      void SetUp() override
+      {}
+
+      void TearDown() override
+      {}
+  };
+
+  TEST_F(EventTest, getClassName)
+  {
+    ls_std::Event event {"OPEN_DOOR_EVENT"};
+    ASSERT_STREQ("Event", event.getClassName().c_str());
+  }
+
+  TEST_F(EventTest, addParameter)
+  {
+    ls_std::Event event {"OPEN_DOOR_EVENT"};
+    ASSERT_TRUE(event.getParameterList().empty());
+
+    event.addParameter(ls_std::event_parameter("key", "yes"));
+    event.addParameter(ls_std::event_parameter("facing_door", "yes"));
+
+    ls_std::event_parameter_list parameterList = event.getParameterList();
+    ASSERT_FALSE(parameterList.empty());
+    ASSERT_EQ(2, parameterList.size());
+    ASSERT_STREQ("yes", parameterList.at("key").c_str());
+    ASSERT_STREQ("yes", parameterList.at("facing_door").c_str());
+  }
+
+  TEST_F(EventTest, getId)
+  {
+    ls_std::Event event {"OPEN_DOOR_EVENT"};
+    ASSERT_STREQ("OPEN_DOOR_EVENT", event.getId().c_str());
+  }
+
+  TEST_F(EventTest, getParameterList)
+  {
+    ls_std::Event event {"OPEN_DOOR_EVENT"};
+    ASSERT_TRUE(event.getParameterList().empty());
+  }
+
+  TEST_F(EventTest, removeParameter)
+  {
+    ls_std::Event event {"OPEN_DOOR_EVENT"};
+    ASSERT_TRUE(event.getParameterList().empty());
+
+    event.addParameter(ls_std::event_parameter("key", "yes"));
+    event.addParameter(ls_std::event_parameter("facing_door", "yes"));
+
+    ASSERT_FALSE(event.getParameterList().empty());
+    ASSERT_EQ(2, event.getParameterList().size());
+    event.removeParameter("key");
+    ASSERT_EQ(1, event.getParameterList().size());
+    event.removeParameter("facing_door");
+    ASSERT_EQ(0, event.getParameterList().size());
+    ASSERT_TRUE(event.getParameterList().empty());
+  }
+}

+ 2 - 2
test/cases/io/FileOutputStreamTest.cpp

@@ -3,12 +3,12 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2020-10-29
+ * Changed:         2020-11-29
  *
  * */
 
 #include <gtest/gtest.h>
-#include "../../TestHelper.hpp"
+#include <TestHelper.hpp>
 #include <ls_std/ls_std.hpp>
 
 namespace {

+ 2 - 2
test/cases/io/FileReaderTest.cpp

@@ -3,12 +3,12 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-18
- * Changed:         2020-10-29
+ * Changed:         2020-11-29
  *
  * */
 
 #include <gtest/gtest.h>
-#include "../../TestHelper.hpp"
+#include <TestHelper.hpp>
 #include <ls_std/ls_std.hpp>
 
 namespace {

+ 2 - 2
test/cases/io/FileTest.cpp

@@ -3,12 +3,12 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-15
- * Changed:         2020-10-29
+ * Changed:         2020-11-29
  *
  * */
 
 #include <gtest/gtest.h>
-#include "../../TestHelper.hpp"
+#include <TestHelper.hpp>
 #include <ls_std/ls_std.hpp>
 
 namespace {

+ 2 - 2
test/cases/io/FileWriterTest.cpp

@@ -3,13 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2020-10-29
+ * Changed:         2020-11-29
  *
  * */
 
 #include <gtest/gtest.h>
 #include <ls_std/ls_std.hpp>
-#include "../../TestHelper.hpp"
+#include <TestHelper.hpp>
 
 namespace {
   class FileWriterTest : public ::testing::Test {

+ 2 - 2
test/cases/io/StorableFileTest.cpp

@@ -3,12 +3,12 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-19
- * Changed:         2020-10-29
+ * Changed:         2020-11-29
  *
  * */
 
 #include <gtest/gtest.h>
-#include "../../TestHelper.hpp"
+#include <TestHelper.hpp>
 #include <ls_std/ls_std.hpp>
 
 namespace {

+ 2 - 2
test/cases/io/logging/LoggerTest.cpp

@@ -3,13 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2020-11-06
+ * Changed:         2020-11-29
  *
  * */
 
 #include <gtest/gtest.h>
 #include <ls_std/ls_std.hpp>
-#include "../../../TestHelper.hpp"
+#include <TestHelper.hpp>
 
 namespace {
   class LoggerTest : public ::testing::Test {

+ 2 - 2
test/cases/io/xml/XMLDocumentTest.cpp

@@ -3,13 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-30
- * Changed:         2020-10-26
+ * Changed:         2020-11-29
  *
  * */
 
 #include <gtest/gtest.h>
 #include <ls_std/ls_std.hpp>
-#include "../../../TestDataFactory.hpp"
+#include <TestDataFactory.hpp>
 
 namespace {
   class XMLDocumentTest : public ::testing::Test {

+ 2 - 2
test/cases/io/xml/XMLNodeTest.cpp

@@ -3,13 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-25
- * Changed:         2020-09-26
+ * Changed:         2020-11-29
  *
  * */
 
 #include <gtest/gtest.h>
 #include <ls_std/ls_std.hpp>
-#include "../../../TestDataFactory.hpp"
+#include <TestDataFactory.hpp>
 
 namespace {
   class XMLNodeTest : public ::testing::Test {

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно