src/Configuration.h
branchv_0
changeset 28 bc15f5471b6a
equal deleted inserted replaced
27:f9b72d263838 28:bc15f5471b6a
       
     1 /**
       
     2  * Relational pipes
       
     3  * Copyright © 2021 František Kučera (Frantovo.cz, GlobalCode.info)
       
     4  *
       
     5  * This program is free software: you can redistribute it and/or modify
       
     6  * it under the terms of the GNU General Public License as published by
       
     7  * the Free Software Foundation, version 3 of the License.
       
     8  *
       
     9  * This program is distributed in the hope that it will be useful,
       
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
       
    12  * GNU General Public License for more details.
       
    13  *
       
    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/>.
       
    16  */
       
    17 #pragma once
       
    18 
       
    19 #include <map>
       
    20 #include <regex>
       
    21 #include <locale>
       
    22 
       
    23 #include <relpipe/common/type/typedefs.h>
       
    24 
       
    25 
       
    26 namespace relpipe {
       
    27 namespace tr {
       
    28 namespace cut {
       
    29 
       
    30 class RelationConfiguration {
       
    31 public:
       
    32 
       
    33 	enum class ENTITY {
       
    34 		RELATION,
       
    35 		ATTRIBUTE
       
    36 	};
       
    37 
       
    38 	RelationConfiguration() {
       
    39 		caseSensitive[ENTITY::RELATION] = true;
       
    40 		caseSensitive[ENTITY::ATTRIBUTE] = true;
       
    41 		invertMatch[ENTITY::RELATION] = false;
       
    42 		invertMatch[ENTITY::ATTRIBUTE] = false;
       
    43 	}
       
    44 
       
    45 	virtual ~RelationConfiguration() {
       
    46 	}
       
    47 
       
    48 	relpipe::common::type::StringX relation;
       
    49 	std::vector<relpipe::common::type::StringX> attributes;
       
    50 	std::wregex relationPattern;
       
    51 	std::vector<std::wregex> attributePatterns;
       
    52 	std::map<ENTITY, relpipe::common::type::Boolean> caseSensitive;
       
    53 	std::map<ENTITY, relpipe::common::type::Boolean> invertMatch;
       
    54 };
       
    55 
       
    56 class Configuration {
       
    57 public:
       
    58 	std::vector<RelationConfiguration> relationConfigurations;
       
    59 
       
    60 	virtual ~Configuration() {
       
    61 	}
       
    62 };
       
    63 
       
    64 }
       
    65 }
       
    66 }