src/CLIParser.h
branchv_0
changeset 19 e4558df9ba2d
parent 14 f407f2a2871d
child 26 cf57e8c78492
equal deleted inserted replaced
18:2ac59242d0cb 19:e4558df9ba2d
    65 	static const string_t OPTION_INPUT_ATTRIBUTES_APPEND;
    65 	static const string_t OPTION_INPUT_ATTRIBUTES_APPEND;
    66 	static const string_t OPTION_INPUT_ATTRIBUTES_PREPEND;
    66 	static const string_t OPTION_INPUT_ATTRIBUTES_PREPEND;
    67 	static const string_t OPTION_BEFORE_RECORDS;
    67 	static const string_t OPTION_BEFORE_RECORDS;
    68 	static const string_t OPTION_AFTER_RECORDS;
    68 	static const string_t OPTION_AFTER_RECORDS;
    69 	static const string_t OPTION_FOR_EACH;
    69 	static const string_t OPTION_FOR_EACH;
       
    70 	static const string_t OPTION_DROP;
    70 	static const string_t OPTION_DEFINE;
    71 	static const string_t OPTION_DEFINE;
    71 
    72 
    72 	Configuration parse(const std::vector<string_t>& arguments) {
    73 	Configuration parse(const std::vector<string_t>& arguments) {
    73 		Configuration c;
    74 		Configuration c;
    74 		RelationConfiguration currentRelation;
    75 		RelationConfiguration currentRelation;
    77 			string_t option = readNext(arguments, i);
    78 			string_t option = readNext(arguments, i);
    78 
    79 
    79 			if (option == OPTION_BEFORE_RECORDS) currentRelation.awkBeforeRecords = readNext(arguments, i);
    80 			if (option == OPTION_BEFORE_RECORDS) currentRelation.awkBeforeRecords = readNext(arguments, i);
    80 			else if (option == OPTION_AFTER_RECORDS) currentRelation.awkAfterRecords = readNext(arguments, i);
    81 			else if (option == OPTION_AFTER_RECORDS) currentRelation.awkAfterRecords = readNext(arguments, i);
    81 			else if (option == OPTION_FOR_EACH) currentRelation.awkForEach = readNext(arguments, i);
    82 			else if (option == OPTION_FOR_EACH) currentRelation.awkForEach = readNext(arguments, i);
       
    83 			else if (option == OPTION_DROP) currentRelation.drop = true;
    82 			else if (option == OPTION_INPUT_ATTRIBUTES_APPEND) currentRelation.inputAttributesAppend = true;
    84 			else if (option == OPTION_INPUT_ATTRIBUTES_APPEND) currentRelation.inputAttributesAppend = true;
    83 			else if (option == OPTION_INPUT_ATTRIBUTES_PREPEND) currentRelation.inputAttributesPrepend = true;
    85 			else if (option == OPTION_INPUT_ATTRIBUTES_PREPEND) currentRelation.inputAttributesPrepend = true;
    84 			else if (option == OPTION_RELATION) {
    86 			else if (option == OPTION_RELATION) {
    85 				addRelation(c, currentRelation); // previous relation
    87 				addRelation(c, currentRelation); // previous relation
    86 				currentRelation.relation = readNext(arguments, i);
    88 				currentRelation.relation = readNext(arguments, i);
   112 const string_t CLIParser::OPTION_INPUT_ATTRIBUTES_APPEND = L"--input-attributes-append";
   114 const string_t CLIParser::OPTION_INPUT_ATTRIBUTES_APPEND = L"--input-attributes-append";
   113 const string_t CLIParser::OPTION_INPUT_ATTRIBUTES_PREPEND = L"--input-attributes-prepend";
   115 const string_t CLIParser::OPTION_INPUT_ATTRIBUTES_PREPEND = L"--input-attributes-prepend";
   114 const string_t CLIParser::OPTION_BEFORE_RECORDS = L"--before-records";
   116 const string_t CLIParser::OPTION_BEFORE_RECORDS = L"--before-records";
   115 const string_t CLIParser::OPTION_AFTER_RECORDS = L"--after-records";
   117 const string_t CLIParser::OPTION_AFTER_RECORDS = L"--after-records";
   116 const string_t CLIParser::OPTION_FOR_EACH = L"--for-each";
   118 const string_t CLIParser::OPTION_FOR_EACH = L"--for-each";
       
   119 const string_t CLIParser::OPTION_DROP = L"--drop";
   117 const string_t CLIParser::OPTION_DEFINE = L"--define";
   120 const string_t CLIParser::OPTION_DEFINE = L"--define";
   118 
   121 
   119 }
   122 }
   120 }
   123 }
   121 }
   124 }