OpenTREP Logo  0.07.7
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
OPENTREP::DBType::MYSQL
@ MYSQL
Definition: DBType.hpp:22
OPENTREP::DBType::SQLITE3
@ SQLITE3
Definition: DBType.hpp:21
OPENTREP::DBType::getTypeLabelAsString
static std::string getTypeLabelAsString(const EN_DBType &)
Definition: DBType.cpp:94
OPENTREP::DBType::getType
EN_DBType getType() const
Definition: DBType.cpp:113
OPENTREP::DBType::describe
const std::string describe() const
Definition: DBType.cpp:131
OPENTREP::DBType::NODB
@ NODB
Definition: DBType.hpp:20
OPENTREP
Definition: BasChronometer.cpp:10
OPENTREP::DBType::describeLabels
static std::string describeLabels()
Definition: DBType.cpp:101
OPENTREP::DBType::getLabel
static const std::string & getLabel(const EN_DBType &)
Definition: DBType.cpp:84
OPENTREP::DBType::getTypeAsString
std::string getTypeAsString() const
Definition: DBType.cpp:124
OPENTREP::DBType::LAST_VALUE
@ LAST_VALUE
Definition: DBType.hpp:23
OPENTREP::DBType::EN_DBType
EN_DBType
Definition: DBType.hpp:19
OPENTREP::DBType::getTypeLabel
static char getTypeLabel(const EN_DBType &)
Definition: DBType.cpp:89
OPENTREP::DBType::getTypeAsChar
char getTypeAsChar() const
Definition: DBType.cpp:118
OPENTREP::DBType
Enumeration of database types.
Definition: DBType.hpp:17
OPENTREP_Types.hpp
OPENTREP::DBType::operator==
bool operator==(const EN_DBType &) const
Definition: DBType.cpp:138