FileWriter.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Co-Author: Claude Sonnet 4.6 (LLM)
  4. * Company: Lynar Studios
  5. * E-Mail: webmaster@lynarstudios.com
  6. * Created: 2020-08-17
  7. * Changed: 2026-06-23
  8. *
  9. * */
  10. #ifndef LS_STD_FILE_WRITER_HPP
  11. #define LS_STD_FILE_WRITER_HPP
  12. #include "File.hpp"
  13. #include <ls-std/core/Class.hpp>
  14. #include <ls-std/core/interface/IWriter.hpp>
  15. #include <ls-std/os/dynamic-goal.hpp>
  16. /*
  17. * @doc: class(name: 'FileWriter', package: 'io')
  18. * @doc: io.FileWriter.description('This class can write to a file.')
  19. * */
  20. namespace ls::standard::io
  21. {
  22. class LS_STD_DYNAMIC_GOAL FileWriter : public ls::standard::core::Class, public ls::standard::core::interface_type::IWriter
  23. {
  24. public:
  25. explicit FileWriter(const ls::standard::io::File &_file);
  26. ~FileWriter() noexcept override;
  27. void reset(const ls::standard::io::File &_file);
  28. bool write(const ls::standard::core::type::byte_field &_data) override; // nodiscard is optional here
  29. private:
  30. ls::standard::io::File file;
  31. };
  32. }
  33. #endif