FileWriter.hpp 874 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-08-17
  6. * Changed: 2023-05-16
  7. *
  8. * */
  9. #ifndef LS_STD_FILE_WRITER_HPP
  10. #define LS_STD_FILE_WRITER_HPP
  11. #include "File.hpp"
  12. #include <ls-std/core/Class.hpp>
  13. #include <ls-std/core/interface/IWriter.hpp>
  14. #include <ls-std/os/dynamic-goal.hpp>
  15. namespace ls::std::io
  16. {
  17. class LS_STD_DYNAMIC_GOAL FileWriter : public ls::std::core::Class, public ls::std::core::interface_type::IWriter
  18. {
  19. public:
  20. explicit FileWriter(const ls::std::io::File &_file);
  21. ~FileWriter() noexcept override;
  22. void reset(const ls::std::io::File &_file);
  23. bool write(const ls::std::core::type::byte_field &_data) override; // nodiscard is optional here
  24. private:
  25. ls::std::io::File file;
  26. };
  27. }
  28. #endif