Jelajahi Sumber

Merge branch 'add-missing-nodiscard-declarations' of public/ls-standard-library into development

patrick-christopher.mattulat 1 tahun lalu
induk
melakukan
5e97c8c239
42 mengubah file dengan 254 tambahan dan 250 penghapusan
  1. 1 0
      README.md
  2. 6 6
      include/ls-std/boxing/Boolean.hpp
  3. 4 4
      include/ls-std/boxing/Double.hpp
  4. 4 4
      include/ls-std/boxing/Float.hpp
  5. 2 2
      include/ls-std/boxing/Integer.hpp
  6. 2 2
      include/ls-std/boxing/Long.hpp
  7. 15 15
      include/ls-std/boxing/String.hpp
  8. 2 2
      include/ls-std/core/Class.hpp
  9. 2 2
      include/ls-std/core/LibraryVersion.hpp
  10. 4 4
      include/ls-std/core/Version.hpp
  11. 14 14
      include/ls-std/encoding/Base64.hpp
  12. 6 6
      include/ls-std/event/Event.hpp
  13. 2 2
      include/ls-std/event/EventHandler.hpp
  14. 6 6
      include/ls-std/event/EventManager.hpp
  15. 4 4
      include/ls-std/event/Narrator.hpp
  16. 3 3
      include/ls-std/event/serialization/SerializableJsonEvent.hpp
  17. 38 38
      include/ls-std/io/File.hpp
  18. 2 2
      include/ls-std/io/FileOutputStream.hpp
  19. 4 4
      include/ls-std/io/FilePathSeparator.hpp
  20. 2 2
      include/ls-std/io/FileReader.hpp
  21. 2 2
      include/ls-std/io/FileWriter.hpp
  22. 4 4
      include/ls-std/io/NewLine.hpp
  23. 2 2
      include/ls-std/io/StandardOutputWriter.hpp
  24. 3 3
      include/ls-std/io/StorableFile.hpp
  25. 6 6
      include/ls-std/io/kv/KvDocument.hpp
  26. 3 3
      include/ls-std/io/kv/KvFileReader.hpp
  27. 3 3
      include/ls-std/io/kv/KvPair.hpp
  28. 1 1
      include/ls-std/io/kv/KvParseParameter.hpp
  29. 5 5
      include/ls-std/io/kv/KvParser.hpp
  30. 4 4
      include/ls-std/io/logging/LogLevel.hpp
  31. 6 6
      include/ls-std/io/logging/Logger.hpp
  32. 4 4
      include/ls-std/io/xml/XmlAttribute.hpp
  33. 6 6
      include/ls-std/io/xml/XmlDeclaration.hpp
  34. 4 4
      include/ls-std/io/xml/XmlDocument.hpp
  35. 32 32
      include/ls-std/io/xml/XmlNode.hpp
  36. 18 18
      include/ls-std/io/xml/XmlParser.hpp
  37. 3 3
      include/ls-std/io/xml/XmlReader.hpp
  38. 8 8
      include/ls-std/time/Date.hpp
  39. 10 7
      source/ls-std/io/File.cpp
  40. 2 2
      test/cases/event/EventManagerTest.cpp
  41. 1 1
      test/cases/io/FileTest.cpp
  42. 4 4
      test/cases/io/xml/XmlNodeTest.cpp

+ 1 - 0
README.md

@@ -43,6 +43,7 @@ A __Date__ class comes with this submodule, which you can use to represent a dat
 - namespaces have been completely removed from module tests to improve readability
 - a new naming convention for files and directories has been introduced, where underscores were replaced by dashes entirely
 - fetching the library version can now be achieved by using a dedicated __LibraryVersion__ class - the usage of a static function for this purpose has been removed completely
+- missing nodiscard attributes have been added to library classes
 
 #### Fixes ####
 

+ 6 - 6
include/ls-std/boxing/Boolean.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-09
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -61,15 +61,15 @@ namespace ls::std::boxing
       // implementation
 
       void parse(::std::string _parseText) override;
-      ::std::string toString() override;
+      [[nodiscard]] ::std::string toString() override;
 
       // additional functionality
 
       [[nodiscard]] bool getValue() const;
-      static bool XOR(const ls::std::boxing::Boolean &_leftExpression, const ls::std::boxing::Boolean &_rightExpression);
-      static bool XOR(const ls::std::boxing::Boolean &_leftExpression, bool _rightExpression);
-      static bool XOR(bool _leftExpression, const ls::std::boxing::Boolean &_rightExpression);
-      static bool XOR(bool _leftExpression, bool _rightExpression);
+      [[nodiscard]] static bool XOR(const ls::std::boxing::Boolean &_leftExpression, const ls::std::boxing::Boolean &_rightExpression);
+      [[nodiscard]] static bool XOR(const ls::std::boxing::Boolean &_leftExpression, bool _rightExpression);
+      [[nodiscard]] static bool XOR(bool _leftExpression, const ls::std::boxing::Boolean &_rightExpression);
+      [[nodiscard]] static bool XOR(bool _leftExpression, bool _rightExpression);
 
     private:
 

+ 4 - 4
include/ls-std/boxing/Double.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -79,12 +79,12 @@ namespace ls::std::boxing
       // implementation
 
       void parse(::std::string _parseText) override;
-      ::std::string toString() override;
+      [[nodiscard]] ::std::string toString() override;
 
       // additional functionality
 
-      double getEpsilon();
-      double getValue();
+      [[nodiscard]] double getEpsilon();
+      [[nodiscard]] double getValue();
       void setEpsilon(double _epsilon);
 
     private:

+ 4 - 4
include/ls-std/boxing/Float.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -79,12 +79,12 @@ namespace ls::std::boxing
       // implementation
 
       void parse(::std::string _parseText) override;
-      ::std::string toString() override;
+      [[nodiscard]] ::std::string toString() override;
 
       // additional functionality
 
-      float getEpsilon();
-      float getValue();
+      [[nodiscard]] float getEpsilon();
+      [[nodiscard]] float getValue();
       void setEpsilon(float _epsilon);
 
     private:

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

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-07
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -95,7 +95,7 @@ namespace ls::std::boxing
       // implementation
 
       void parse(::std::string _parseText) override;
-      ::std::string toString() override;
+      [[nodiscard]] ::std::string toString() override;
 
       // additional functionality
 

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

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -96,7 +96,7 @@ namespace ls::std::boxing
       // implementation
 
       void parse(::std::string _parseText) override;
-      ::std::string toString() override;
+      [[nodiscard]] ::std::string toString() override;
 
       // additional functionality
 

+ 15 - 15
include/ls-std/boxing/String.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -61,28 +61,28 @@ namespace ls::std::boxing
       // implementation
 
       void parse(::std::string _parseText) override;
-      ::std::string toString() override;
+      [[nodiscard]] ::std::string toString() override;
 
       // additional functionality
 
-      bool contains(const ::std::string &_text);
-      bool endsWith(const ::std::string &_text);
-      bool equalsIgnoreCase(ls::std::boxing::String _string);
-      bool equalsIgnoreCase(::std::string _text);
-      ::std::vector<ls::std::core::type::byte> getByteData();
-      ::std::string padLeft(size_t _width, char _fillCharacter);
-      ::std::string padRight(size_t _width, char _fillCharacter);
-      ::std::string reverse();
-      bool startsWith(const ::std::string &_text);
-      ::std::string toLowerCase();
-      ::std::string toUpperCase();
+      [[nodiscard]] bool contains(const ::std::string &_text);
+      [[nodiscard]] bool endsWith(const ::std::string &_text);
+      [[nodiscard]] bool equalsIgnoreCase(ls::std::boxing::String _string);
+      [[nodiscard]] bool equalsIgnoreCase(::std::string _text);
+      [[nodiscard]] ::std::vector<ls::std::core::type::byte> getByteData();
+      [[nodiscard]] ::std::string padLeft(size_t _width, char _fillCharacter);
+      [[nodiscard]] ::std::string padRight(size_t _width, char _fillCharacter);
+      [[nodiscard]] ::std::string reverse();
+      [[nodiscard]] bool startsWith(const ::std::string &_text);
+      [[nodiscard]] ::std::string toLowerCase();
+      [[nodiscard]] ::std::string toUpperCase();
 
     private:
 
       ::std::string value{};
 
-      static ::std::string _buildCharacterChain(size_t _amount, char _fillCharacter);
-      static ::std::string _createFillContent(const ::std::string &_text, size_t _width, char _fillCharacter);
+      [[nodiscard]] static ::std::string _buildCharacterChain(size_t _amount, char _fillCharacter);
+      [[nodiscard]] static ::std::string _createFillContent(const ::std::string &_text, size_t _width, char _fillCharacter);
   };
 }
 

+ 2 - 2
include/ls-std/core/Class.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-07
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -22,7 +22,7 @@ namespace ls::std::core
       explicit Class(const ::std::string &_name);
       virtual ~Class();
 
-      ::std::string getClassName();
+      [[nodiscard]] ::std::string getClassName();
 
     private:
 

+ 2 - 2
include/ls-std/core/LibraryVersion.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2021-05-02
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -22,7 +22,7 @@ namespace ls::std::core
       LibraryVersion();
       ~LibraryVersion();
 
-      static ::std::string getVersion();
+      [[nodiscard]] static ::std::string getVersion();
   };
 }
 

+ 4 - 4
include/ls-std/core/Version.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-27
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -26,7 +26,7 @@ namespace ls::std::core
 
       // implementation
 
-      ls::std::core::type::byte_field marshal() override;
+      [[nodiscard]] ls::std::core::type::byte_field marshal() override;
       void unmarshal(const ls::std::core::type::byte_field &_data) override;
 
       // other functionality
@@ -34,7 +34,7 @@ namespace ls::std::core
       [[nodiscard]] ls::std::core::type::version_type getMajorVersion() const;
       [[nodiscard]] ls::std::core::type::version_type getMinorVersion() const;
       [[nodiscard]] ls::std::core::type::version_type getPatchVersion() const;
-      static bool isValid(const ::std::string &_versionString);
+      [[nodiscard]] static bool isValid(const ::std::string &_versionString);
       void setMajorVersion(ls::std::core::type::version_type _major);
       void setMinorVersion(ls::std::core::type::version_type _minor);
       void setPatchVersion(ls::std::core::type::version_type _patch);
@@ -45,7 +45,7 @@ namespace ls::std::core
       ls::std::core::type::version_type minorVersion{};
       ls::std::core::type::version_type patchVersion{};
 
-      static bool _isValid(const ::std::string &_versionString);
+      [[nodiscard]] static bool _isValid(const ::std::string &_versionString);
   };
 }
 

+ 14 - 14
include/ls-std/encoding/Base64.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2022-01-03
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -27,23 +27,23 @@ namespace ls::std::encoding
 
       // implementation
 
-      ::std::string encode(const ::std::string &_sequence) override;
-      ::std::string decode(const ::std::string &_sequence) override;
+      [[nodiscard]] ::std::string encode(const ::std::string &_sequence) override;
+      [[nodiscard]] ::std::string decode(const ::std::string &_sequence) override;
 
     private:
 
-      static ::std::string _applyEndingRule(::std::string _encodedString, size_t _sequenceSize);
-      static ::std::string _decodeByteQuadruple(const ::std::string &_quadruple);
-      static ::std::string _encodeByteTriple(const ::std::string &_byteTriple);
-      static uint32_t _extractBitSequence(uint32_t _bitMask, uint32_t _bitStorage);
-      static uint32_t _generateBitMask(uint32_t _maskValue, uint8_t _shiftValue);
-      static ::std::unordered_map<char, uint8_t> _getDecodingMap();
-      static ::std::unordered_map<uint8_t, char> _getEncodingMap();
-      static ::std::string _getNextByteQuadruple(const ::std::string &_sequence, size_t _index);
-      static ::std::string _getNextByteTriple(const ::std::string &_sequence, size_t _index);
+      [[nodiscard]] static ::std::string _applyEndingRule(::std::string _encodedString, size_t _sequenceSize);
+      [[nodiscard]] static ::std::string _decodeByteQuadruple(const ::std::string &_quadruple);
+      [[nodiscard]] static ::std::string _encodeByteTriple(const ::std::string &_byteTriple);
+      [[nodiscard]] static uint32_t _extractBitSequence(uint32_t _bitMask, uint32_t _bitStorage);
+      [[nodiscard]] static uint32_t _generateBitMask(uint32_t _maskValue, uint8_t _shiftValue);
+      [[nodiscard]] static ::std::unordered_map<char, uint8_t> _getDecodingMap();
+      [[nodiscard]] static ::std::unordered_map<uint8_t, char> _getEncodingMap();
+      [[nodiscard]] static ::std::string _getNextByteQuadruple(const ::std::string &_sequence, size_t _index);
+      [[nodiscard]] static ::std::string _getNextByteTriple(const ::std::string &_sequence, size_t _index);
       static void _mergeBitSequence(uint32_t &_bitStorage, const uint32_t &_bitMask);
-      static uint32_t _toDecodingBitStorage(const ::std::string &_quadruple);
-      static uint32_t _toEncodingBitStorage(const ::std::string &_triple);
+      [[nodiscard]] static uint32_t _toDecodingBitStorage(const ::std::string &_quadruple);
+      [[nodiscard]] static uint32_t _toEncodingBitStorage(const ::std::string &_triple);
   };
 }
 

+ 6 - 6
include/ls-std/event/Event.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-26
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -27,11 +27,11 @@ namespace ls::std::event
 
       // additional functionality
 
-      bool addParameter(const ls::std::core::type::event_parameter &_eventParameter);
+      bool addParameter(const ls::std::core::type::event_parameter &_eventParameter); // nodiscard is optional here
       void clearParameterList();
-      ls::std::core::type::event_id getId();
-      ls::std::core::type::event_parameter_list getParameterList();
-      bool removeParameter(const ls::std::core::type::event_parameter_id &_id);
+      [[nodiscard]] ls::std::core::type::event_id getId();
+      [[nodiscard]] ls::std::core::type::event_parameter_list getParameterList();
+      bool removeParameter(const ls::std::core::type::event_parameter_id &_id); // nodiscard is optional here
       void setId(const ls::std::core::type::event_id &_id);
 
     private:
@@ -40,7 +40,7 @@ namespace ls::std::event
       ls::std::core::type::event_parameter_list parameterList{};
 
       void _assignId(const ls::std::core::type::event_id &_id);
-      bool _hasParameter(const ls::std::core::type::event_id &_id);
+      [[nodiscard]] bool _hasParameter(const ls::std::core::type::event_id &_id);
   };
 }
 

+ 2 - 2
include/ls-std/event/EventHandler.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -27,7 +27,7 @@ namespace ls::std::event
       explicit EventHandler(const ls::std::core::type::event_id &_id);
       ~EventHandler() override;
 
-      ls::std::core::type::event_id getId();
+      [[nodiscard]] ls::std::core::type::event_id getId();
 
     private:
 

+ 6 - 6
include/ls-std/event/EventManager.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -34,17 +34,17 @@ namespace ls::std::event
 
       // additional functionality
 
-      bool addEventHandler(const ::std::shared_ptr<ls::std::event::EventHandler> &_eventHandler);
+      bool addEventHandler(const ::std::shared_ptr<ls::std::event::EventHandler> &_eventHandler); // nodiscard is optional here
       void fire(ls::std::event::Event _event);
-      bool hasEventHandler(const ls::std::core::type::event_id &_id);
-      bool removeEventHandler(const ::std::shared_ptr<ls::std::event::EventHandler> &_eventHandler);
+      [[nodiscard]] bool hasEventHandler(const ls::std::core::type::event_id &_id);
+      bool removeEventHandler(const ::std::shared_ptr<ls::std::event::EventHandler> &_eventHandler); // nodiscard is optional here
 
     private:
 
       ::std::map<ls::std::core::type::event_id, ::std::shared_ptr<ls::std::event::EventHandler>> eventHandlers{};
 
-      bool _hasEventHandler(const ls::std::core::type::event_id &_id);
-      bool _removeEventHandler(const ::std::shared_ptr<ls::std::event::EventHandler> &_eventHandler);
+      [[nodiscard]] bool _hasEventHandler(const ls::std::core::type::event_id &_id);
+      [[nodiscard]] bool _removeEventHandler(const ::std::shared_ptr<ls::std::event::EventHandler> &_eventHandler);
   };
 }
 

+ 4 - 4
include/ls-std/event/Narrator.hpp

@@ -25,17 +25,17 @@ namespace ls::std::event
       Narrator();
       ~Narrator() override;
 
-      bool addListener(const ::std::shared_ptr<ls::std::core::interface_type::IListener> &_listener);
+      bool addListener(const ::std::shared_ptr<ls::std::core::interface_type::IListener> &_listener); // nodiscard is optional here
       void clear();
-      ::std::list<::std::shared_ptr<ls::std::core::interface_type::IListener>> getListeners();
-      bool removeListener(const ::std::shared_ptr<ls::std::core::interface_type::IListener> &_listener);
+      [[nodiscard]] ::std::list<::std::shared_ptr<ls::std::core::interface_type::IListener>> getListeners();
+      bool removeListener(const ::std::shared_ptr<ls::std::core::interface_type::IListener> &_listener); // nodiscard is optional here
       void tell(const ls::std::core::Class &_info);
 
     private:
 
       ::std::list<::std::shared_ptr<ls::std::core::interface_type::IListener>> listeners{};
 
-      bool _hasListener(const ::std::shared_ptr<ls::std::core::interface_type::IListener> &_listener);
+      [[nodiscard]] bool _hasListener(const ::std::shared_ptr<ls::std::core::interface_type::IListener> &_listener);
   };
 }
 

+ 3 - 3
include/ls-std/event/serialization/SerializableJsonEvent.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-07
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -28,12 +28,12 @@ namespace ls::std::event
 
       // implementation
 
-      ls::std::core::type::byte_field marshal() override;
+      [[nodiscard]] ls::std::core::type::byte_field marshal() override;
       void unmarshal(const ls::std::core::type::byte_field &_data) override;
 
       // additional functionality
 
-      ::std::shared_ptr<ls::std::event::Event> getValue();
+      [[nodiscard]] ::std::shared_ptr<ls::std::event::Event> getValue();
       void setValue(const ::std::shared_ptr<ls::std::event::Event> &_value);
 
     private:

+ 38 - 38
include/ls-std/io/File.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-15
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -40,25 +40,25 @@ namespace ls::std::io
 
       // additional functionality
 
-      bool canExecute();
-      bool canRead();
-      bool canWrite();
+      [[nodiscard]] bool canExecute();
+      [[nodiscard]] bool canRead();
+      [[nodiscard]] bool canWrite();
       void createNewFile();
-      bool exists();
-      ::std::string getAbsoluteFilePath();
-      ::std::string getName();
-      ::std::string getParent();
-      static ::std::string getWorkingDirectory();
-      long getSize();
-      bool isDirectory();
-      bool isFile();
-      time_t lastModified();
-      ::std::list<::std::string> list();
-      ::std::list<::std::string> listFiles();
+      [[nodiscard]] bool exists();
+      [[nodiscard]] ::std::string getAbsoluteFilePath();
+      [[nodiscard]] ::std::string getName();
+      [[nodiscard]] ::std::string getParent();
+      [[nodiscard]] long getSize();
+      [[nodiscard]] static ::std::string getWorkingDirectory();
+      [[nodiscard]] bool isDirectory();
+      [[nodiscard]] bool isFile();
+      [[nodiscard]] time_t lastModified();
+      [[nodiscard]] ::std::list<::std::string> list();
+      [[nodiscard]] ::std::list<::std::string> listFiles();
       void makeDirectory();
       void makeDirectories();
       void remove();
-      bool renameTo(const ::std::string &_newName);
+      bool renameTo(const ::std::string &_newName); // nodiscard is optional here
       void reset(const ::std::string &_newPath);
 
     private:
@@ -71,37 +71,37 @@ namespace ls::std::io
 #ifdef _WIN32
       static void _addToFileListWindows(const ::std::string &_path, bool _withDirectories, WIN32_FIND_DATA _data, ::std::list<::std::string> &_list);
 #endif
-      static bool _equals(ls::std::io::File &_file, ls::std::io::File &_foreignFile);
-      static bool _exists(const ::std::string &_path);
-      static ::std::string _getParent(const ::std::string &_path);
+      [[nodiscard]] static bool _equals(ls::std::io::File &_file, ls::std::io::File &_foreignFile);
+      [[nodiscard]] static bool _exists(const ::std::string &_path);
+      [[nodiscard]] static ::std::string _getParent(const ::std::string &_path);
 #if defined(unix) || defined(__APPLE__)
-      static ::std::string _getWorkingDirectoryUnix();
+      [[nodiscard]] static ::std::string _getWorkingDirectoryUnix();
 #endif
 #ifdef _WIN32
-      static ::std::string _getWorkingDirectoryWindows();
+      [[nodiscard]] static ::std::string _getWorkingDirectoryWindows();
 #endif
-      static bool _isDirectory(const ::std::string &_path);
-      static bool _isExecutable(const ::std::string &_path);
-      static bool _isFile(const ::std::string &_path);
+      [[nodiscard]] static bool _isDirectory(const ::std::string &_path);
+      [[nodiscard]] static bool _isExecutable(const ::std::string &_path);
+      [[nodiscard]] static bool _isFile(const ::std::string &_path);
 #if defined(unix) || defined(__APPLE__)
-      static bool _isReadableUnix(const ::std::string &_path);
+      [[nodiscard]] static bool _isReadableUnix(const ::std::string &_path);
 #endif
 #ifdef _WIN32
-      static bool _isReadableWindows(const ::std::string &_path);
+      [[nodiscard]] static bool _isReadableWindows(const ::std::string &_path);
 #endif
-      static bool _isWritable(const ::std::string &_path);
-      static time_t _lastModified(const ::std::string &_path);
-      static ::std::list<::std::string> _list(const ::std::string &_path);
-      static ::std::list<::std::string> _listFiles(const ::std::string &_path);
+      [[nodiscard]] static bool _isWritable(const ::std::string &_path);
+      [[nodiscard]] static time_t _lastModified(const ::std::string &_path);
+      [[nodiscard]] static ::std::list<::std::string> _list(const ::std::string &_path);
+      [[nodiscard]] static ::std::list<::std::string> _listFiles(const ::std::string &_path);
 #if defined(unix) || defined(__APPLE__)
-      static ::std::list<::std::string> _listUnix(const ::std::string &_path, bool withDirectories);
+      [[nodiscard]] static ::std::list<::std::string> _listUnix(const ::std::string &_path, bool withDirectories);
 #endif
 #ifdef _WIN32
-      static ::std::list<::std::string> _listWindows(const ::std::string &_path, bool withDirectories);
+      [[nodiscard]] static ::std::list<::std::string> _listWindows(const ::std::string &_path, bool withDirectories);
 #endif
-      static int _mkdir(const ::std::string &_path);
-      static ::std::string _normalizePath(::std::string _path);
-      static ::std::string _reduceSeparators(const ::std::string &_path);
+      [[nodiscard]] static bool _makeDirectory(const ::std::string &_path);
+      [[nodiscard]] static ::std::string _normalizePath(::std::string _path);
+      [[nodiscard]] static ::std::string _reduceSeparators(const ::std::string &_path);
       static void _remove(const ::std::string &_path);
 #if defined(unix) || defined(__APPLE__)
       static void _removeUnix(const ::std::string &_path);
@@ -109,9 +109,9 @@ namespace ls::std::io
 #ifdef _WIN32
       static void _removeWindows(const ::std::string &_path);
 #endif
-      static bool _renameTo(const ::std::string &_oldName, const ::std::string &_newName);
-      static ::std::string _replaceWrongSeparator(::std::string _path);
-      static ::std::vector<::std::string> _splitIntoSubDirectoryNames(const ::std::string &_path);
+      [[nodiscard]] static bool _renameTo(const ::std::string &_oldName, const ::std::string &_newName);
+      [[nodiscard]] static ::std::string _replaceWrongSeparator(::std::string _path);
+      [[nodiscard]] static ::std::vector<::std::string> _splitIntoSubDirectoryNames(const ::std::string &_path);
   };
 }
 

+ 2 - 2
include/ls-std/io/FileOutputStream.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2023-02-03
+ * Changed:         2023-02-06
  *
  * */
 
@@ -27,7 +27,7 @@ namespace ls::std::io
       ~FileOutputStream() override;
 
       void close();
-      bool write(const ls::std::core::type::byte_field &_data) override;
+      bool write(const ls::std::core::type::byte_field &_data) override; // nodiscard is optional here
 
     private:
 

+ 4 - 4
include/ls-std/io/FilePathSeparator.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-15
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -22,9 +22,9 @@ namespace ls::std::io
       FilePathSeparator();
       ~FilePathSeparator();
 
-      static char get();
-      static char getUnixFilePathSeparator();
-      static char getWindowsFilePathSeparator();
+      [[nodiscard]] static char get();
+      [[nodiscard]] static char getUnixFilePathSeparator();
+      [[nodiscard]] static char getWindowsFilePathSeparator();
   };
 }
 

+ 2 - 2
include/ls-std/io/FileReader.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -24,7 +24,7 @@ namespace ls::std::io
       explicit FileReader(ls::std::io::File &_file);
       ~FileReader() override;
 
-      ls::std::core::type::byte_field read() override;
+      [[nodiscard]] ls::std::core::type::byte_field read() override;
       void reset(ls::std::io::File &_file);
 
     private:

+ 2 - 2
include/ls-std/io/FileWriter.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -25,7 +25,7 @@ namespace ls::std::io
       ~FileWriter() override;
 
       void reset(ls::std::io::File &_file);
-      bool write(const ls::std::core::type::byte_field &_data) override;
+      bool write(const ls::std::core::type::byte_field &_data) override; // nodiscard is optional here
 
     private:
 

+ 4 - 4
include/ls-std/io/NewLine.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-18
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -22,9 +22,9 @@ namespace ls::std::io
       NewLine();
       ~NewLine();
 
-      static ::std::string get();
-      static ::std::string getUnixNewLine();
-      static ::std::string getWindowsNewLine();
+      [[nodiscard]] static ::std::string get();
+      [[nodiscard]] static ::std::string getUnixNewLine();
+      [[nodiscard]] static ::std::string getWindowsNewLine();
   };
 }
 

+ 2 - 2
include/ls-std/io/StandardOutputWriter.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-06
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -22,7 +22,7 @@ namespace ls::std::io
       StandardOutputWriter();
       ~StandardOutputWriter() override;
 
-      bool write(const ls::std::core::type::byte_field &_data) override;
+      bool write(const ls::std::core::type::byte_field &_data) override; // nodiscard is optional here
   };
 }
 

+ 3 - 3
include/ls-std/io/StorableFile.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-19
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -25,8 +25,8 @@ namespace ls::std::io
       explicit StorableFile(const ::std::string &_path);
       ~StorableFile() override;
 
-      ::std::shared_ptr<ls::std::io::File> getFile();
-      ls::std::core::type::byte_field load() override;
+      [[nodiscard]] ::std::shared_ptr<ls::std::io::File> getFile();
+      [[nodiscard]] ls::std::core::type::byte_field load() override;
       void reset(const ::std::string &_path);
       void save(const ls::std::core::type::byte_field &_data) override;
 

+ 6 - 6
include/ls-std/io/kv/KvDocument.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -25,17 +25,17 @@ namespace ls::std::io
       KvDocument();
       ~KvDocument() override;
 
-      bool addPair(ls::std::io::KvPair _pair);
+      bool addPair(ls::std::io::KvPair _pair); // nodiscard is optional here
       void clear();
-      ::std::map<ls::std::core::type::kv_key, ls::std::io::KvPair> getPairs();
-      bool hasPair(const ls::std::core::type::kv_key &_key);
-      bool removePair(const ls::std::core::type::kv_key &_key);
+      [[nodiscard]] ::std::map<ls::std::core::type::kv_key, ls::std::io::KvPair> getPairs();
+      [[nodiscard]] bool hasPair(const ls::std::core::type::kv_key &_key);
+      bool removePair(const ls::std::core::type::kv_key &_key); // nodiscard is optional here
 
     private:
 
       ::std::map<ls::std::core::type::kv_key, ls::std::io::KvPair> pairs{};
 
-      bool _hasPair(const ls::std::core::type::kv_key &_key);
+      [[nodiscard]] bool _hasPair(const ls::std::core::type::kv_key &_key);
   };
 }
 

+ 3 - 3
include/ls-std/io/kv/KvFileReader.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -28,11 +28,11 @@ namespace ls::std::io
 
       // implementation
 
-      ls::std::core::type::byte_field read() override;
+      ls::std::core::type::byte_field read() override; // nodiscard is optional here
 
       // additional functionality
 
-      ::std::shared_ptr<ls::std::io::KvDocument> getDocument();
+      [[nodiscard]] ::std::shared_ptr<ls::std::io::KvDocument> getDocument();
       void setDocument(const ::std::shared_ptr<ls::std::io::KvDocument> &_document);
       void setFile(const ls::std::io::File &_kvFile);
 

+ 3 - 3
include/ls-std/io/kv/KvPair.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -23,8 +23,8 @@ namespace ls::std::io
       explicit KvPair(const ls::std::core::type::kv_key &_key, ls::std::core::type::kv_value _value);
       ~KvPair() override;
 
-      ls::std::core::type::kv_key getKey();
-      ls::std::core::type::kv_value getValue();
+      [[nodiscard]] ls::std::core::type::kv_key getKey();
+      [[nodiscard]] ls::std::core::type::kv_value getValue();
       void setValue(const ls::std::core::type::kv_value &_value);
 
     private:

+ 1 - 1
include/ls-std/io/kv/KvParseParameter.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 

+ 5 - 5
include/ls-std/io/kv/KvParser.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -26,7 +26,7 @@ namespace ls::std::io
       explicit KvParser(const ::std::shared_ptr<ls::std::io::KvDocument> &_document);
       ~KvParser() override;
 
-      ::std::shared_ptr<ls::std::io::KvDocument> getDocument();
+      [[nodiscard]] ::std::shared_ptr<ls::std::io::KvDocument> getDocument();
       void parse(const ls::std::core::type::byte_field &_data);
       void setDocument(const ::std::shared_ptr<ls::std::io::KvDocument> &_document);
 
@@ -35,11 +35,11 @@ namespace ls::std::io
       ::std::shared_ptr<ls::std::io::KvDocument> document{};
 
       void _assignDocument(const ::std::shared_ptr<ls::std::io::KvDocument> &_document);
-      static bool _contains(const ::std::string &_text, const ::std::string &_searchText);
-      static bool _lineHasPair(ls::std::io::KvParseParameter &_parseParameter);
+      [[nodiscard]] static bool _contains(const ::std::string &_text, const ::std::string &_searchText);
+      [[nodiscard]] static bool _lineHasPair(ls::std::io::KvParseParameter &_parseParameter);
       void _parse(const ls::std::core::type::byte_field &_data);
       void _parsePair(ls::std::io::KvParseParameter &_parseParameter);
-      static ls::std::io::KvParseParameter _readLine(const ls::std::core::type::byte_field &_data, ::std::string::size_type _index);
+      [[nodiscard]] static ls::std::io::KvParseParameter _readLine(const ls::std::core::type::byte_field &_data, ::std::string::size_type _index);
       static void _readLineWithUnixLineBreak(ls::std::io::KvParseParameter &_parseParameter);
       static void _readLineWithWindowsLineBreak(ls::std::io::KvParseParameter &_parseParameter);
   };

+ 4 - 4
include/ls-std/io/logging/LogLevel.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -35,16 +35,16 @@ namespace ls::std::io
 
       void setLogLevel(const ls::std::io::LogLevelValue &_value);
       void setLogLevel(const ::std::string &_value);
-      ::std::string toString() const;
+      [[nodiscard]] ::std::string toString() const;
 
     private:
 
       ::std::unordered_map<uint8_t, ::std::string> level{};
       ls::std::io::LogLevelValue value{};
 
-      ls::std::io::LogLevelValue _getValueFromString(const ::std::string &_value);
+      [[nodiscard]] ls::std::io::LogLevelValue _getValueFromString(const ::std::string &_value);
       void _init();
-      bool _isValidLogLevelString(const ::std::string &_value);
+      [[nodiscard]] bool _isValidLogLevelString(const ::std::string &_value);
   };
 }
 

+ 6 - 6
include/ls-std/io/logging/Logger.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -30,7 +30,7 @@ namespace ls::std::io
       void debug(const ls::std::core::type::byte *_data);
       void error(const ls::std::core::type::byte *_data);
       void fatal(const ls::std::core::type::byte *_data);
-      ls::std::io::LogLevel getLogLevel();
+      [[nodiscard]] ls::std::io::LogLevel getLogLevel();
       void info(const ls::std::core::type::byte *_data);
       void setLogLevel(const ls::std::io::LogLevelValue &_logLevelValue);
       void trace(const ls::std::core::type::byte *_data);
@@ -42,11 +42,11 @@ namespace ls::std::io
       ::std::shared_ptr<ls::std::core::interface_type::IWriter> writer{};
 
       void _assignWriter(const ::std::shared_ptr<ls::std::core::interface_type::IWriter> &_writer);
-      static ::std::string _buildCharacterChain(size_t _amount);
-      static ::std::string _createFillContent(const ::std::string &_text);
-      static ::std::string _generateTimeString(tm *_localTime);
+      [[nodiscard]] static ::std::string _buildCharacterChain(size_t _amount);
+      [[nodiscard]] static ::std::string _createFillContent(const ::std::string &_text);
+      [[nodiscard]] static ::std::string _generateTimeString(tm *_localTime);
       void _log(const ls::std::core::type::byte *_data, const ls::std::io::LogLevel &_logLevel);
-      static ::std::string _padRight(const ::std::string &_text);
+      [[nodiscard]] static ::std::string _padRight(const ::std::string &_text);
   };
 }
 

+ 4 - 4
include/ls-std/io/xml/XmlAttribute.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-23
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -23,11 +23,11 @@ namespace ls::std::io
       explicit XmlAttribute(const ::std::string &_name);
       ~XmlAttribute() override;
 
-      ::std::string getName();
-      ::std::string getValue();
+      [[nodiscard]] ::std::string getName();
+      [[nodiscard]] ::std::string getValue();
       void setName(const ::std::string &_name);
       void setValue(const ::std::string &_value);
-      ::std::string toXml();
+      [[nodiscard]] ::std::string toXml();
 
     private:
 

+ 6 - 6
include/ls-std/io/xml/XmlDeclaration.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-27
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -23,13 +23,13 @@ namespace ls::std::io
       explicit XmlDeclaration(const ::std::string &_version);
       ~XmlDeclaration() override;
 
-      ::std::string getEncoding();
-      ::std::string getStandalone();
-      ::std::string getVersion();
+      [[nodiscard]] ::std::string getEncoding();
+      [[nodiscard]] ::std::string getStandalone();
+      [[nodiscard]] ::std::string getVersion();
       void setEncoding(const ::std::string &_encoding);
       void setStandalone(const ::std::string &_standalone);
       void setVersion(const ::std::string &_version);
-      ::std::string toXml();
+      [[nodiscard]] ::std::string toXml();
 
     private:
 
@@ -37,7 +37,7 @@ namespace ls::std::io
       ls::std::io::XmlAttribute standalone{"standalone"};
       ls::std::io::XmlAttribute version{"version"};
 
-      static ::std::string _toXmlAttribute(ls::std::io::XmlAttribute _attribute);
+      [[nodiscard]] static ::std::string _toXmlAttribute(ls::std::io::XmlAttribute _attribute);
   };
 }
 

+ 4 - 4
include/ls-std/io/xml/XmlDocument.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-27
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -25,11 +25,11 @@ namespace ls::std::io
       XmlDocument();
       ~XmlDocument() override;
 
-      ::std::shared_ptr<ls::std::io::XmlDeclaration> getDeclaration();
-      ::std::shared_ptr<ls::std::io::XmlNode> getRootElement();
+      [[nodiscard]] ::std::shared_ptr<ls::std::io::XmlDeclaration> getDeclaration();
+      [[nodiscard]] ::std::shared_ptr<ls::std::io::XmlNode> getRootElement();
       void setDeclaration(const ::std::shared_ptr<ls::std::io::XmlDeclaration> &_declaration);
       void setRootElement(const ::std::shared_ptr<ls::std::io::XmlNode> &_rootElement);
-      ::std::string toXml();
+      [[nodiscard]] ::std::string toXml();
 
     private:
 

+ 32 - 32
include/ls-std/io/xml/XmlNode.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-24
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -25,30 +25,30 @@ namespace ls::std::io
       explicit XmlNode(::std::string _name);
       ~XmlNode() override;
 
-      bool addAttributeAfter(const ::std::shared_ptr<ls::std::io::XmlAttribute> &_attribute, const ::std::string &_name);
-      bool addAttributeBefore(const ::std::shared_ptr<ls::std::io::XmlAttribute> &_attribute, const ::std::string &_name);
-      bool addAttributeToBeginning(const ::std::shared_ptr<ls::std::io::XmlAttribute> &_attribute);
-      bool addAttributeToEnd(const ::std::shared_ptr<ls::std::io::XmlAttribute> &_attribute);
-      bool addChildAfter(const ::std::shared_ptr<ls::std::io::XmlNode> &_child, const ::std::shared_ptr<ls::std::io::XmlNode> &_search);
-      bool addChildBefore(const ::std::shared_ptr<ls::std::io::XmlNode> &_child, const ::std::shared_ptr<ls::std::io::XmlNode> &_search);
-      bool addChildToBeginning(const ::std::shared_ptr<ls::std::io::XmlNode> &_child);
-      bool addChildToEnd(const ::std::shared_ptr<ls::std::io::XmlNode> &_child);
+      bool addAttributeAfter(const ::std::shared_ptr<ls::std::io::XmlAttribute> &_attribute, const ::std::string &_name); // nodiscard is optional here
+      bool addAttributeBefore(const ::std::shared_ptr<ls::std::io::XmlAttribute> &_attribute, const ::std::string &_name); // nodiscard is optional here
+      bool addAttributeToBeginning(const ::std::shared_ptr<ls::std::io::XmlAttribute> &_attribute); // nodiscard is optional here
+      bool addAttributeToEnd(const ::std::shared_ptr<ls::std::io::XmlAttribute> &_attribute); // nodiscard is optional here
+      bool addChildAfter(const ::std::shared_ptr<ls::std::io::XmlNode> &_child, const ::std::shared_ptr<ls::std::io::XmlNode> &_search); // nodiscard is optional here
+      bool addChildBefore(const ::std::shared_ptr<ls::std::io::XmlNode> &_child, const ::std::shared_ptr<ls::std::io::XmlNode> &_search); // nodiscard is optional here
+      bool addChildToBeginning(const ::std::shared_ptr<ls::std::io::XmlNode> &_child); // nodiscard is optional here
+      bool addChildToEnd(const ::std::shared_ptr<ls::std::io::XmlNode> &_child); // nodiscard is optional here
       void clearValue();
-      ::std::list<::std::shared_ptr<ls::std::io::XmlAttribute>> getAttributes();
-      ::std::list<::std::shared_ptr<ls::std::io::XmlNode>> getChildren();
-      ::std::list<::std::shared_ptr<ls::std::io::XmlNode>> getChildren(const ::std::string &_name);
-      ::std::string getName();
-      ::std::string getValue();
-      bool hasAttribute(const ::std::string &_name);
-      bool hasChild(const ::std::string &_name);
-      bool hasChild(const ::std::shared_ptr<ls::std::io::XmlNode> &_child);
-      bool removeFirstAttribute();
-      bool removeLastAttribute();
-      bool removeFirstChild();
-      bool removeLastChild();
+      [[nodiscard]] ::std::list<::std::shared_ptr<ls::std::io::XmlAttribute>> getAttributes();
+      [[nodiscard]] ::std::list<::std::shared_ptr<ls::std::io::XmlNode>> getChildren();
+      [[nodiscard]] ::std::list<::std::shared_ptr<ls::std::io::XmlNode>> getChildren(const ::std::string &_name);
+      [[nodiscard]] ::std::string getName();
+      [[nodiscard]] ::std::string getValue();
+      [[nodiscard]] bool hasAttribute(const ::std::string &_name);
+      [[nodiscard]] bool hasChild(const ::std::string &_name);
+      [[nodiscard]] bool hasChild(const ::std::shared_ptr<ls::std::io::XmlNode> &_child);
+      bool removeFirstAttribute(); // nodiscard is optional here
+      bool removeLastAttribute(); // nodiscard is optional here
+      bool removeFirstChild(); // nodiscard is optional here
+      bool removeLastChild(); // nodiscard is optional here
       void setName(const ::std::string &_name);
       void setValue(const ::std::string &_value);
-      ::std::string toXml();
+      [[nodiscard]] ::std::string toXml();
 
     protected:
 
@@ -67,16 +67,16 @@ namespace ls::std::io
       static void _checkIfAttributeReferenceIsValid(const ::std::shared_ptr<ls::std::io::XmlAttribute> &_attribute);
       static void _checkIfNameIsNotEmpty(const ::std::string &_name);
       static void _checkIfNodeReferenceIsValid(const ::std::shared_ptr<ls::std::io::XmlNode> &_child);
-      static ::std::string _getTab(uint8_t _tabSize);
-      bool _hasAttribute(const ::std::string &_name);
-      bool _hasChild(const ::std::shared_ptr<ls::std::io::XmlNode> &_child);
-      bool _hasChild(const ::std::string &_name);
-      ::std::string _toXmlAttributes();
-      ::std::string _toXmlChildren(uint8_t _tabSize);
-      ::std::string _toXmlCloseTag();
-      ::std::string _toXmlOpenTag();
-      ::std::string _toXmlOpenTagClose();
-      ::std::string _toXmlValue();
+      [[nodiscard]] static ::std::string _getTab(uint8_t _tabSize);
+      [[nodiscard]] bool _hasAttribute(const ::std::string &_name);
+      [[nodiscard]] bool _hasChild(const ::std::shared_ptr<ls::std::io::XmlNode> &_child);
+      [[nodiscard]] bool _hasChild(const ::std::string &_name);
+      [[nodiscard]] ::std::string _toXmlAttributes();
+      [[nodiscard]] ::std::string _toXmlChildren(uint8_t _tabSize);
+      [[nodiscard]] ::std::string _toXmlCloseTag();
+      [[nodiscard]] ::std::string _toXmlOpenTag();
+      [[nodiscard]] ::std::string _toXmlOpenTagClose();
+      [[nodiscard]] ::std::string _toXmlValue();
   };
 }
 

+ 18 - 18
include/ls-std/io/xml/XmlParser.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-25
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -27,14 +27,14 @@ namespace ls::std::io
       explicit XmlParser(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document);
       ~XmlParser() override;
 
-      ::std::shared_ptr<ls::std::io::XmlDocument> getDocument();
+      [[nodiscard]] ::std::shared_ptr<ls::std::io::XmlDocument> getDocument();
       void parse(const ls::std::core::type::byte_field &_data);
       void setDocument(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document);
 
     protected:
 
-      static ::std::pair<::std::string, ::std::string> _readAttribute_(const ls::std::core::type::byte_field &_data);
-      static ::std::list<::std::pair<::std::string, ::std::string>> _readAttributes_(ls::std::core::type::byte_field _data);
+      [[nodiscard]] static ::std::pair<::std::string, ::std::string> _readAttribute_(const ls::std::core::type::byte_field &_data);
+      [[nodiscard]] static ::std::list<::std::pair<::std::string, ::std::string>> _readAttributes_(ls::std::core::type::byte_field _data);
 
     private:
 
@@ -46,13 +46,13 @@ namespace ls::std::io
 
       void _analyze(const ls::std::core::type::byte_field &_data, ::std::string::size_type _index);
       void _assignDocument(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document);
-      static bool _contains(const ::std::string &_text, const ::std::string &_searchText);
-      static ::std::shared_ptr<ls::std::io::XmlDeclaration> _createDeclaration(const ::std::list<::std::pair<::std::string, ::std::string>> &_attributes);
-      static ::std::shared_ptr<ls::std::io::XmlNode> _createNode(const ::std::list<::std::pair<::std::string, ::std::string>> &_attributes, const ::std::string &_name);
-      static bool _endsWith(const ::std::string &_text, const ::std::string &_ending);
-      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::core::type::byte_field &_data);
-      static ls::std::core::type::byte_field _getNextTagString(const ls::std::core::type::byte_field &_data, ::std::string::size_type _index);
+      [[nodiscard]] static bool _contains(const ::std::string &_text, const ::std::string &_searchText);
+      [[nodiscard]] static ::std::shared_ptr<ls::std::io::XmlDeclaration> _createDeclaration(const ::std::list<::std::pair<::std::string, ::std::string>> &_attributes);
+      [[nodiscard]] static ::std::shared_ptr<ls::std::io::XmlNode> _createNode(const ::std::list<::std::pair<::std::string, ::std::string>> &_attributes, const ::std::string &_name);
+      [[nodiscard]] static bool _endsWith(const ::std::string &_text, const ::std::string &_ending);
+      [[nodiscard]] static ::std::pair<::std::string, ::std::string> _findAttribute(const ::std::list<::std::pair<::std::string, ::std::string>> &_attributes, const ::std::string &_name);
+      [[nodiscard]] static size_t _findAttributeEndPosition(const ls::std::core::type::byte_field &_data);
+      [[nodiscard]] static ls::std::core::type::byte_field _getNextTagString(const ls::std::core::type::byte_field &_data, ::std::string::size_type _index);
       void _isClosingTag(const ls::std::core::type::byte_field &_data, ::std::string::size_type _index);
       void _isDeclaration(const ls::std::core::type::byte_field &_data, ::std::string::size_type _index);
       void _isOpeningTag(const ls::std::core::type::byte_field &_data, ::std::string::size_type _index);
@@ -61,13 +61,13 @@ namespace ls::std::io
       void _mergeChildrenToParentNode(const ::std::shared_ptr<ls::std::io::XmlNode> &_parent, ::std::list<ls::std::io::XmlParseParameter>::iterator &_iterator, uint8_t _parentLevel);
       void _mergeNodesOnCurrentLevel();
       void _parse(const ls::std::core::type::byte_field &_data);
-      static ::std::pair<::std::string, ::std::string> _parseAttribute(const ls::std::core::type::byte_field &_data);
-      static ::std::list<::std::pair<::std::string, ::std::string>> _parseAttributes(ls::std::core::type::byte_field _data);
-      size_t _parseClosingTag(const ls::std::core::type::byte_field &_data, ::std::string::size_type _index);
-      size_t _parseDeclaration(const ls::std::core::type::byte_field &_data, ::std::string::size_type _index);
-      size_t _parseOpeningTag(const ls::std::core::type::byte_field &_data, ::std::string::size_type _index);
-      static ls::std::core::type::byte_field _parseTagName(const ls::std::core::type::byte_field &_data);
-      size_t _parseValue(const ls::std::core::type::byte_field &_data, ::std::string::size_type _index);
+      [[nodiscard]] static ::std::pair<::std::string, ::std::string> _parseAttribute(const ls::std::core::type::byte_field &_data);
+      [[nodiscard]] static ::std::list<::std::pair<::std::string, ::std::string>> _parseAttributes(ls::std::core::type::byte_field _data);
+      [[nodiscard]] size_t _parseClosingTag(const ls::std::core::type::byte_field &_data, ::std::string::size_type _index);
+      [[nodiscard]] size_t _parseDeclaration(const ls::std::core::type::byte_field &_data, ::std::string::size_type _index);
+      [[nodiscard]] size_t _parseOpeningTag(const ls::std::core::type::byte_field &_data, ::std::string::size_type _index);
+      [[nodiscard]] static ls::std::core::type::byte_field _parseTagName(const ls::std::core::type::byte_field &_data);
+      [[nodiscard]] size_t _parseValue(const ls::std::core::type::byte_field &_data, ::std::string::size_type _index);
       void _reset();
       void _setMaxLevel();
   };

+ 3 - 3
include/ls-std/io/xml/XmlReader.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-08
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -30,11 +30,11 @@ namespace ls::std::io
 
       // implementation
 
-      ls::std::core::type::byte_field read() override;
+      ls::std::core::type::byte_field read() override; // nodiscard is optional here
 
       // additional functionality
 
-      ::std::shared_ptr<ls::std::io::XmlDocument> getDocument();
+      [[nodiscard]] ::std::shared_ptr<ls::std::io::XmlDocument> getDocument();
       void setDocument(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document);
       void setFile(const ls::std::io::File &_xmlFile);
 

+ 8 - 8
include/ls-std/time/Date.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -34,15 +34,15 @@ namespace ls::std::time
 
       [[nodiscard]] bool after(const ls::std::time::Date &_foreignDate) const;
       [[nodiscard]] bool before(const ls::std::time::Date &_foreignDate) const;
-      int getDay();
-      int getHour();
-      int getMinute();
-      int getMonth();
-      int getSecond();
+      [[nodiscard]] int getDay();
+      [[nodiscard]] int getHour();
+      [[nodiscard]] int getMinute();
+      [[nodiscard]] int getMonth();
+      [[nodiscard]] int getSecond();
       [[nodiscard]] time_t getTime() const;
-      int getYear();
+      [[nodiscard]] int getYear();
       void setTime(time_t _timestamp);
-      ::std::string toString();
+      [[nodiscard]] ::std::string toString();
 
     private:
 

+ 10 - 7
source/ls-std/io/File.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-15
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -182,7 +182,7 @@ time_t ls::std::io::File::lastModified()
 
 void ls::std::io::File::makeDirectory()
 {
-  if (ls::std::io::File::_mkdir(this->absoluteFilePath))
+  if (!ls::std::io::File::_makeDirectory(this->absoluteFilePath))
   {
     throw ls::std::core::FileOperationException{};
   }
@@ -198,9 +198,12 @@ void ls::std::io::File::makeDirectories()
   {
     currentHierarchy += subDirectory;
 
-    if (!ls::std::io::File::_exists(currentHierarchy))
+    if (!ls::std::io::File::_exists(currentHierarchy + separator) && !currentHierarchy.empty())
     {
-      ls::std::io::File::_mkdir(currentHierarchy);
+      if (!ls::std::io::File::_makeDirectory(currentHierarchy))
+      {
+        throw ls::std::core::FileOperationException{}; // TODO: add missing test
+      }
     }
 
     currentHierarchy += separator;
@@ -564,19 +567,19 @@ time_t ls::std::io::File::_lastModified(const ::std::string &_path)
 
 #endif
 
-int ls::std::io::File::_mkdir(const ::std::string &_path)
+bool ls::std::io::File::_makeDirectory(const ::std::string &_path)
 {
   int result;
 
 #ifdef _WIN32
-  result = mkdir(_path.c_str());
+  result = _mkdir(_path.c_str());
 #endif
 
 #if defined(unix) || defined(__APPLE__)
   result = mkdir(_path.c_str(), 0777);
 #endif
 
-  return result;
+  return result == 0;
 }
 
 ::std::string ls::std::io::File::_normalizePath(::std::string _path)

+ 2 - 2
test/cases/event/EventManagerTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -191,7 +191,7 @@ namespace
           try
           {
             EventManager eventManager{};
-            eventManager.hasEventHandler("");
+            bool hasHandler = eventManager.hasEventHandler("");
           }
           catch (const IllegalArgumentException &_exception)
           {

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

@@ -98,7 +98,7 @@ namespace
         {
           try
           {
-            file.canRead();
+            bool isReadable = file.canRead();
           }
           catch (const FileOperationException &_exception)
           {

+ 4 - 4
test/cases/io/xml/XmlNodeTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-25
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -654,7 +654,7 @@ namespace
         {
           try
           {
-            dialogNode.hasAttribute("");
+            bool hasAttribute = dialogNode.hasAttribute("");
           }
           catch (const IllegalArgumentException &_exception)
           {
@@ -690,7 +690,7 @@ namespace
         {
           try
           {
-            dialogNode.hasChild("");
+            bool hasChild = dialogNode.hasChild("");
           }
           catch (const IllegalArgumentException &_exception)
           {
@@ -728,7 +728,7 @@ namespace
         {
           try
           {
-            dialogNode.hasChild(searchNode);
+            bool hasChild = dialogNode.hasChild(searchNode);
           }
           catch (const IllegalArgumentException &_exception)
           {