Add cli options for formatting
All checks were successful
Build ptprnt / build (push) Successful in 1m11s

This commit is contained in:
2023-10-19 21:29:09 +02:00
parent 4b96fcfac1
commit 368d8f3599
6 changed files with 88 additions and 26 deletions

View File

@@ -27,11 +27,21 @@
#include "interface/IPrinterDriver.hpp"
#include "libusbwrap/UsbDeviceFactory.hpp"
namespace ptprnt {
enum class CliCmdType { None = 0, Text = 1, FontSize = 2, Font = 3, VAlign = 4, HAlign = 5 };
using CliCmd = std::pair<CliCmdType, std::string>;
class PtouchPrint {
public:
PtouchPrint(const char* versionString);
~PtouchPrint() = default;
// This is basically a singelton application class, no need to copy or move
PtouchPrint(const PtouchPrint&) = delete;
PtouchPrint& operator=(const PtouchPrint&) = delete;
PtouchPrint(PtouchPrint&&) = delete;
PtouchPrint& operator=(PtouchPrint&&) = delete;
int init(int argc, char** argv);
int run();
@@ -43,11 +53,13 @@ class PtouchPrint {
// member variables
CLI::App mApp{ptprnt::APP_DESC};
libusbwrap::UsbDeviceFactory mUsbDeviceFactory;
std::vector<std::shared_ptr<ptprnt::IPrinterDriver>> mCompatiblePrinters;
std::vector<std::shared_ptr<ptprnt::IPrinterDriver>> mDetectedPrinters;
libusbwrap::UsbDeviceFactory mUsbDeviceFactory{};
std::vector<std::shared_ptr<ptprnt::IPrinterDriver>> mCompatiblePrinters{};
std::vector<std::shared_ptr<ptprnt::IPrinterDriver>> mDetectedPrinters{};
std::vector<CliCmd> mCommands{};
std::string mVersionString = "";
// CLI flags
bool mVerboseFlag = false;
};
};
} // namespace ptprnt