/*
 * Author:          Patrick-Christopher Mattulat
 * Co-Author:       Claude Sonnet 4.6 (LLM)
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2020-08-17
 * Changed:         2026-06-23
 *
 * */

#ifndef LS_STD_FILE_WRITER_HPP
#define LS_STD_FILE_WRITER_HPP

#include "File.hpp"
#include <ls-std/core/Class.hpp>
#include <ls-std/core/interface/IWriter.hpp>
#include <ls-std/os/dynamic-goal.hpp>

/*
 * @doc: class(name: 'FileWriter', package: 'io')
 * @doc: io.FileWriter.description('This class can write to a file.')
 * */

namespace ls::standard::io
{
  class LS_STD_DYNAMIC_GOAL FileWriter : public ls::standard::core::Class, public ls::standard::core::interface_type::IWriter
  {
    public:

      explicit FileWriter(const ls::standard::io::File &_file);
      ~FileWriter() noexcept override;

      void reset(const ls::standard::io::File &_file);
      bool write(const ls::standard::core::type::byte_field &_data) override; // nodiscard is optional here

    private:

      ls::standard::io::File file;
  };
}

#endif
