13 const std::string DBType::_labels[
LAST_VALUE] =
14 {
"NoDB",
"SQLite3",
"MySQL/MariaDB" };
17 const char DBType::_typeLabels[
LAST_VALUE] = {
'N',
'S',
'M' };
26 : _type (iDBType._type) {
38 case 'N': oType =
NODB;
break;
39 case 'S': oType =
SQLITE3;
break;
40 case 'M': oType =
MYSQL;
break;
46 std::ostringstream oMessage;
47 oMessage <<
"The database type '" << iTypeChar
48 <<
"' is not known. Known database types: " << lLabels;
62 if (iTypeStr ==
"sqlite3") {
64 }
else if (iTypeStr ==
"sqlite" || iTypeStr ==
"sqlite3") {
66 }
else if (iTypeStr ==
"mysql" || iTypeStr ==
"mariadb") {
68 }
else if (iTypeStr ==
"nodb") {
76 std::ostringstream oMessage;
77 oMessage <<
"The database type '" << iTypeStr
78 <<
"' is not known. Known database types: " << lLabels;
85 return _labels[iType];
90 return _typeLabels[iType];
95 std::ostringstream oStr;
96 oStr << _typeLabels[iType];
102 std::ostringstream ostr;
103 for (
unsigned short idx = 0; idx !=
LAST_VALUE; ++idx) {
107 ostr << _labels[idx];
119 const char oTypeChar = _typeLabels[_type];
125 std::ostringstream oStr;
126 oStr << _typeLabels[_type];
132 std::ostringstream ostr;
133 ostr << _labels[_type];
139 return (_type == iType);
144 return (_type == iDBType._type);
static std::string describeLabels()
DBType(const EN_DBType &)
const std::string describe() const
static std::string getTypeLabelAsString(const EN_DBType &)
EN_DBType getType() const
bool operator==(const EN_DBType &) const
std::string getTypeAsString() const
static char getTypeLabel(const EN_DBType &)
static EN_DBType getType(const char)
static const std::string & getLabel(const EN_DBType &)
char getTypeAsChar() const