src/CLIParser.h
author František Kučera <franta-hg@frantovo.cz>
Sun, 05 Jan 2020 01:01:12 +0100
branchv_0
changeset 8 8730e2d0db0e
parent 7 ff69af3c67a3
child 15 917b8fbd29b9
permissions -rw-r--r--
suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
/**
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
 * Relational pipes
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
 * Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
 *
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
 * This program is free software: you can redistribute it and/or modify
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
4
a0689654b3c2 fix license version: GNU GPLv3
František Kučera <franta-hg@frantovo.cz>
parents: 2
diff changeset
     7
 * the Free Software Foundation, version 3 of the License.
1
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
 *
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
 * GNU General Public License for more details.
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
 *
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
 */
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
#pragma once
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
#include <vector>
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
#include <relpipe/writer/typedefs.h>
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
#include <relpipe/cli/CLI.h>
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
#include <relpipe/cli/RelpipeCLIException.h>
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
#include "Configuration.h"
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
namespace relpipe {
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
namespace in {
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
namespace xmltable {
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
class CLIParser {
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
private:
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
	string_t readNext(std::vector<string_t> arguments, int& i) {
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
		if (i < arguments.size()) return arguments[i++];
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
		else throw relpipe::cli::RelpipeCLIException(L"Missing CLI argument" + (i > 0 ? (L" after " + arguments[i - 1]) : L""), relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
	}
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
7
ff69af3c67a3 XInclude support – option: --xinclude true
František Kučera <franta-hg@frantovo.cz>
parents: 4
diff changeset
    39
	/**
ff69af3c67a3 XInclude support – option: --xinclude true
František Kučera <franta-hg@frantovo.cz>
parents: 4
diff changeset
    40
	 * TODO: use a common method
ff69af3c67a3 XInclude support – option: --xinclude true
František Kučera <franta-hg@frantovo.cz>
parents: 4
diff changeset
    41
	 */
ff69af3c67a3 XInclude support – option: --xinclude true
František Kučera <franta-hg@frantovo.cz>
parents: 4
diff changeset
    42
	bool parseBoolean(const string_t& value) {
ff69af3c67a3 XInclude support – option: --xinclude true
František Kučera <franta-hg@frantovo.cz>
parents: 4
diff changeset
    43
		if (value == L"true") return true;
ff69af3c67a3 XInclude support – option: --xinclude true
František Kučera <franta-hg@frantovo.cz>
parents: 4
diff changeset
    44
		else if (value == L"false") return false;
ff69af3c67a3 XInclude support – option: --xinclude true
František Kučera <franta-hg@frantovo.cz>
parents: 4
diff changeset
    45
		else throw relpipe::cli::RelpipeCLIException(L"Unable to parse boolean value: " + value + L" (expecting true or false)", relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
ff69af3c67a3 XInclude support – option: --xinclude true
František Kučera <franta-hg@frantovo.cz>
parents: 4
diff changeset
    46
	}
ff69af3c67a3 XInclude support – option: --xinclude true
František Kučera <franta-hg@frantovo.cz>
parents: 4
diff changeset
    47
1
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    48
	void addRelation(Configuration& c, RelationConfiguration& currentRelation) {
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    49
		if (currentRelation.relation.size()) {
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    50
			c.relationConfigurations.push_back(currentRelation);
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    51
			currentRelation = RelationConfiguration();
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    52
		}
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    53
	}
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    54
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    55
	relpipe::writer::TypeId parseTypeId(const string_t& value) {
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    56
		using t = relpipe::writer::TypeId;
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    57
		if (value == L"string") return t::STRING;
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    58
		else if (value == L"integer") return t::INTEGER;
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    59
		else if (value == L"boolean") return t::BOOLEAN;
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    60
		else throw relpipe::cli::RelpipeCLIException(L"Unable to parse TypeId: " + value, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    61
	}
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    62
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    63
public:
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    64
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    65
	static const string_t OPTION_NAMESPACE;
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    66
	static const string_t OPTION_RELATION;
2
0d3eb5129582 convert arbitrary XML to one or more relations
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    67
	static const string_t OPTION_NAME_IS_XPATH;
1
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    68
	static const string_t OPTION_RECORDS;
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    69
	static const string_t OPTION_ATTRIBUTE;
7
ff69af3c67a3 XInclude support – option: --xinclude true
František Kučera <franta-hg@frantovo.cz>
parents: 4
diff changeset
    70
	static const string_t OPTION_XINCLUDE;
8
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    71
	static const string_t OPTION_MODE;
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    72
	static const string_t OPTION_RAW_XML_NODELIST_WRAPPER;
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    73
	static const string_t OPTION_RAW_XML_ATTRIBUTE_WRAPPER;
1
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    74
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    75
	Configuration parse(const std::vector<string_t>& arguments) {
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    76
		Configuration c;
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    77
		RelationConfiguration currentRelation;
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    78
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    79
		for (int i = 0; i < arguments.size();) {
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    80
			string_t option = readNext(arguments, i);
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    81
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    82
			if (option == OPTION_NAMESPACE) {
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    83
				c.namespaceMappings.push_back(readNext(arguments, i));
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    84
				c.namespaceMappings.push_back(readNext(arguments, i));
7
ff69af3c67a3 XInclude support – option: --xinclude true
František Kučera <franta-hg@frantovo.cz>
parents: 4
diff changeset
    85
			} else if (option == OPTION_XINCLUDE) {
ff69af3c67a3 XInclude support – option: --xinclude true
František Kučera <franta-hg@frantovo.cz>
parents: 4
diff changeset
    86
				c.xinclude = parseBoolean(readNext(arguments, i));
1
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    87
			} else if (option == OPTION_RELATION) {
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    88
				addRelation(c, currentRelation); // previous relation
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    89
				currentRelation.relation = readNext(arguments, i);
2
0d3eb5129582 convert arbitrary XML to one or more relations
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    90
			} else if (option == OPTION_NAME_IS_XPATH) {
0d3eb5129582 convert arbitrary XML to one or more relations
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    91
				currentRelation.nameIsXPath = true;
1
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    92
			} else if (option == OPTION_RECORDS) {
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    93
				currentRelation.xpath = readNext(arguments, i);
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    94
			} else if (option == OPTION_ATTRIBUTE) {
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    95
				AttributeRecipe attribute;
8
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    96
				attribute.mode = currentRelation.mode;
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    97
				attribute.rawXmlNodeListWrapper = currentRelation.rawXmlNodeListWrapper;
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    98
				attribute.rawXmlAttributeWrapper = currentRelation.rawXmlAttributeWrapper;
1
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    99
				attribute.name = readNext(arguments, i);
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   100
				attribute.type = parseTypeId(readNext(arguments, i));
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   101
				attribute.xpath = readNext(arguments, i);
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   102
				currentRelation.attributes.push_back(attribute);
8
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   103
			} else if (option == OPTION_MODE) {
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   104
				string_t modeName = readNext(arguments, i);
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   105
				Mode mode;
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   106
				if (modeName == L"string") mode = Mode::STRING;
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   107
				else if (modeName == L"boolean") mode = Mode::BOOLEAN;
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   108
				else if (modeName == L"raw-xml") mode = Mode::RAW_XML;
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   109
				else if (modeName == L"line-number") mode = Mode::LINE_NUMBER;
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   110
				else if (modeName == L"xpath") mode = Mode::XPATH;
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   111
				else throw relpipe::cli::RelpipeCLIException(L"Unsupported mode: " + modeName, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   112
				if (currentRelation.attributes.size()) currentRelation.attributes.back().mode = mode;
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   113
				else currentRelation.mode = mode;
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   114
			} else if (option == OPTION_RAW_XML_NODELIST_WRAPPER) {
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   115
				XmlElementSkeleton w = {readNext(arguments, i), readNext(arguments, i), readNext(arguments, i)};
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   116
				if (currentRelation.attributes.size()) currentRelation.attributes.back().rawXmlNodeListWrapper = w;
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   117
				else currentRelation.rawXmlNodeListWrapper = w;
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   118
			} else if (option == OPTION_RAW_XML_ATTRIBUTE_WRAPPER) {
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   119
				XmlElementSkeleton w = {readNext(arguments, i), readNext(arguments, i), readNext(arguments, i)};
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   120
				if (currentRelation.attributes.size()) currentRelation.attributes.back().rawXmlAttributeWrapper = w;
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   121
				else currentRelation.rawXmlAttributeWrapper = w;
1
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   122
			} else throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   123
		}
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   124
		addRelation(c, currentRelation); // last relation
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   125
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   126
		return c;
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   127
	}
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   128
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   129
	virtual ~CLIParser() {
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   130
	}
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   131
};
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   132
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   133
const string_t CLIParser::OPTION_NAMESPACE = L"--namespace";
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   134
const string_t CLIParser::OPTION_RELATION = L"--relation";
2
0d3eb5129582 convert arbitrary XML to one or more relations
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
   135
const string_t CLIParser::OPTION_NAME_IS_XPATH = L"--name-is-xpath";
1
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   136
const string_t CLIParser::OPTION_RECORDS = L"--records";
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   137
const string_t CLIParser::OPTION_ATTRIBUTE = L"--attribute";
7
ff69af3c67a3 XInclude support – option: --xinclude true
František Kučera <franta-hg@frantovo.cz>
parents: 4
diff changeset
   138
const string_t CLIParser::OPTION_XINCLUDE = L"--xinclude";
8
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   139
const string_t CLIParser::OPTION_MODE = L"--mode";
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   140
const string_t CLIParser::OPTION_RAW_XML_NODELIST_WRAPPER = L"--raw-xml-nodelist-wrapper";
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   141
const string_t CLIParser::OPTION_RAW_XML_ATTRIBUTE_WRAPPER = L"--raw-xml-attribute-wrapper";
1
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   142
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   143
}
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   144
}
7d6ac51c0d48 configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   145
}