OpenTREP Logo  0.07.10
C++ Open Travel Request Parsing Library
DBType.hpp
Go to the documentation of this file.
1 #ifndef __OPENTREP_DBTYPE_HPP
2 #define __OPENTREP_DBTYPE_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <string>
9 // OpenTrep
11 
12 namespace OPENTREP {
13 
17  struct DBType {
18  public:
19  typedef enum {
20  NODB = 0,
25 
29  static const std::string& getLabel (const EN_DBType&);
30 
34  static EN_DBType getType (const char);
35 
39  static char getTypeLabel (const EN_DBType&);
40 
44  static std::string getTypeLabelAsString (const EN_DBType&);
45 
49  static std::string describeLabels();
50 
54  EN_DBType getType() const;
55 
59  char getTypeAsChar() const;
60 
64  std::string getTypeAsString() const;
65 
70  const std::string describe() const;
71 
72  public:
76  bool operator== (const EN_DBType&) const;
77  bool operator== (const DBType&) const;
78 
79  public:
83  DBType (const EN_DBType&);
87  DBType (const char iType);
91  DBType (const std::string& iType);
95  DBType (const DBType&);
96 
97  private:
101  DBType();
102 
103 
104  private:
108  static const std::string _labels[LAST_VALUE];
112  static const char _typeLabels[LAST_VALUE];
113 
114  private:
115  // //////// Attributes /////////
119  EN_DBType _type;
120  };
121 
122 }
123 #endif // __OPENTREP_DBTYPE_HPP
Enumeration of database types.
Definition: DBType.hpp:17
static std::string describeLabels()
Definition: DBType.cpp:101
const std::string describe() const
Definition: DBType.cpp:131
static std::string getTypeLabelAsString(const EN_DBType &)
Definition: DBType.cpp:94
EN_DBType getType() const
Definition: DBType.cpp:113
bool operator==(const EN_DBType &) const
Definition: DBType.cpp:138
std::string getTypeAsString() const
Definition: DBType.cpp:124
static char getTypeLabel(const EN_DBType &)
Definition: DBType.cpp:89
static const std::string & getLabel(const EN_DBType &)
Definition: DBType.cpp:84
char getTypeAsChar() const
Definition: DBType.cpp:118