src/Configuration.h
branchv_0
changeset 25 98be80d2e65b
parent 24 c69670b7b4ef
equal deleted inserted replaced
24:c69670b7b4ef 25:98be80d2e65b
    14  * You should have received a copy of the GNU General Public License
    14  * You should have received a copy of the GNU General Public License
    15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
    15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
    16  */
    16  */
    17 #pragma once
    17 #pragma once
    18 
    18 
    19 #include <vector>
    19 #include <map>
    20 #include <regex>
    20 #include <regex>
    21 #include <locale>
    21 #include <locale>
    22 
    22 
    23 #include <relpipe/common/type/typedefs.h>
    23 #include <relpipe/common/type/typedefs.h>
    24 
    24 
    28 namespace grep {
    28 namespace grep {
    29 
    29 
    30 class RelationConfiguration {
    30 class RelationConfiguration {
    31 public:
    31 public:
    32 
    32 
       
    33 	enum class ENTITY {
       
    34 		RELATION,
       
    35 		ATTRIBUTE,
       
    36 		VALUE
       
    37 	};
       
    38 
       
    39 	RelationConfiguration() {
       
    40 		caseSensitive[ENTITY::RELATION] = true;
       
    41 		caseSensitive[ENTITY::ATTRIBUTE] = true;
       
    42 		caseSensitive[ENTITY::VALUE] = true;
       
    43 		invertMatch[ENTITY::RELATION] = false;
       
    44 		invertMatch[ENTITY::ATTRIBUTE] = false;
       
    45 		invertMatch[ENTITY::VALUE] = false;
       
    46 	}
       
    47 
    33 	virtual ~RelationConfiguration() {
    48 	virtual ~RelationConfiguration() {
    34 	}
    49 	}
    35 
    50 
    36 	relpipe::common::type::StringX relation; // TODO: remove and use just relationPattern, see CLIParser
    51 	relpipe::common::type::StringX relation;
       
    52 	relpipe::common::type::StringX attribute;
       
    53 	relpipe::common::type::StringX value;
    37 	std::wregex relationPattern;
    54 	std::wregex relationPattern;
    38 	std::wregex attributePattern;
    55 	std::wregex attributePattern;
    39 	std::wregex valuePattern;
    56 	std::wregex valuePattern;
       
    57 	std::map<ENTITY, relpipe::common::type::Boolean> caseSensitive;
       
    58 	std::map<ENTITY, relpipe::common::type::Boolean> invertMatch;
    40 };
    59 };
    41 
    60 
    42 class Configuration {
    61 class Configuration {
    43 public:
    62 public:
    44 	std::vector<RelationConfiguration> relationConfigurations;
    63 	std::vector<RelationConfiguration> relationConfigurations;