Browse Source

Added IWriter interface

- added IWriter interface to offer possibility to
implement basic writing functionality
Patrick 4 years ago
parent
commit
42911fba55
2 changed files with 29 additions and 1 deletions
  1. 2 1
      CMakeLists.txt
  2. 27 0
      source/io/IWriter.hpp

+ 2 - 1
CMakeLists.txt

@@ -57,7 +57,8 @@ set(SOURCE_FILES
         ${CMAKE_CURRENT_SOURCE_DIR}/source/io/FilePathSeparator.hpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/utils/STLUtils.hpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Long.hpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Long.cpp)
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Long.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/io/IWriter.hpp)
 
 set(TEST_FILES
         ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/IntegerTest.cpp

+ 27 - 0
source/io/IWriter.hpp

@@ -0,0 +1,27 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-08-17
+ * Changed:         2020-08-17
+ *
+ * */
+
+#ifndef I_WRITER_HPP
+#define I_WRITER_HPP
+
+#include <vector>
+#include "../base/Types.hpp"
+
+namespace ls_std {
+  class IWriter {
+    public:
+
+      IWriter() = default;
+      ~IWriter() = default;
+
+      virtual bool write(const std::vector<ls_std::byte>& _data) = 0;
+  };
+}
+
+#endif