OpenTREP Logo  0.07.18
C++ Open Travel Request Parsing Library
Loading...
Searching...
No Matches
OPENTREP::DBType Struct Reference

Enumeration of database types. More...

#include <opentrep/DBType.hpp>

Public Types

enum  EN_DBType { NODB = 0 , SQLITE3 , MYSQL , LAST_VALUE }
 

Public Member Functions

EN_DBType getType () const
 
char getTypeAsChar () const
 
std::string getTypeAsString () const
 
const std::string describe () const
 
bool operator== (const EN_DBType &) const
 
bool operator== (const DBType &) const
 
 DBType (const EN_DBType &)
 
 DBType (const char iType)
 
 DBType (const std::string &iType)
 
 DBType (const DBType &)
 

Static Public Member Functions

static const std::string & getLabel (const EN_DBType &)
 
static EN_DBType getType (const char)
 
static char getTypeLabel (const EN_DBType &)
 
static std::string getTypeLabelAsString (const EN_DBType &)
 
static std::string describeLabels ()
 

Detailed Description

Enumeration of database types.

Definition at line 17 of file DBType.hpp.

Member Enumeration Documentation

◆ EN_DBType

Enumerator
NODB 
SQLITE3 
MYSQL 
LAST_VALUE 

Definition at line 19 of file DBType.hpp.

Constructor & Destructor Documentation

◆ DBType() [1/4]

OPENTREP::DBType::DBType ( const EN_DBType & iDBType)

Main constructor.

Definition at line 30 of file DBType.cpp.

References DBType().

Referenced by DBType(), DBType(), DBType(), DBType(), and operator==().

◆ DBType() [2/4]

OPENTREP::DBType::DBType ( const char iType)

Alternative constructor.

Definition at line 56 of file DBType.cpp.

References DBType(), and getType().

◆ DBType() [3/4]

OPENTREP::DBType::DBType ( const std::string & iType)

Alternative constructor.

Definition at line 61 of file DBType.cpp.

References DBType(), describeLabels(), LAST_VALUE, MYSQL, NODB, and SQLITE3.

◆ DBType() [4/4]

OPENTREP::DBType::DBType ( const DBType & iDBType)

Default copy constructor.

Definition at line 25 of file DBType.cpp.

References DBType().

Member Function Documentation

◆ getLabel()

const std::string & OPENTREP::DBType::getLabel ( const EN_DBType & iType)
static

Get the label as a string (e.g., "NoDB", "SQLite3", "MySQL/MariaDB").

Definition at line 84 of file DBType.cpp.

◆ getType() [1/2]

DBType::EN_DBType OPENTREP::DBType::getType ( const char iTypeChar)
static

Get the type value from parsing a single char (e.g., 'N', 'S', 'M')

Definition at line 35 of file DBType.cpp.

References describeLabels(), LAST_VALUE, MYSQL, NODB, and SQLITE3.

Referenced by DBType().

◆ getTypeLabel()

char OPENTREP::DBType::getTypeLabel ( const EN_DBType & iType)
static

Get the label as a single char (e.g., 'N', 'S', 'M')

Definition at line 89 of file DBType.cpp.

◆ getTypeLabelAsString()

std::string OPENTREP::DBType::getTypeLabelAsString ( const EN_DBType & iType)
static

Get the label as a string of a single char (e.g., 'N', 'S', 'M')

Definition at line 94 of file DBType.cpp.

◆ describeLabels()

std::string OPENTREP::DBType::describeLabels ( )
static

List the labels.

Definition at line 101 of file DBType.cpp.

References LAST_VALUE.

Referenced by DBType(), and getType().

◆ getType() [2/2]

DBType::EN_DBType OPENTREP::DBType::getType ( ) const

Get the enumerated value.

Definition at line 113 of file DBType.cpp.

◆ getTypeAsChar()

char OPENTREP::DBType::getTypeAsChar ( ) const

Get the enumerated value as a short string (e.g., "N", "S", "M")

Definition at line 118 of file DBType.cpp.

◆ getTypeAsString()

std::string OPENTREP::DBType::getTypeAsString ( ) const

Get the enumerated value as a short string (e.g., "N", "S", "M")

Definition at line 124 of file DBType.cpp.

◆ describe()

const std::string OPENTREP::DBType::describe ( ) const

Give a description of the structure (e.g., "NoDB", "SQLite3", "MySQL/MariaDB").

Definition at line 131 of file DBType.cpp.

Referenced by OPENTREP::DBManager::createSQLDBIndexes(), OPENTREP::DBManager::createSQLDBTables(), OPENTREP::getLocationList(), OPENTREP::DBManager::initSQLDBSession(), main(), and OPENTREP::DBManager::terminateSQLDBSession().

◆ operator==() [1/2]

bool OPENTREP::DBType::operator== ( const EN_DBType & iType) const

Comparison operators.

Definition at line 138 of file DBType.cpp.

◆ operator==() [2/2]

bool OPENTREP::DBType::operator== ( const DBType & iDBType) const

Definition at line 143 of file DBType.cpp.

References DBType().


The documentation for this struct was generated from the following files: