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
VectorLayerType.hpp
1 // Copyright 2015 GEOSYSTEMS SRL
2 // All Rights Reserved.
3 
4 #ifndef FIRE_PLUGIN_DATA_VECTORLAYERTYPE_HPP_INCLUDED
5 #define FIRE_PLUGIN_DATA_VECTORLAYERTYPE_HPP_INCLUDED
6 
7 #include <string>
8 #include <sstream>
9 
10 namespace fire {
11 namespace source {
12 namespace vector {
13 namespace VectorLayerType {
14 
18 enum VectorLayerType {
22  UNKNOWN = -1,
26  VIEW = 1,
30  GEOVIEW,
34  TABLE,
38  GEOTABLE
39 };
40 
41 inline std::string toString(VectorLayerType const & t) {
42  std::stringstream ss;
43  ss << "fire::source::vector::VectorLayerType";
44  switch (t) {
45  case VIEW:
46  ss << "::VIEW";
47  break;
48  case GEOVIEW:
49  ss << "::GEOVIEW";
50  break;
51  case TABLE:
52  ss << "::TABLE";
53  break;
54  case GEOTABLE:
55  ss << "::GEOTABLE";
56  break;
57  case UNKNOWN:
58  default:
59  ss << "UNKNOWN";
60  }
61 
62  return ss.str();
63 }
64 
65 inline VectorLayerType fromString(std::string const & val) {
66  VectorLayerType list[] = {
67  UNKNOWN,
68  VIEW,
69  GEOVIEW,
70  TABLE,
71  GEOTABLE
72  };
73 
74  int len = sizeof(list)/sizeof(VectorLayerType);
75  for (int i = 0; i < len; i++) {
76  VectorLayerType item = list[i];
77  if (toString(item) == val)
78  return item;
79  }
80 
81  return UNKNOWN;
82 }
83 
84 } // namespace VectorLayerType
85 } // namespace vector
86 } // namespace source
87 } // namespace fire
88 
89 #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