relpipe-in-cli.cpp
author František Kučera <franta-hg@frantovo.cz>
Sat, 11 Aug 2018 22:16:13 +0200
branchv_0
changeset 0 cac146f5345a
permissions -rw-r--r--
create netbeans project

#include <cstdlib>
#include <memory>

#include <RelationalWriter.h>
#include <RelpipeWriterException.h>
#include <Factory.h>
#include <TypeId.h>

#include "CLI.h"

using namespace relpipe::cli;
using namespace relpipe::writer;

int main(int argc, char** argv) {
	setlocale(LC_ALL, "");
	CLI cli(argc, argv);

	int resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR;

	try {
		fwprintf(stderr, L"TODO: implement fstab reading\n");

	} catch (RelpipeWriterException e) {
		fwprintf(stderr, L"Caught Writer exception: %ls\n", e.getMessge().c_str());
		fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount());
		resultCode = CLI::EXIT_CODE_DATA_ERROR;
	}

	return resultCode;
}