Quellcode durchsuchen

Improve namespace layout for "io" module

Patrick-Christopher Mattulat vor 2 Jahren
Ursprung
Commit
843cb6826f

+ 88 - 94
include/ls_std/io/File.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-15
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -30,101 +30,95 @@
 
 #endif
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL File : public ls::std::core::Class
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL File : public ls::std::core::Class
-      {
-        public:
-
-          explicit File(::std::string _absoluteFilePath);
-          ~File() override = default;
-
-          // comparison operators
-
-          bool operator==(ls::std::io::File &_file);
-          bool operator!=(ls::std::io::File &_file);
-
-          // additional functionality
-
-          bool canExecute();
-          bool canRead();
-          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();
-          void makeDirectory();
-          void makeDirectories();
-          void remove();
-          bool renameTo(const ::std::string &_newName);
-          void reset(const ::std::string &_newPath);
-
-        private:
-
-          ::std::string absoluteFilePath{};
-
-          #if defined(unix) || defined(__APPLE__)
-          static void _addToFileListUnix(const ::std::string &_path, bool _withDirectories, dirent *directoryEntity, ::std::list<::std::string> &_list);
-          #endif
-          #ifdef _WIN32
-          static void _addToFileListWindows(const ::std::string &_path, bool _withDirectories, WIN32_FIND_DATA _data, ::std::list<::std::string> &_list);
-          #endif
-          static bool _equals(ls::std::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__)
-          static ::std::string _getWorkingDirectoryUnix();
-          #endif
-          #ifdef _WIN32
-          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);
-          #if defined(unix) || defined(__APPLE__)
-          static bool _isReadableUnix(const ::std::string &_path);
-          #endif
-          #ifdef _WIN32
-          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);
-          #if defined(unix) || defined(__APPLE__)
-          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);
-          #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__)
-          static void _removeUnix(const ::std::string &_path);
-          #endif
-          #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);
-      };
-    }
-  }
+    public:
+
+      explicit File(::std::string _absoluteFilePath);
+      ~File() override = default;
+
+      // comparison operators
+
+      bool operator==(ls::std::io::File &_file);
+      bool operator!=(ls::std::io::File &_file);
+
+      // additional functionality
+
+      bool canExecute();
+      bool canRead();
+      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();
+      void makeDirectory();
+      void makeDirectories();
+      void remove();
+      bool renameTo(const ::std::string &_newName);
+      void reset(const ::std::string &_newPath);
+
+    private:
+
+      ::std::string absoluteFilePath{};
+
+      #if defined(unix) || defined(__APPLE__)
+      static void _addToFileListUnix(const ::std::string &_path, bool _withDirectories, dirent *directoryEntity, ::std::list<::std::string> &_list);
+      #endif
+      #ifdef _WIN32
+      static void _addToFileListWindows(const ::std::string &_path, bool _withDirectories, WIN32_FIND_DATA _data, ::std::list<::std::string> &_list);
+      #endif
+      static bool _equals(ls::std::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__)
+      static ::std::string _getWorkingDirectoryUnix();
+      #endif
+      #ifdef _WIN32
+      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);
+      #if defined(unix) || defined(__APPLE__)
+      static bool _isReadableUnix(const ::std::string &_path);
+      #endif
+      #ifdef _WIN32
+      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);
+      #if defined(unix) || defined(__APPLE__)
+      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);
+      #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__)
+      static void _removeUnix(const ::std::string &_path);
+      #endif
+      #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);
+  };
 }
 
 #endif

+ 21 - 27
include/ls_std/io/FileOutputStream.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -16,34 +16,28 @@
 #include <fstream>
 #include <ls_std/os/dynamic_goal.hpp>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL FileOutputStream : public ls::std::core::Class, public ls::std::core::interface_type::IWriter
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL FileOutputStream : public ls::std::core::Class, public ls::std::core::interface_type::IWriter
-      {
-        public:
-
-          explicit FileOutputStream(ls::std::io::File &_file);
-          explicit FileOutputStream(ls::std::io::File &_file, bool _append);
-          ~FileOutputStream() override;
-
-          void close();
-          bool write(const ls::std::core::type::byte_field &_data) override;
-
-        private:
-
-          bool append{};
-          ls::std::io::File file;
-          ::std::ofstream outputStream{};
-
-          void _close();
-          void _init();
-      };
-    }
-  }
+    public:
+
+      explicit FileOutputStream(ls::std::io::File &_file);
+      explicit FileOutputStream(ls::std::io::File &_file, bool _append);
+      ~FileOutputStream() override;
+
+      void close();
+      bool write(const ls::std::core::type::byte_field &_data) override;
+
+    private:
+
+      bool append{};
+      ls::std::io::File file;
+      ::std::ofstream outputStream{};
+
+      void _close();
+      void _init();
+  };
 }
 
 #endif

+ 31 - 37
include/ls_std/io/FilePathSeparator.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-15
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -13,45 +13,39 @@
 #include <string>
 #include <ls_std/os/dynamic_goal.hpp>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL FilePathSeparator
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL FilePathSeparator
+    public:
+
+      FilePathSeparator() = default;
+      ~FilePathSeparator() = default;
+
+      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()
       {
-        public:
-
-          FilePathSeparator() = default;
-          ~FilePathSeparator() = default;
-
-          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 '\\';
-          }
-      };
-    }
-  }
+        return '\\';
+      }
+  };
 }
 
 #endif

+ 6 - 12
include/ls_std/io/FilePathSeparatorMatch.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-15
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -12,21 +12,15 @@
 
 #include "FilePathSeparator.hpp"
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  struct FilePathSeparatorMatch
   {
-    namespace io
+    bool operator()(char _char) const
     {
-      struct FilePathSeparatorMatch
-      {
-        bool operator()(char _char) const
-        {
-          return _char == ls::std::io::FilePathSeparator::getWindowsFilePathSeparator() || _char == ls::std::io::FilePathSeparator::getUnixFilePathSeparator();
-        }
-      };
+      return _char == ls::std::io::FilePathSeparator::getWindowsFilePathSeparator() || _char == ls::std::io::FilePathSeparator::getUnixFilePathSeparator();
     }
-  }
+  };
 }
 
 #endif

+ 12 - 18
include/ls_std/io/FileReader.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -15,30 +15,24 @@
 #include <ls_std/core/interface/IReader.hpp>
 #include <ls_std/os/dynamic_goal.hpp>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL FileReader : public ls::std::core::Class, public ls::std::core::interface_type::IReader
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL FileReader : public ls::std::core::Class, public ls::std::core::interface_type::IReader
-      {
-        public:
+    public:
 
-          explicit FileReader(ls::std::io::File &_file);
-          ~FileReader() override = default;
+      explicit FileReader(ls::std::io::File &_file);
+      ~FileReader() override = default;
 
-          ls::std::core::type::byte_field read() override;
-          void reset(ls::std::io::File &_file);
+      ls::std::core::type::byte_field read() override;
+      void reset(ls::std::io::File &_file);
 
-        private:
+    private:
 
-          ls::std::io::File file;
+      ls::std::io::File file;
 
-          static void _init(ls::std::io::File &_file);
-      };
-    }
-  }
+      static void _init(ls::std::io::File &_file);
+  };
 }
 
 #endif

+ 12 - 18
include/ls_std/io/FileWriter.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -15,30 +15,24 @@
 #include "File.hpp"
 #include <ls_std/os/dynamic_goal.hpp>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL FileWriter : public ls::std::core::Class, public ls::std::core::interface_type::IWriter
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL FileWriter : public ls::std::core::Class, public ls::std::core::interface_type::IWriter
-      {
-        public:
+    public:
 
-          explicit FileWriter(ls::std::io::File &_file);
-          ~FileWriter() override = default;
+      explicit FileWriter(ls::std::io::File &_file);
+      ~FileWriter() override = default;
 
-          void reset(ls::std::io::File &_file);
-          bool write(const ls::std::core::type::byte_field &_data) override;
+      void reset(ls::std::io::File &_file);
+      bool write(const ls::std::core::type::byte_field &_data) override;
 
-        private:
+    private:
 
-          ls::std::io::File file;
+      ls::std::io::File file;
 
-          static void _init(ls::std::io::File &_file);
-      };
-    }
-  }
+      static void _init(ls::std::io::File &_file);
+  };
 }
 
 #endif

+ 31 - 37
include/ls_std/io/NewLine.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-18
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -12,45 +12,39 @@
 
 #include <string>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class NewLine
   {
-    namespace io
-    {
-      class NewLine
+    public:
+
+      NewLine() = default;
+      ~NewLine() = default;
+
+      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()
       {
-        public:
-
-          NewLine() = default;
-          ~NewLine() = default;
-
-          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";
-          }
-      };
-    }
-  }
+        return "\r\n";
+      }
+  };
 }
 
 #endif

+ 8 - 14
include/ls_std/io/StandardOutputWriter.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-06
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -13,23 +13,17 @@
 #include <ls_std/core/interface/IWriter.hpp>
 #include <ls_std/os/dynamic_goal.hpp>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL StandardOutputWriter : public ls::std::core::interface_type::IWriter
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL StandardOutputWriter : public ls::std::core::interface_type::IWriter
-      {
-        public:
+    public:
 
-          StandardOutputWriter() = default;
-          ~StandardOutputWriter() = default;
+      StandardOutputWriter() = default;
+      ~StandardOutputWriter() = default;
 
-          bool write(const ls::std::core::type::byte_field &_data) override;
-      };
-    }
-  }
+      bool write(const ls::std::core::type::byte_field &_data) override;
+  };
 }
 
 #endif

+ 14 - 20
include/ls_std/io/StorableFile.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-19
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -16,32 +16,26 @@
 #include "File.hpp"
 #include <ls_std/os/dynamic_goal.hpp>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL StorableFile : public ls::std::core::interface_type::IStorable
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL StorableFile : public ls::std::core::interface_type::IStorable
-      {
-        public:
+    public:
 
-          explicit StorableFile(const ::std::string &_path);
-          ~StorableFile() = default;
+      explicit StorableFile(const ::std::string &_path);
+      ~StorableFile() = default;
 
-          ::std::shared_ptr<ls::std::io::File> getFile();
-          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;
+      ::std::shared_ptr<ls::std::io::File> getFile();
+      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;
 
-        private:
+    private:
 
-          ::std::shared_ptr<ls::std::io::File> file{};
+      ::std::shared_ptr<ls::std::io::File> file{};
 
-          void _init(const ::std::string &_path);
-      };
-    }
-  }
+      void _init(const ::std::string &_path);
+  };
 }
 
 #endif

+ 15 - 21
include/ls_std/io/kv/KvDocument.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -16,33 +16,27 @@
 #include <map>
 #include <ls_std/os/dynamic_goal.hpp>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL KvDocument : public ls::std::core::Class
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL KvDocument : public ls::std::core::Class
-      {
-        public:
+    public:
 
-          KvDocument();
-          ~KvDocument() override = default;
+      KvDocument();
+      ~KvDocument() override = default;
 
-          bool addPair(ls::std::io::KvPair _pair);
-          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);
+      bool addPair(ls::std::io::KvPair _pair);
+      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);
 
-        private:
+    private:
 
-          ::std::map<ls::std::core::type::kv_key, ls::std::io::KvPair> pairs{};
+      ::std::map<ls::std::core::type::kv_key, ls::std::io::KvPair> pairs{};
 
-          bool _hasPair(const ls::std::core::type::kv_key &_key);
-      };
-    }
-  }
+      bool _hasPair(const ls::std::core::type::kv_key &_key);
+  };
 }
 
 #endif

+ 18 - 24
include/ls_std/io/kv/KvFileReader.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -17,39 +17,33 @@
 #include <memory>
 #include <ls_std/os/dynamic_goal.hpp>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL KvFileReader : public ls::std::core::Class, public ls::std::core::interface_type::IReader
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL KvFileReader : public ls::std::core::Class, public ls::std::core::interface_type::IReader
-      {
-        public:
+    public:
 
-          explicit KvFileReader(const ::std::shared_ptr<ls::std::io::KvDocument> &_document, const ::std::string &_absolutePath);
-          ~KvFileReader() override = default;
+      explicit KvFileReader(const ::std::shared_ptr<ls::std::io::KvDocument> &_document, const ::std::string &_absolutePath);
+      ~KvFileReader() override = default;
 
-          // implementation
+      // implementation
 
-          ls::std::core::type::byte_field read() override;
+      ls::std::core::type::byte_field read() override;
 
-          // additional functionality
+      // additional functionality
 
-          ::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);
+      ::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);
 
-        private:
+    private:
 
-          ::std::shared_ptr<ls::std::io::KvDocument> document{};
-          ls::std::io::File kvFile;
+      ::std::shared_ptr<ls::std::io::KvDocument> document{};
+      ls::std::io::File kvFile;
 
-          void _assignDocument(const ::std::shared_ptr<ls::std::io::KvDocument> &_document);
-          void _assignFile(ls::std::io::File _kvFile);
-      };
-    }
-  }
+      void _assignDocument(const ::std::shared_ptr<ls::std::io::KvDocument> &_document);
+      void _assignFile(ls::std::io::File _kvFile);
+  };
 }
 
 #endif

+ 14 - 20
include/ls_std/io/kv/KvPair.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -14,32 +14,26 @@
 #include "ls_std/core/types/KvTypes.hpp"
 #include <ls_std/os/dynamic_goal.hpp>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL KvPair : public ls::std::core::Class
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL KvPair : public ls::std::core::Class
-      {
-        public:
+    public:
 
-          explicit KvPair(const ls::std::core::type::kv_key &_key, ls::std::core::type::kv_value _value);
-          ~KvPair() override = default;
+      explicit KvPair(const ls::std::core::type::kv_key &_key, ls::std::core::type::kv_value _value);
+      ~KvPair() override = default;
 
-          ls::std::core::type::kv_key getKey();
-          ls::std::core::type::kv_value getValue();
-          void setValue(const ls::std::core::type::kv_value &_value);
+      ls::std::core::type::kv_key getKey();
+      ls::std::core::type::kv_value getValue();
+      void setValue(const ls::std::core::type::kv_value &_value);
 
-        private:
+    private:
 
-          ls::std::core::type::kv_key key{};
-          ls::std::core::type::kv_value value{};
+      ls::std::core::type::kv_key key{};
+      ls::std::core::type::kv_value value{};
 
-          void _assignKey(const ls::std::core::type::kv_key &_key);
-      };
-    }
-  }
+      void _assignKey(const ls::std::core::type::kv_key &_key);
+  };
 }
 
 #endif

+ 6 - 12
include/ls_std/io/kv/KvParseParameter.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -12,19 +12,13 @@
 
 #include <string>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  struct KvParseParameter
   {
-    namespace io
-    {
-      struct KvParseParameter
-      {
-        ::std::string::size_type index{};
-        ::std::string line{};
-      };
-    }
-  }
+    ::std::string::size_type index{};
+    ::std::string line{};
+  };
 }
 
 #endif

+ 25 - 31
include/ls_std/io/kv/KvParser.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -17,38 +17,32 @@
 #include <memory>
 #include <ls_std/os/dynamic_goal.hpp>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL KvParser : public ls::std::core::Class
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL KvParser : public ls::std::core::Class
-      {
-        public:
-
-          explicit KvParser(const ::std::shared_ptr<ls::std::io::KvDocument> &_document);
-          ~KvParser() override = default;
-
-          ::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);
-
-        private:
-
-          ::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(const ls::std::io::KvParseParameter& _parseParameter);
-          void _parse(const ls::std::core::type::byte_field &_data);
-          void _parsePair(const ls::std::io::KvParseParameter& _parseParameter);
-          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);
-      };
-    }
-  }
+    public:
+
+      explicit KvParser(const ::std::shared_ptr<ls::std::io::KvDocument> &_document);
+      ~KvParser() override = default;
+
+      ::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);
+
+    private:
+
+      ::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(const ls::std::io::KvParseParameter &_parseParameter);
+      void _parse(const ls::std::core::type::byte_field &_data);
+      void _parsePair(const ls::std::io::KvParseParameter &_parseParameter);
+      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);
+  };
 }
 
 #endif

+ 30 - 36
include/ls_std/io/logging/LogLevel.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -15,43 +15,37 @@
 #include "LogLevelValue.hpp"
 #include <ls_std/os/dynamic_goal.hpp>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL LogLevel : public ls::std::core::Class
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL LogLevel : public ls::std::core::Class
-      {
-        public:
-
-          explicit LogLevel(const ls::std::io::LogLevelValue &_value);
-          LogLevel();
-          ~LogLevel() override = default;
-
-          operator unsigned char() const;
-          ls::std::io::LogLevel &operator=(const ls::std::io::LogLevelValue &_value);
-          bool operator<(const ls::std::io::LogLevelValue &_value);
-          bool operator<=(const ls::std::io::LogLevelValue &_value);
-          bool operator>(const ls::std::io::LogLevelValue &_value);
-          bool operator>=(const ls::std::io::LogLevelValue &_value);
-          bool operator==(const ls::std::io::LogLevelValue &_value);
-
-          void setLogLevel(const ls::std::io::LogLevelValue &_value);
-          void setLogLevel(const ::std::string &_value);
-          ::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);
-          void _init();
-          bool _isValidLogLevelString(const ::std::string &_value);
-      };
-    }
-  }
+    public:
+
+      explicit LogLevel(const ls::std::io::LogLevelValue &_value);
+      LogLevel();
+      ~LogLevel() override = default;
+
+      operator unsigned char() const;
+      ls::std::io::LogLevel &operator=(const ls::std::io::LogLevelValue &_value);
+      bool operator<(const ls::std::io::LogLevelValue &_value);
+      bool operator<=(const ls::std::io::LogLevelValue &_value);
+      bool operator>(const ls::std::io::LogLevelValue &_value);
+      bool operator>=(const ls::std::io::LogLevelValue &_value);
+      bool operator==(const ls::std::io::LogLevelValue &_value);
+
+      void setLogLevel(const ls::std::io::LogLevelValue &_value);
+      void setLogLevel(const ::std::string &_value);
+      ::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);
+      void _init();
+      bool _isValidLogLevelString(const ::std::string &_value);
+  };
 }
 
 #endif

+ 5 - 11
include/ls_std/io/logging/LogLevelValue.hpp

@@ -3,25 +3,19 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
 #ifndef LS_STD_LOG_LEVEL_VALUE_HPP
 #define LS_STD_LOG_LEVEL_VALUE_HPP
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  enum LogLevelValue
   {
-    namespace io
-    {
-      enum LogLevelValue
-      {
-        FATAL = 0, ERR, WARN, INFO, DEBUG, TRACE
-      };
-    }
-  }
+    FATAL = 0, ERR, WARN, INFO, DEBUG, TRACE
+  };
 }
 
 #endif

+ 29 - 35
include/ls_std/io/logging/Logger.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -18,42 +18,36 @@
 #include <string>
 #include <ls_std/os/dynamic_goal.hpp>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL Logger : public ls::std::core::Class
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL Logger : public ls::std::core::Class
-      {
-        public:
-
-          explicit Logger(const ::std::shared_ptr<ls::std::core::interface_type::IWriter> &_writer);
-          ~Logger() override = default;
-
-          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();
-          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);
-          void warn(const ls::std::core::type::byte *_data);
-
-        private:
-
-          ls::std::io::LogLevel logLevel{};
-          ::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);
-          void _log(const ls::std::core::type::byte *_data, const ls::std::io::LogLevel &_logLevel);
-          static ::std::string _padRight(const ::std::string& _text);
-      };
-    }
-  }
+    public:
+
+      explicit Logger(const ::std::shared_ptr<ls::std::core::interface_type::IWriter> &_writer);
+      ~Logger() override = default;
+
+      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();
+      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);
+      void warn(const ls::std::core::type::byte *_data);
+
+    private:
+
+      ls::std::io::LogLevel logLevel{};
+      ::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);
+      void _log(const ls::std::core::type::byte *_data, const ls::std::io::LogLevel &_logLevel);
+      static ::std::string _padRight(const ::std::string &_text);
+  };
 }
 
 #endif

+ 22 - 28
include/ls_std/io/xml/XmlAttribute.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-23
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -14,35 +14,29 @@
 #include <string>
 #include <ls_std/os/dynamic_goal.hpp>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL XmlAttribute : public ls::std::core::Class
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL XmlAttribute : public ls::std::core::Class
-      {
-        public:
-
-          explicit XmlAttribute(const ::std::string &_name);
-          ~XmlAttribute() override = default;
-
-          ::std::string getName();
-          ::std::string getValue();
-          void setName(const ::std::string &_name);
-          void setValue(const ::std::string &_value);
-          ::std::string toXml();
-
-        private:
-
-          ::std::string name{};
-          ::std::string value{};
-
-          void _assignName(const ::std::string &_name);
-          void _assignValue(const ::std::string &_value);
-      };
-    }
-  }
+    public:
+
+      explicit XmlAttribute(const ::std::string &_name);
+      ~XmlAttribute() override = default;
+
+      ::std::string getName();
+      ::std::string getValue();
+      void setName(const ::std::string &_name);
+      void setValue(const ::std::string &_value);
+      ::std::string toXml();
+
+    private:
+
+      ::std::string name{};
+      ::std::string value{};
+
+      void _assignName(const ::std::string &_name);
+      void _assignValue(const ::std::string &_value);
+  };
 }
 
 #endif

+ 24 - 30
include/ls_std/io/xml/XmlDeclaration.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-27
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -14,37 +14,31 @@
 #include "XmlAttribute.hpp"
 #include <ls_std/os/dynamic_goal.hpp>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL XmlDeclaration : public ls::std::core::Class
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL XmlDeclaration : public ls::std::core::Class
-      {
-        public:
-
-          explicit XmlDeclaration(const ::std::string &_version);
-          ~XmlDeclaration() override = default;
-
-          ::std::string getEncoding();
-          ::std::string getStandalone();
-          ::std::string getVersion();
-          void setEncoding(const ::std::string &_encoding);
-          void setStandalone(const ::std::string &_standalone);
-          void setVersion(const ::std::string &_version);
-          ::std::string toXml();
-
-        private:
-
-          ls::std::io::XmlAttribute encoding{"encoding"};
-          ls::std::io::XmlAttribute standalone{"standalone"};
-          ls::std::io::XmlAttribute version{"version"};
-
-          static ::std::string _toXmlAttribute(ls::std::io::XmlAttribute _attribute);
-      };
-    }
-  }
+    public:
+
+      explicit XmlDeclaration(const ::std::string &_version);
+      ~XmlDeclaration() override = default;
+
+      ::std::string getEncoding();
+      ::std::string getStandalone();
+      ::std::string getVersion();
+      void setEncoding(const ::std::string &_encoding);
+      void setStandalone(const ::std::string &_standalone);
+      void setVersion(const ::std::string &_version);
+      ::std::string toXml();
+
+    private:
+
+      ls::std::io::XmlAttribute encoding{"encoding"};
+      ls::std::io::XmlAttribute standalone{"standalone"};
+      ls::std::io::XmlAttribute version{"version"};
+
+      static ::std::string _toXmlAttribute(ls::std::io::XmlAttribute _attribute);
+  };
 }
 
 #endif

+ 22 - 28
include/ls_std/io/xml/XmlDocument.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-27
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -16,35 +16,29 @@
 #include "XmlDeclaration.hpp"
 #include <ls_std/os/dynamic_goal.hpp>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL XmlDocument : public ls::std::core::Class
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL XmlDocument : public ls::std::core::Class
-      {
-        public:
-
-          XmlDocument();
-          ~XmlDocument() override = default;
-
-          ::std::shared_ptr<ls::std::io::XmlDeclaration> getDeclaration();
-          ::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();
-
-        private:
-
-          ::std::shared_ptr<ls::std::io::XmlDeclaration> declaration{};
-          ::std::shared_ptr<ls::std::io::XmlNode> rootElement{};
-
-          void _assignDeclaration(const ::std::shared_ptr<ls::std::io::XmlDeclaration> &_declaration);
-          void _assignRootElement(const ::std::shared_ptr<ls::std::io::XmlNode> &_rootElement);
-      };
-    }
-  }
+    public:
+
+      XmlDocument();
+      ~XmlDocument() override = default;
+
+      ::std::shared_ptr<ls::std::io::XmlDeclaration> getDeclaration();
+      ::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();
+
+    private:
+
+      ::std::shared_ptr<ls::std::io::XmlDeclaration> declaration{};
+      ::std::shared_ptr<ls::std::io::XmlNode> rootElement{};
+
+      void _assignDeclaration(const ::std::shared_ptr<ls::std::io::XmlDeclaration> &_declaration);
+      void _assignRootElement(const ::std::shared_ptr<ls::std::io::XmlNode> &_rootElement);
+  };
 }
 
 #endif

+ 54 - 60
include/ls_std/io/xml/XmlNode.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-24
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -16,74 +16,68 @@
 #include "XmlAttribute.hpp"
 #include <ls_std/os/dynamic_goal.hpp>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL XmlNode : public ls::std::core::Class
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL XmlNode : public ls::std::core::Class
-      {
-        public:
+    public:
 
-          explicit XmlNode(::std::string _name);
-          ~XmlNode() override = default;
+      explicit XmlNode(::std::string _name);
+      ~XmlNode() override = default;
 
-          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);
-          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();
-          void setName(const ::std::string &_name);
-          void setValue(const ::std::string &_value);
-          ::std::string toXml();
+      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);
+      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();
+      void setName(const ::std::string &_name);
+      void setValue(const ::std::string &_value);
+      ::std::string toXml();
 
-        protected:
+    protected:
 
-          ::std::string _toXml_(uint8_t _tabSize);
+      ::std::string _toXml_(uint8_t _tabSize);
 
-        private:
+    private:
 
-          ::std::list<::std::shared_ptr<ls::std::io::XmlAttribute>> attributes{};
-          ::std::list<::std::shared_ptr<ls::std::io::XmlNode>> children{};
-          ::std::string name{};
-          const static uint8_t TAB_SIZE{4};
-          ::std::string value{};
+      ::std::list<::std::shared_ptr<ls::std::io::XmlAttribute>> attributes{};
+      ::std::list<::std::shared_ptr<ls::std::io::XmlNode>> children{};
+      ::std::string name{};
+      const static uint8_t TAB_SIZE{4};
+      ::std::string value{};
 
-          void _assignName(const ::std::string &_name);
-          void _assignValue(const ::std::string &_value);
-          static void _checkIfAttributeReferenceIsValid(const ::std::shared_ptr<ls::std::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();
-      };
-    }
-  }
+      void _assignName(const ::std::string &_name);
+      void _assignValue(const ::std::string &_value);
+      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();
+  };
 }
 
 #endif

+ 5 - 11
include/ls_std/io/xml/XmlParseMode.hpp

@@ -3,25 +3,19 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-13
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
 #ifndef LS_STD_XML_PARSE_MODE_HPP
 #define LS_STD_XML_PARSE_MODE_HPP
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  enum XmlParseMode
   {
-    namespace io
-    {
-      enum XmlParseMode
-      {
-        XML_PARSE_MODE_ANALYZE = 0, XML_PARSE_MODE_DECLARATION, XML_PARSE_MODE_OPENING_TAG, XML_PARSE_MODE_VALUE, XML_PARSE_MODE_CLOSING_TAG
-      };
-    }
-  }
+    XML_PARSE_MODE_ANALYZE = 0, XML_PARSE_MODE_DECLARATION, XML_PARSE_MODE_OPENING_TAG, XML_PARSE_MODE_VALUE, XML_PARSE_MODE_CLOSING_TAG
+  };
 }
 
 #endif

+ 6 - 12
include/ls_std/io/xml/XmlParseParameter.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-17
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -14,19 +14,13 @@
 #include <memory>
 #include "XmlNode.hpp"
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  struct XmlParseParameter
   {
-    namespace io
-    {
-      struct XmlParseParameter
-      {
-        uint8_t level{};
-        ::std::shared_ptr<ls::std::io::XmlNode> node{};
-      };
-    }
-  }
+    uint8_t level{};
+    ::std::shared_ptr<ls::std::io::XmlNode> node{};
+  };
 }
 
 #endif

+ 45 - 51
include/ls_std/io/xml/XmlParser.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-25
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -18,65 +18,59 @@
 #include <list>
 #include <ls_std/os/dynamic_goal.hpp>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL XmlParser : public ls::std::core::Class
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL XmlParser : public ls::std::core::Class
-      {
-        public:
+    public:
 
-          explicit XmlParser(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document);
-          ~XmlParser() override = default;
+      explicit XmlParser(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document);
+      ~XmlParser() override = default;
 
-          ::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);
+      ::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:
+    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);
+      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);
 
-        private:
+    private:
 
-          uint8_t currentLevel{};
-          ::std::shared_ptr<ls::std::io::XmlDocument> document{};
-          uint8_t maxLevel{};
-          ls::std::io::XmlParseMode mode{};
-          ::std::list<ls::std::io::XmlParseParameter> parseParameters{};
+      uint8_t currentLevel{};
+      ::std::shared_ptr<ls::std::io::XmlDocument> document{};
+      uint8_t maxLevel{};
+      ls::std::io::XmlParseMode mode{};
+      ::std::list<ls::std::io::XmlParseParameter> parseParameters{};
 
-          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);
-          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);
-          void _isValue(const ls::std::core::type::byte_field &_data, ::std::string::size_type _index);
-          void _mergeNodes();
-          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);
-          void _reset();
-          void _setMaxLevel();
-      };
-    }
-  }
+      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);
+      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);
+      void _isValue(const ls::std::core::type::byte_field &_data, ::std::string::size_type _index);
+      void _mergeNodes();
+      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);
+      void _reset();
+      void _setMaxLevel();
+  };
 }
 
 #endif

+ 18 - 24
include/ls_std/io/xml/XmlReader.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-08
- * Changed:         2022-07-01
+ * Changed:         2022-07-02
  *
  * */
 
@@ -19,39 +19,33 @@
 #include <list>
 #include <ls_std/os/dynamic_goal.hpp>
 
-namespace ls
+namespace ls::std::io
 {
-  namespace std
+  class DYNAMIC_GOAL XmlReader : public ls::std::core::Class, public ls::std::core::interface_type::IReader
   {
-    namespace io
-    {
-      class DYNAMIC_GOAL XmlReader : public ls::std::core::Class, public ls::std::core::interface_type::IReader
-      {
-        public:
+    public:
 
-          explicit XmlReader(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document, const ::std::string &_absolutePath);
-          ~XmlReader() override = default;
+      explicit XmlReader(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document, const ::std::string &_absolutePath);
+      ~XmlReader() override = default;
 
-          // implementation
+      // implementation
 
-          ls::std::core::type::byte_field read() override;
+      ls::std::core::type::byte_field read() override;
 
-          // additional functionality
+      // additional functionality
 
-          ::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);
+      ::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);
 
-        private:
+    private:
 
-          ::std::shared_ptr<ls::std::io::XmlDocument> document{};
-          ls::std::io::File xmlFile;
+      ::std::shared_ptr<ls::std::io::XmlDocument> document{};
+      ls::std::io::File xmlFile;
 
-          void _assignDocument(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document);
-          void _assignFile(ls::std::io::File _xmlFile);
-      };
-    }
-  }
+      void _assignDocument(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document);
+      void _assignFile(ls::std::io::File _xmlFile);
+  };
 }
 
 #endif