src/QRCommand.h
branchv_0
changeset 0 0a0cb749c10f
child 1 79d699ed88ab
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/QRCommand.h	Wed Apr 14 19:01:54 2021 +0200
@@ -0,0 +1,58 @@
+/**
+ * Relational pipes
+ * Copyright © 2021 František Kučera (Frantovo.cz, GlobalCode.info)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#pragma once
+
+#include <codecvt>
+#include <memory>
+#include <algorithm>
+#include <iostream>
+#include <stdexcept>
+
+#include <zbar.h>
+
+#include "Configuration.h"
+
+namespace relpipe {
+namespace in {
+namespace qr {
+
+class QRCommand {
+	std::wstring_convert<codecvt_utf8<wchar_t>> convertor; // TODO: use platform encoding as default
+
+
+public:
+
+	void process(Configuration& configuration, std::shared_ptr<writer::RelationalWriter> writer, std::function<void() > relationalWriterFlush) {
+
+		zbar::Image image;
+		zbar::ImageScanner scanner;
+
+		writer->startRelation(L"qr",{
+			{L"value", relpipe::writer::TypeId::STRING}
+		}, true);
+
+		writer->writeAttribute(L"some");
+		writer->writeAttribute(L"qr");
+		writer->writeAttribute(L"codes");
+
+
+	}
+};
+
+}
+}
+}