65 |
65 |
66 public: |
66 public: |
67 |
67 |
68 static const relpipe::common::type::StringX OPTION_RELATION; |
68 static const relpipe::common::type::StringX OPTION_RELATION; |
69 static const relpipe::common::type::StringX OPTION_ATTRIBUTE; |
69 static const relpipe::common::type::StringX OPTION_ATTRIBUTE; |
70 static const relpipe::common::type::StringX OPTION_PATTERN; |
70 static const relpipe::common::type::StringX OPTION_VALUE; |
71 static const relpipe::common::type::StringX OPTION_CASE_SENSITIVE; |
71 static const relpipe::common::type::StringX OPTION_CASE_SENSITIVE; |
72 static const relpipe::common::type::StringX OPTION_INVERT_MATCH; |
72 static const relpipe::common::type::StringX OPTION_INVERT_MATCH; |
73 |
73 |
74 Configuration parse(const std::vector<relpipe::common::type::StringX>& arguments) { |
74 Configuration parse(const std::vector<relpipe::common::type::StringX>& arguments) { |
75 Configuration c; |
75 Configuration c; |
81 if (option == OPTION_RELATION) { |
81 if (option == OPTION_RELATION) { |
82 addRelation(c, currentRelation); // previous relation |
82 addRelation(c, currentRelation); // previous relation |
83 currentRelation.relation = readNext(arguments, i); |
83 currentRelation.relation = readNext(arguments, i); |
84 } else if (option == OPTION_ATTRIBUTE) { |
84 } else if (option == OPTION_ATTRIBUTE) { |
85 currentRelation.attribute = readNext(arguments, i); |
85 currentRelation.attribute = readNext(arguments, i); |
86 } else if (option == OPTION_PATTERN) { |
86 } else if (option == OPTION_VALUE) { |
87 currentRelation.value = readNext(arguments, i); |
87 currentRelation.value = readNext(arguments, i); |
88 } else if (option == OPTION_CASE_SENSITIVE) { |
88 } else if (option == OPTION_CASE_SENSITIVE) { |
89 RelationConfiguration::ENTITY entity = parseEntity(readNext(arguments, i)); |
89 RelationConfiguration::ENTITY entity = parseEntity(readNext(arguments, i)); |
90 currentRelation.caseSensitive[entity] = parseBoolean(readNext(arguments, i)); |
90 currentRelation.caseSensitive[entity] = parseBoolean(readNext(arguments, i)); |
91 } else if (option == OPTION_INVERT_MATCH) { |
91 } else if (option == OPTION_INVERT_MATCH) { |
102 } |
102 } |
103 }; |
103 }; |
104 |
104 |
105 const relpipe::common::type::StringX CLIParser::OPTION_RELATION = L"--relation"; |
105 const relpipe::common::type::StringX CLIParser::OPTION_RELATION = L"--relation"; |
106 const relpipe::common::type::StringX CLIParser::OPTION_ATTRIBUTE = L"--attribute"; |
106 const relpipe::common::type::StringX CLIParser::OPTION_ATTRIBUTE = L"--attribute"; |
107 const relpipe::common::type::StringX CLIParser::OPTION_PATTERN = L"--pattern"; |
107 const relpipe::common::type::StringX CLIParser::OPTION_VALUE = L"--value"; |
108 const relpipe::common::type::StringX CLIParser::OPTION_CASE_SENSITIVE = L"--case-sensitive"; |
108 const relpipe::common::type::StringX CLIParser::OPTION_CASE_SENSITIVE = L"--case-sensitive"; |
109 const relpipe::common::type::StringX CLIParser::OPTION_INVERT_MATCH = L"--invert-match"; |
109 const relpipe::common::type::StringX CLIParser::OPTION_INVERT_MATCH = L"--invert-match"; |
110 |
110 |
111 } |
111 } |
112 } |
112 } |