Fire Core  8.0.0.alpha
GIS framework per tutti gli usi
 Tutto Classi Namespace Funzioni Variabili Ridefinizioni di tipo (typedef) Tipi enumerati (enum) Valori del tipo enumerato Friend
FeaturesType.hpp
1 // Copyright 2015 GEOSYSTEMS SRL
2 // All Rights Reserved.
3 
4 #ifndef FIRE_DATA_FEATURESTYPE_HPP_INCLUDED
5 #define FIRE_DATA_FEATURESTYPE_HPP_INCLUDED
6 
7 #include <exception>
8 #include <string>
9 #include <sstream>
10 
11 namespace fire {
12 namespace source {
13 namespace FeaturesType {
14 
18 enum FeaturesType {
22  NONE = -1,
26  ALPHA_FILTER = 1,
30  EDITABLE,
34  SPATIAL_FILTER,
38  SUPPORT_TRANSACTION
39 };
40 
46 inline std::string toString(FeaturesType const & t) {
47  std::stringstream ss;
48  ss << "fire::source::FeaturesType";
49  switch (t) {
50  case ALPHA_FILTER:
51  ss << "::ALPHA_FILTER";
52  break;
53  case EDITABLE:
54  ss << "::EDITABLE";
55  break;
56  case SPATIAL_FILTER:
57  ss << "::SPATIAL_FILTER";
58  break;
59  case SUPPORT_TRANSACTION:
60  ss << "::SUPPORT_TRANSACTION";
61  break;
62  case NONE:
63  ss << "::NONE";
64  break;
65  }
66 
67  return ss.str();
68 }
69 
75 inline FeaturesType fromString(std::string const & val) {
76  FeaturesType list[] = {
77  ALPHA_FILTER,
78  EDITABLE,
79  SPATIAL_FILTER,
80  SUPPORT_TRANSACTION,
81  NONE
82  };
83 
84  int len = sizeof(list)/sizeof(FeaturesType);
85  for (int i = 0; i < len; i++) {
86  FeaturesType item = list[i];
87  if (toString(item) == val)
88  return item;
89  }
90 
91  return NONE;
92 }
93 
94 } // namespace FeaturesType
95 } // namespace source
96 } // namespace fire
97 
98 #endif
BooleanOperator fromString(const std::string &string)
Restituisce il valore di un operatore booleano data una stringa che rappresenta il valore dell'operat...
Definition: BooleanOperator.hpp:88
std::string toString(const BooleanOperator &booleanOperator)
Restituisce la stringa che rappresenta il valore di un operatore booleano dato il valore di un operat...
Definition: BooleanOperator.hpp:40