PrinterPortLogger.hh 947 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef MSXPRINTERPORTLOGGER_HH
  2. #define MSXPRINTERPORTLOGGER_HH
  3. #include "PrinterPortDevice.hh"
  4. #include "FilenameSetting.hh"
  5. #include "File.hh"
  6. namespace openmsx {
  7. class CommandController;
  8. class PrinterPortLogger final : public PrinterPortDevice
  9. {
  10. public:
  11. explicit PrinterPortLogger(CommandController& commandController);
  12. // PrinterPortDevice
  13. bool getStatus(EmuTime::param time) override;
  14. void setStrobe(bool strobe, EmuTime::param time) override;
  15. void writeData(byte data, EmuTime::param time) override;
  16. // Pluggable
  17. const std::string& getName() const override;
  18. string_view getDescription() const override;
  19. void plugHelper(Connector& connector, EmuTime::param time) override;
  20. void unplugHelper(EmuTime::param time) override;
  21. template<typename Archive>
  22. void serialize(Archive& ar, unsigned version);
  23. private:
  24. FilenameSetting logFilenameSetting;
  25. File file;
  26. byte toPrint;
  27. bool prevStrobe;
  28. };
  29. } // namespace openmsx
  30. #endif