src/CLIParser.h
branchv_0
changeset 33 e87c231afb77
parent 26 421608ecc12a
equal deleted inserted replaced
32:2354c9058fb6 33:e87c231afb77
    24 
    24 
    25 #include "Configuration.h"
    25 #include "Configuration.h"
    26 
    26 
    27 namespace relpipe {
    27 namespace relpipe {
    28 namespace tr {
    28 namespace tr {
    29 namespace guile {
    29 namespace scheme {
    30 
    30 
    31 class CLIParser {
    31 class CLIParser {
    32 private:
    32 private:
    33 
    33 
    34 	// FIXME: move common methods/classes to relpipe-lib-cli or relpipe-lib-helper
    34 	// FIXME: move common methods/classes to relpipe-lib-cli or relpipe-lib-helper
    73 		RelationConfiguration currentRelation;
    73 		RelationConfiguration currentRelation;
    74 
    74 
    75 		for (int i = 0; i < arguments.size();) {
    75 		for (int i = 0; i < arguments.size();) {
    76 			string_t option = readNext(arguments, i);
    76 			string_t option = readNext(arguments, i);
    77 
    77 
    78 			if (option == OPTION_BEFORE_RECORDS) currentRelation.guileBeforeRecords = readNext(arguments, i);
    78 			if (option == OPTION_BEFORE_RECORDS) currentRelation.schemeBeforeRecords = readNext(arguments, i);
    79 			else if (option == OPTION_AFTER_RECORDS) currentRelation.guileAfterRecords = readNext(arguments, i);
    79 			else if (option == OPTION_AFTER_RECORDS) currentRelation.schemeAfterRecords = readNext(arguments, i);
    80 			else if (option == OPTION_FOR_EACH) currentRelation.guileForEach = readNext(arguments, i);
    80 			else if (option == OPTION_FOR_EACH) currentRelation.schemeForEach = readNext(arguments, i);
    81 			else if (option == OPTION_WHERE) currentRelation.guileWhere = readNext(arguments, i);
    81 			else if (option == OPTION_WHERE) currentRelation.schemeWhere = readNext(arguments, i);
    82 			else if (option == OPTION_HAS_MORE_RECORDS) currentRelation.guileHasMoreRecords = readNext(arguments, i);
    82 			else if (option == OPTION_HAS_MORE_RECORDS) currentRelation.schemeHasMoreRecords = readNext(arguments, i);
    83 			else if (option == OPTION_DROP) currentRelation.drop = true;
    83 			else if (option == OPTION_DROP) currentRelation.drop = true;
    84 			else if (option == OPTION_INPUT_ATTRIBUTES_APPEND) currentRelation.inputAttributesAppend = true;
    84 			else if (option == OPTION_INPUT_ATTRIBUTES_APPEND) currentRelation.inputAttributesAppend = true;
    85 			else if (option == OPTION_INPUT_ATTRIBUTES_PREPEND) currentRelation.inputAttributesPrepend = true;
    85 			else if (option == OPTION_INPUT_ATTRIBUTES_PREPEND) currentRelation.inputAttributesPrepend = true;
    86 			else if (option == OPTION_DEBUG_VARIABLE_MAPPING) currentRelation.debugVariableMapping = true;
    86 			else if (option == OPTION_DEBUG_VARIABLE_MAPPING) currentRelation.debugVariableMapping = true;
    87 			else if (option == OPTION_RELATION) {
    87 			else if (option == OPTION_RELATION) {