Browse Source

Split header and source files for io module

Patrick-Christopher Mattulat 2 years ago
parent
commit
0247d6fa33
40 changed files with 216 additions and 152 deletions
  1. 2 0
      CMakeLists.txt
  2. 26 32
      include/ls-std/io/File.hpp
  3. 6 26
      include/ls-std/io/FilePathSeparator.hpp
  4. 2 2
      include/ls-std/io/FilePathSeparatorMatch.hpp
  5. 2 2
      include/ls-std/io/FileReader.hpp
  6. 2 2
      include/ls-std/io/FileWriter.hpp
  7. 6 26
      include/ls-std/io/NewLine.hpp
  8. 3 3
      include/ls-std/io/StandardOutputWriter.hpp
  9. 2 2
      include/ls-std/io/StorableFile.hpp
  10. 2 2
      include/ls-std/io/kv/KvDocument.hpp
  11. 2 2
      include/ls-std/io/kv/KvFileReader.hpp
  12. 2 2
      include/ls-std/io/kv/KvPair.hpp
  13. 2 2
      include/ls-std/io/kv/KvParser.hpp
  14. 2 2
      include/ls-std/io/logging/LogLevel.hpp
  15. 2 2
      include/ls-std/io/logging/Logger.hpp
  16. 3 3
      include/ls-std/io/xml/XmlAttribute.hpp
  17. 3 3
      include/ls-std/io/xml/XmlDeclaration.hpp
  18. 5 5
      include/ls-std/io/xml/XmlDocument.hpp
  19. 4 4
      include/ls-std/io/xml/XmlNode.hpp
  20. 2 2
      include/ls-std/io/xml/XmlParser.hpp
  21. 5 5
      include/ls-std/io/xml/XmlReader.hpp
  22. 3 1
      source/ls-std/io/File.cpp
  23. 38 0
      source/ls-std/io/FilePathSeparator.cpp
  24. 4 4
      source/ls-std/io/FileReader.cpp
  25. 3 1
      source/ls-std/io/FileWriter.cpp
  26. 38 0
      source/ls-std/io/NewLine.cpp
  27. 5 1
      source/ls-std/io/StandardOutputWriter.cpp
  28. 3 1
      source/ls-std/io/StorableFile.cpp
  29. 3 1
      source/ls-std/io/kv/KvDocument.cpp
  30. 3 1
      source/ls-std/io/kv/KvFileReader.cpp
  31. 3 1
      source/ls-std/io/kv/KvPair.cpp
  32. 3 1
      source/ls-std/io/kv/KvParser.cpp
  33. 3 1
      source/ls-std/io/logging/LogLevel.cpp
  34. 3 1
      source/ls-std/io/logging/Logger.cpp
  35. 3 1
      source/ls-std/io/xml/XmlAttribute.cpp
  36. 3 1
      source/ls-std/io/xml/XmlDeclaration.cpp
  37. 3 1
      source/ls-std/io/xml/XmlDocument.cpp
  38. 3 1
      source/ls-std/io/xml/XmlNode.cpp
  39. 3 1
      source/ls-std/io/xml/XmlParser.cpp
  40. 4 4
      source/ls-std/io/xml/XmlReader.cpp

+ 2 - 0
CMakeLists.txt

@@ -190,8 +190,10 @@ set(SOURCE_FILES_IO
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/xml/XmlReader.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/File.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/FileOutputStream.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/FilePathSeparator.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/FileReader.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/FileWriter.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/NewLine.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/StandardOutputWriter.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/StorableFile.cpp)
 

+ 26 - 32
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-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -11,23 +11,17 @@
 #define LS_STD_FILE_HPP
 
 #include <ctime>
+#if defined(unix) || defined(__APPLE__)
+  #include <dirent.h>
+#endif
 #include <list>
 #include <ls-std/core/Class.hpp>
 #include <ls-std/os/dynamic-goal.hpp>
 #include <regex>
 #include <string>
 #include <vector>
-
-#if defined(unix) || defined(__APPLE__)
-
-#include <dirent.h>
-
-#endif
-
 #ifdef _WIN32
-
-#include <windows.h>
-
+  #include <windows.h>
 #endif
 
 namespace ls::std::io
@@ -37,7 +31,7 @@ namespace ls::std::io
     public:
 
       explicit File(::std::string _absoluteFilePath);
-      ~File() override = default;
+      ~File() override;
 
       // comparison operators
 
@@ -71,50 +65,50 @@ namespace ls::std::io
 
       ::std::string absoluteFilePath{};
 
-      #if defined(unix) || defined(__APPLE__)
+#if defined(unix) || defined(__APPLE__)
       static void _addToFileListUnix(const ::std::string &_path, bool _withDirectories, dirent *directoryEntity, ::std::list<::std::string> &_list);
-      #endif
-      #ifdef _WIN32
+#endif
+#ifdef _WIN32
       static void _addToFileListWindows(const ::std::string &_path, bool _withDirectories, WIN32_FIND_DATA _data, ::std::list<::std::string> &_list);
-      #endif
+#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);
-      #if defined(unix) || defined(__APPLE__)
+#if defined(unix) || defined(__APPLE__)
       static ::std::string _getWorkingDirectoryUnix();
-      #endif
-      #ifdef _WIN32
+#endif
+#ifdef _WIN32
       static ::std::string _getWorkingDirectoryWindows();
-      #endif
+#endif
       static bool _isDirectory(const ::std::string &_path);
       static bool _isExecutable(const ::std::string &_path);
       static bool _isFile(const ::std::string &_path);
-      #if defined(unix) || defined(__APPLE__)
+#if defined(unix) || defined(__APPLE__)
       static bool _isReadableUnix(const ::std::string &_path);
-      #endif
-      #ifdef _WIN32
+#endif
+#ifdef _WIN32
       static bool _isReadableWindows(const ::std::string &_path);
-      #endif
+#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);
-      #if defined(unix) || defined(__APPLE__)
+#if defined(unix) || defined(__APPLE__)
       static ::std::list<::std::string> _listUnix(const ::std::string &_path, bool withDirectories);
-      #endif
-      #ifdef _WIN32
+#endif
+#ifdef _WIN32
       static ::std::list<::std::string> _listWindows(const ::std::string &_path, bool withDirectories);
-      #endif
+#endif
       static int _mkdir(const ::std::string &_path);
       static ::std::string _normalizePath(::std::string _path);
       static ::std::string _reduceSeparators(const ::std::string &_path);
       static void _remove(const ::std::string &_path);
-      #if defined(unix) || defined(__APPLE__)
+#if defined(unix) || defined(__APPLE__)
       static void _removeUnix(const ::std::string &_path);
-      #endif
-      #ifdef _WIN32
+#endif
+#ifdef _WIN32
       static void _removeWindows(const ::std::string &_path);
-      #endif
+#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);

+ 6 - 26
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-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -19,32 +19,12 @@ namespace ls::std::io
   {
     public:
 
-      FilePathSeparator() = default;
-      ~FilePathSeparator() = default;
+      FilePathSeparator();
+      ~FilePathSeparator();
 
-      static char get()
-      {
-        char separator;
-
-        #ifdef _WIN32
-        separator = ls::std::io::FilePathSeparator::getWindowsFilePathSeparator();
-        #endif
-        #if defined(unix) || defined(__APPLE__)
-        separator = ls::std::io::FilePathSeparator::getUnixFilePathSeparator();
-        #endif
-
-        return separator;
-      }
-
-      static char getUnixFilePathSeparator()
-      {
-        return '/';
-      }
-
-      static char getWindowsFilePathSeparator()
-      {
-        return '\\';
-      }
+      static char get();
+      static char getUnixFilePathSeparator();
+      static char getWindowsFilePathSeparator();
   };
 }
 

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

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-15
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -14,7 +14,7 @@
 
 namespace ls::std::io
 {
-  struct FilePathSeparatorMatch
+  struct FilePathSeparatorMatch // TODO: turn to class, rather than keeping it as struct
   {
     bool operator()(char _char) const
     {

+ 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-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -22,7 +22,7 @@ namespace ls::std::io
     public:
 
       explicit FileReader(ls::std::io::File &_file);
-      ~FileReader() override = default;
+      ~FileReader() override;
 
       ls::std::core::type::byte_field read() override;
       void reset(ls::std::io::File &_file);

+ 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-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -22,7 +22,7 @@ namespace ls::std::io
     public:
 
       explicit FileWriter(ls::std::io::File &_file);
-      ~FileWriter() override = default;
+      ~FileWriter() override;
 
       void reset(ls::std::io::File &_file);
       bool write(const ls::std::core::type::byte_field &_data) override;

+ 6 - 26
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-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -18,32 +18,12 @@ namespace ls::std::io
   {
     public:
 
-      NewLine() = default;
-      ~NewLine() = default;
+      NewLine();
+      ~NewLine();
 
-      static ::std::string get()
-      {
-        ::std::string newLine{};
-
-        #if defined(unix) || defined(__APPLE__)
-        newLine = ls::std::io::NewLine::getUnixNewLine();
-        #endif
-        #ifdef _WIN32
-        newLine = ls::std::io::NewLine::getWindowsNewLine();
-        #endif
-
-        return newLine;
-      }
-
-      static ::std::string getUnixNewLine()
-      {
-        return "\n";
-      }
-
-      static ::std::string getWindowsNewLine()
-      {
-        return "\r\n";
-      }
+      static ::std::string get();
+      static ::std::string getUnixNewLine();
+      static ::std::string getWindowsNewLine();
   };
 }
 

+ 3 - 3
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-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -19,8 +19,8 @@ namespace ls::std::io
   {
     public:
 
-      StandardOutputWriter() = default;
-      ~StandardOutputWriter() = default;
+      StandardOutputWriter();
+      ~StandardOutputWriter();
 
       bool write(const ls::std::core::type::byte_field &_data) override;
   };

+ 2 - 2
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-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -23,7 +23,7 @@ namespace ls::std::io
     public:
 
       explicit StorableFile(const ::std::string &_path);
-      ~StorableFile() = default;
+      ~StorableFile();
 
       ::std::shared_ptr<ls::std::io::File> getFile();
       ls::std::core::type::byte_field load() override;

+ 2 - 2
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-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -23,7 +23,7 @@ namespace ls::std::io
     public:
 
       KvDocument();
-      ~KvDocument() override = default;
+      ~KvDocument() override;
 
       bool addPair(ls::std::io::KvPair _pair);
       void clear();

+ 2 - 2
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-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -24,7 +24,7 @@ namespace ls::std::io
     public:
 
       explicit KvFileReader(const ::std::shared_ptr<ls::std::io::KvDocument> &_document, const ::std::string &_absolutePath);
-      ~KvFileReader() override = default;
+      ~KvFileReader() override;
 
       // implementation
 

+ 2 - 2
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-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -21,7 +21,7 @@ namespace ls::std::io
     public:
 
       explicit KvPair(const ls::std::core::type::kv_key &_key, ls::std::core::type::kv_value _value);
-      ~KvPair() override = default;
+      ~KvPair() override;
 
       ls::std::core::type::kv_key getKey();
       ls::std::core::type::kv_value getValue();

+ 2 - 2
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-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -24,7 +24,7 @@ namespace ls::std::io
     public:
 
       explicit KvParser(const ::std::shared_ptr<ls::std::io::KvDocument> &_document);
-      ~KvParser() override = default;
+      ~KvParser() override;
 
       ::std::shared_ptr<ls::std::io::KvDocument> getDocument();
       void parse(const ls::std::core::type::byte_field &_data);

+ 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:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -23,7 +23,7 @@ namespace ls::std::io
 
       explicit LogLevel(const ls::std::io::LogLevelValue &_value);
       LogLevel();
-      ~LogLevel() override = default;
+      ~LogLevel() override;
 
       operator unsigned char() const;
       ls::std::io::LogLevel &operator=(const ls::std::io::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:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -25,7 +25,7 @@ namespace ls::std::io
     public:
 
       explicit Logger(const ::std::shared_ptr<ls::std::core::interface_type::IWriter> &_writer);
-      ~Logger() override = default;
+      ~Logger() override;
 
       void debug(const ls::std::core::type::byte *_data);
       void error(const ls::std::core::type::byte *_data);

+ 3 - 3
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-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -11,8 +11,8 @@
 #define LS_STD_XML_ATTRIBUTE_HPP
 
 #include <ls-std/core/Class.hpp>
-#include <string>
 #include <ls-std/os/dynamic-goal.hpp>
+#include <string>
 
 namespace ls::std::io
 {
@@ -21,7 +21,7 @@ namespace ls::std::io
     public:
 
       explicit XmlAttribute(const ::std::string &_name);
-      ~XmlAttribute() override = default;
+      ~XmlAttribute() override;
 
       ::std::string getName();
       ::std::string getValue();

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

@@ -3,15 +3,15 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-27
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
 #ifndef LS_STD_XML_DECLARATION_HPP
 #define LS_STD_XML_DECLARATION_HPP
 
-#include <ls-std/core/Class.hpp>
 #include "XmlAttribute.hpp"
+#include <ls-std/core/Class.hpp>
 #include <ls-std/os/dynamic-goal.hpp>
 
 namespace ls::std::io
@@ -21,7 +21,7 @@ namespace ls::std::io
     public:
 
       explicit XmlDeclaration(const ::std::string &_version);
-      ~XmlDeclaration() override = default;
+      ~XmlDeclaration() override;
 
       ::std::string getEncoding();
       ::std::string getStandalone();

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

@@ -3,18 +3,18 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-27
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
 #ifndef LS_STD_XML_DOCUMENT_HPP
 #define LS_STD_XML_DOCUMENT_HPP
 
-#include <memory>
-#include <ls-std/core/Class.hpp>
-#include "XmlNode.hpp"
 #include "XmlDeclaration.hpp"
+#include "XmlNode.hpp"
+#include <ls-std/core/Class.hpp>
 #include <ls-std/os/dynamic-goal.hpp>
+#include <memory>
 
 namespace ls::std::io
 {
@@ -23,7 +23,7 @@ namespace ls::std::io
     public:
 
       XmlDocument();
-      ~XmlDocument() override = default;
+      ~XmlDocument() override;
 
       ::std::shared_ptr<ls::std::io::XmlDeclaration> getDeclaration();
       ::std::shared_ptr<ls::std::io::XmlNode> getRootElement();

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

@@ -3,18 +3,18 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-24
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
 #ifndef LS_STD_XML_NODE_HPP
 #define LS_STD_XML_NODE_HPP
 
+#include "XmlAttribute.hpp"
 #include <list>
-#include <memory>
 #include <ls-std/core/Class.hpp>
-#include "XmlAttribute.hpp"
 #include <ls-std/os/dynamic-goal.hpp>
+#include <memory>
 
 namespace ls::std::io
 {
@@ -23,7 +23,7 @@ namespace ls::std::io
     public:
 
       explicit XmlNode(::std::string _name);
-      ~XmlNode() override = default;
+      ~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);

+ 2 - 2
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-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -25,7 +25,7 @@ namespace ls::std::io
     public:
 
       explicit XmlParser(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document);
-      ~XmlParser() override = default;
+      ~XmlParser() override;
 
       ::std::shared_ptr<ls::std::io::XmlDocument> getDocument();
       void parse(const ls::std::core::type::byte_field &_data);

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

@@ -3,20 +3,20 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-08
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
 #ifndef LS_STD_XML_READER_HPP
 #define LS_STD_XML_READER_HPP
 
-#include <ls-std/core/Class.hpp>
 #include "XmlDocument.hpp"
-#include <ls-std/core/interface/IReader.hpp>
-#include <ls-std/io/File.hpp>
 #include "XmlParseMode.hpp"
 #include "XmlParseParameter.hpp"
 #include <list>
+#include <ls-std/core/Class.hpp>
+#include <ls-std/core/interface/IReader.hpp>
+#include <ls-std/io/File.hpp>
 #include <ls-std/os/dynamic-goal.hpp>
 
 namespace ls::std::io
@@ -26,7 +26,7 @@ namespace ls::std::io
     public:
 
       explicit XmlReader(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document, const ::std::string &_absolutePath);
-      ~XmlReader() override = default;
+      ~XmlReader() override;
 
       // implementation
 

+ 3 - 1
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-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -31,6 +31,8 @@ ls::std::io::File::File(::std::string _absoluteFilePath)
       absoluteFilePath(ls::std::io::File::_normalizePath(::std::move(_absoluteFilePath)))
 {}
 
+ls::std::io::File::~File() = default;
+
 bool ls::std::io::File::operator==(ls::std::io::File &_file)
 {
   return ls::std::io::File::_equals(*this, _file);

+ 38 - 0
source/ls-std/io/FilePathSeparator.cpp

@@ -0,0 +1,38 @@
+/*
+* Author:          Patrick-Christopher Mattulat
+* Company:         Lynar Studios
+* E-Mail:          webmaster@lynarstudios.com
+* Created:         2023-02-04
+* Changed:         2023-02-04
+*
+* */
+
+#include <ls-std/io/FilePathSeparator.hpp>
+
+ls::std::io::FilePathSeparator::FilePathSeparator() = default;
+
+ls::std::io::FilePathSeparator::~FilePathSeparator() = default;
+
+char ls::std::io::FilePathSeparator::get()
+{
+  char separator;
+
+#ifdef _WIN32
+  separator = ls::std::io::FilePathSeparator::getWindowsFilePathSeparator();
+#endif
+#if defined(unix) || defined(__APPLE__)
+  separator = ls::std::io::FilePathSeparator::getUnixFilePathSeparator();
+#endif
+
+  return separator;
+}
+
+char ls::std::io::FilePathSeparator::getUnixFilePathSeparator()
+{
+  return '/';
+}
+
+char ls::std::io::FilePathSeparator::getWindowsFilePathSeparator()
+{
+  return '\\';
+}

+ 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:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -12,13 +12,13 @@
 #include <ls-std/core/exception/FileOperationException.hpp>
 #include <ls-std/io/FileReader.hpp>
 
-ls::std::io::FileReader::FileReader(ls::std::io::File &_file)
-    : ls::std::core::Class("FileReader"),
-      file(_file)
+ls::std::io::FileReader::FileReader(ls::std::io::File &_file) : ls::std::core::Class("FileReader"), file(_file)
 {
   ls::std::io::FileReader::_init(_file);
 }
 
+ls::std::io::FileReader::~FileReader() = default;
+
 ls::std::core::type::byte_field ls::std::io::FileReader::read()
 {
   ls::std::core::type::byte *data;

+ 3 - 1
source/ls-std/io/FileWriter.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -19,6 +19,8 @@ ls::std::io::FileWriter::FileWriter(ls::std::io::File &_file)
   ls::std::io::FileWriter::_init(_file);
 }
 
+ls::std::io::FileWriter::~FileWriter() = default;
+
 void ls::std::io::FileWriter::reset(ls::std::io::File &_file)
 {
   ls::std::io::FileWriter::_init(_file);

+ 38 - 0
source/ls-std/io/NewLine.cpp

@@ -0,0 +1,38 @@
+/*
+* Author:          Patrick-Christopher Mattulat
+* Company:         Lynar Studios
+* E-Mail:          webmaster@lynarstudios.com
+* Created:         2023-02-04
+* Changed:         2023-02-04
+*
+* */
+
+#include <ls-std/io/NewLine.hpp>
+
+ls::std::io::NewLine::NewLine() = default;
+
+ls::std::io::NewLine::~NewLine() = default;
+
+::std::string ls::std::io::NewLine::get()
+{
+  ::std::string newLine{};
+
+#if defined(unix) || defined(__APPLE__)
+  newLine = ls::std::io::NewLine::getUnixNewLine();
+#endif
+#ifdef _WIN32
+  newLine = ls::std::io::NewLine::getWindowsNewLine();
+#endif
+
+  return newLine;
+}
+
+::std::string ls::std::io::NewLine::getUnixNewLine()
+{
+  return "\n";
+}
+
+::std::string ls::std::io::NewLine::getWindowsNewLine()
+{
+  return "\r\n";
+}

+ 5 - 1
source/ls-std/io/StandardOutputWriter.cpp

@@ -3,13 +3,17 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-06
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
 #include <iostream>
 #include <ls-std/io/StandardOutputWriter.hpp>
 
+ls::std::io::StandardOutputWriter::StandardOutputWriter() = default;
+
+ls::std::io::StandardOutputWriter::~StandardOutputWriter() = default;
+
 bool ls::std::io::StandardOutputWriter::write(const ls::std::core::type::byte_field &_data)
 {
   ::std::cout << _data;

+ 3 - 1
source/ls-std/io/StorableFile.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-19
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -16,6 +16,8 @@ ls::std::io::StorableFile::StorableFile(const ::std::string &_path)
   this->_init(_path);
 }
 
+ls::std::io::StorableFile::~StorableFile() = default;
+
 ::std::shared_ptr<ls::std::io::File> ls::std::io::StorableFile::getFile()
 {
   return this->file;

+ 3 - 1
source/ls-std/io/kv/KvDocument.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -12,6 +12,8 @@
 ls::std::io::KvDocument::KvDocument() : ls::std::core::Class("KvDocument")
 {}
 
+ls::std::io::KvDocument::~KvDocument() = default;
+
 bool ls::std::io::KvDocument::addPair(ls::std::io::KvPair _pair)
 {
   bool added{};

+ 3 - 1
source/ls-std/io/kv/KvFileReader.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -20,6 +20,8 @@ ls::std::io::KvFileReader::KvFileReader(const ::std::shared_ptr<ls::std::io::KvD
   this->_assignFile(ls::std::io::File{_absolutePath});
 }
 
+ls::std::io::KvFileReader::~KvFileReader() = default;
+
 ls::std::core::type::byte_field ls::std::io::KvFileReader::read()
 {
   ls::std::core::type::byte_field data = ls::std::io::FileReader{this->kvFile}.read();

+ 3 - 1
source/ls-std/io/kv/KvPair.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -17,6 +17,8 @@ ls::std::io::KvPair::KvPair(const ls::std::core::type::kv_key &_key, ls::std::co
   this->_assignKey(_key);
 }
 
+ls::std::io::KvPair::~KvPair() = default;
+
 ls::std::core::type::kv_key ls::std::io::KvPair::getKey()
 {
   return this->key;

+ 3 - 1
source/ls-std/io/kv/KvParser.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -16,6 +16,8 @@ ls::std::io::KvParser::KvParser(const ::std::shared_ptr<ls::std::io::KvDocument>
   this->_assignDocument(_document);
 }
 
+ls::std::io::KvParser::~KvParser() = default;
+
 ::std::shared_ptr<ls::std::io::KvDocument> ls::std::io::KvParser::getDocument()
 {
   return this->document;

+ 3 - 1
source/ls-std/io/logging/LogLevel.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -22,6 +22,8 @@ ls::std::io::LogLevel::LogLevel() : ls::std::core::Class("LogLevel")
   this->_init();
 }
 
+ls::std::io::LogLevel::~LogLevel() = default;
+
 ls::std::io::LogLevel::operator unsigned char() const
 {
   return this->value;

+ 3 - 1
source/ls-std/io/logging/Logger.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -23,6 +23,8 @@ ls::std::io::Logger::Logger(const ::std::shared_ptr<ls::std::core::interface_typ
   this->_assignWriter(_writer);
 }
 
+ls::std::io::Logger::~Logger() = default;
+
 void ls::std::io::Logger::debug(const ls::std::core::type::byte *_data)
 {
   if (this->logLevel >= ls::std::io::LogLevelValue::DEBUG)

+ 3 - 1
source/ls-std/io/xml/XmlAttribute.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-23
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -15,6 +15,8 @@ ls::std::io::XmlAttribute::XmlAttribute(const ::std::string& _name) : ls::std::c
   this->_assignName(_name);
 }
 
+ls::std::io::XmlAttribute::~XmlAttribute() = default;
+
 ::std::string ls::std::io::XmlAttribute::getName()
 {
   return this->name;

+ 3 - 1
source/ls-std/io/xml/XmlDeclaration.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-29
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -14,6 +14,8 @@ ls::std::io::XmlDeclaration::XmlDeclaration(const ::std::string& _version) : ls:
   this->version.setValue(_version);
 }
 
+ls::std::io::XmlDeclaration::~XmlDeclaration() = default;
+
 ::std::string ls::std::io::XmlDeclaration::getEncoding()
 {
   return this->encoding.getValue();

+ 3 - 1
source/ls-std/io/xml/XmlDocument.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-30
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -13,6 +13,8 @@
 ls::std::io::XmlDocument::XmlDocument() : ls::std::core::Class("XmlDocument")
 {}
 
+ls::std::io::XmlDocument::~XmlDocument() = default;
+
 ::std::shared_ptr<ls::std::io::XmlDeclaration> ls::std::io::XmlDocument::getDeclaration()
 {
   return this->declaration;

+ 3 - 1
source/ls-std/io/xml/XmlNode.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-24
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -16,6 +16,8 @@ ls::std::io::XmlNode::XmlNode(::std::string _name)
       name(::std::move(_name))
 {}
 
+ls::std::io::XmlNode::~XmlNode() = default;
+
 bool ls::std::io::XmlNode::addAttributeAfter(const ::std::shared_ptr<ls::std::io::XmlAttribute> &_attribute, const ::std::string &_name)
 {
   bool added{};

+ 3 - 1
source/ls-std/io/xml/XmlParser.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-26
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -16,6 +16,8 @@ ls::std::io::XmlParser::XmlParser(const ::std::shared_ptr<ls::std::io::XmlDocume
   this->_reset();
 }
 
+ls::std::io::XmlParser::~XmlParser() = default;
+
 ::std::shared_ptr<ls::std::io::XmlDocument> ls::std::io::XmlParser::getDocument()
 {
   return this->document;

+ 4 - 4
source/ls-std/io/xml/XmlReader.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-10
- * Changed:         2023-02-03
+ * Changed:         2023-02-04
  *
  * */
 
@@ -12,14 +12,14 @@
 #include <ls-std/io/xml/XmlParser.hpp>
 #include <ls-std/io/xml/XmlReader.hpp>
 
-ls::std::io::XmlReader::XmlReader(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document, const ::std::string &_absolutePath)
-    : ls::std::core::Class("XmlReader"),
-      xmlFile(ls::std::io::File{""})
+ls::std::io::XmlReader::XmlReader(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document, const ::std::string &_absolutePath) : ls::std::core::Class("XmlReader"), xmlFile(ls::std::io::File{""})
 {
   this->_assignDocument(_document);
   this->_assignFile(ls::std::io::File{_absolutePath});
 }
 
+ls::std::io::XmlReader::~XmlReader() = default;
+
 ls::std::core::type::byte_field ls::std::io::XmlReader::read()
 {
   ls::std::core::type::byte_field data = ls::std::io::FileReader{this->xmlFile}.read();