FileWriter.hpp 915 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-08-17
  6. * Changed: 2022-05-19
  7. *
  8. * */
  9. #ifndef LS_STD_FILE_WRITER_HPP
  10. #define LS_STD_FILE_WRITER_HPP
  11. #include <ls_std/core/Class.hpp>
  12. #include <ls_std/core/interface/IWriter.hpp>
  13. #include "File.hpp"
  14. namespace ls
  15. {
  16. namespace std
  17. {
  18. namespace io
  19. {
  20. class FileWriter : public ls::std::core::Class, public ls::std::core::interface_type::IWriter
  21. {
  22. public:
  23. explicit FileWriter(ls::std::io::File &_file);
  24. ~FileWriter() override = default;
  25. void reset(ls::std::io::File &_file);
  26. bool write(const ls::std::core::type::byte_field &_data) override;
  27. private:
  28. ls::std::io::File file;
  29. static void _init(ls::std::io::File &_file);
  30. };
  31. }
  32. }
  33. }
  34. #endif