Re-structured project

This commit is contained in:
2023-08-26 11:53:44 +02:00
parent c3915336dd
commit 61e2352a3c
25 changed files with 257 additions and 257 deletions

View File

@@ -1,33 +1,41 @@
#include "P700Printer.hpp"
#include <iostream>
#include <stdexcept>
namespace ptprnt::printer {
P700Printer::P700Printer(std::shared_ptr<driver::P700Driver> driver) {
mDriver = std::move(driver);
if (!mDriver->open()) {
throw std::invalid_argument("Could not open driver!");
}
const std::string_view P700Printer::getDriverName() {
return info.driverName;
}
P700Printer::~P700Printer() {
if (!mDriver->close()) {
std::cerr << "Could not close driver properly!" << std::endl;
}
const std::string_view P700Printer::getName() {
return info.name;
}
printer::info P700Printer::getInfo() {
return printer::info{};
const std::string_view P700Printer::getVersion() {
return info.version;
}
bool P700Printer::printText(std::string_view text, uint32_t fontSize) {
return false;
const uint16_t P700Printer::getVid() {
return info.vid;
}
bool P700Printer::printBitmap(std::shared_ptr<bitmap::Bitmap> bm) {
return false;
const uint16_t P700Printer::getPid() {
return info.pid;
}
bool P700Printer::attachUsbDevice(std::shared_ptr<libusbwrap::IUsbDevice> usbHndl) {
return true;
}
bool P700Printer::detachUsbDevice() {
return true;
}
bool P700Printer::printBitmap(const Bitmap& bitmap) {
return true;
}
bool P700Printer::printText(const std::string& text, uint16_t fontSize) {
return true;
}
} // namespace ptprnt::printer