FileWriter.hpp 934 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-08-17
  6. * Changed: 2024-09-09
  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. /*
  16. * @doc: class(name: 'FileWriter', package: 'io')
  17. * */
  18. namespace ls::std::io
  19. {
  20. class LS_STD_DYNAMIC_GOAL FileWriter : public ls::std::core::Class, public ls::std::core::interface_type::IWriter
  21. {
  22. public:
  23. explicit FileWriter(const ls::std::io::File &_file);
  24. ~FileWriter() noexcept override;
  25. void reset(const ls::std::io::File &_file);
  26. bool write(const ls::std::core::type::byte_field &_data) override; // nodiscard is optional here
  27. private:
  28. ls::std::io::File file;
  29. };
  30. }
  31. #endif