FileOutputStream.hpp 697 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-08-20
  6. * Changed: 2020-08-20
  7. *
  8. * */
  9. #ifndef FILE_OUTPUT_STREAM_HPP
  10. #define FILE_OUTPUT_STREAM_HPP
  11. #include "../base/Class.hpp"
  12. #include "File.hpp"
  13. #include "IWriter.hpp"
  14. #include <fstream>
  15. namespace ls_std {
  16. class FileOutputStream : public Class, IWriter {
  17. public:
  18. explicit FileOutputStream(File& _file);
  19. ~FileOutputStream();
  20. void close();
  21. bool write(const ls_std::byte* _data) override;
  22. private:
  23. File file;
  24. std::ofstream outputStream {};
  25. void _close();
  26. };
  27. }
  28. #endif