Sketching some basic interfaces

This commit is contained in:
2022-11-01 20:02:47 +01:00
parent c119a02e2f
commit a059df7f67
13 changed files with 295 additions and 9 deletions

31
src/P700Printer.cpp Normal file
View File

@@ -0,0 +1,31 @@
#include "P700Printer.hpp"
#include <stdexcept>
#include <iostream>
namespace ptprnt::printer {
P700Printer::P700Printer(std::unique_ptr<driver::P700Driver> driver) {
if(!driver->open()) {
throw std::invalid_argument("Could not open driver!");
}
}
P700Printer::~P700Printer() {
if(!mDriver->close()) {
std::cerr << "Could not close driver properly!" << std::endl;
}
}
printer::info P700Printer::getInfo() {
return printer::info{};
}
bool P700Printer::printText(std::string_view text, uint32_t fontSize) {
return false;
}
bool P700Printer::printBitmap(std::shared_ptr<bitmap::Bitmap> bm) {
return false;
}
}