src/QRCommand.h
author František Kučera <franta-hg@frantovo.cz>
Wed, 14 Apr 2021 19:01:54 +0200
branchv_0
changeset 0 0a0cb749c10f
child 1 79d699ed88ab
permissions -rw-r--r--
projekt skeleton

/**
 * 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");


	}
};

}
}
}