lintel 0.2.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
lintel::db::ConnectionType Class Reference

#include <ConnectionType.h>

Public Types

enum  Value : std::int8_t { UNDEFINED = -1 , SQLite = 0 , PostgreSQL }
 

Public Member Functions

 ConnectionType ()=default
 
constexpr ConnectionType (Value value)
 
constexpr ConnectionType (std::string_view enumName)
 
constexpr operator Value () const
 
constexpr Value value () const
 
 operator bool ()=delete
 
std::string toString () const
 

Static Public Member Functions

static std::set< Value > values ()
 

Friends

std::ostream & operator<< (std::ostream &os, const ConnectionType &connectionType)
 

Detailed Description

Defines the supported database connection types.

Member Enumeration Documentation

◆ Value

Enumerator
UNDEFINED 
SQLite 
PostgreSQL 

Constructor & Destructor Documentation

◆ ConnectionType() [1/3]

lintel::db::ConnectionType::ConnectionType ( )
default

Default constructor, initializes to UNDEFINED.

◆ ConnectionType() [2/3]

constexpr lintel::db::ConnectionType::ConnectionType ( Value  value)
inlineconstexpr

Constructs from a Value enum.

Parameters
valuethe connection type value

◆ ConnectionType() [3/3]

constexpr lintel::db::ConnectionType::ConnectionType ( std::string_view  enumName)
inlineexplicitconstexpr

Constructs from a string representation of a Value.

Parameters
enumNamestring matching a Value name, defaults to UNDEFINED if not found

Member Function Documentation

◆ operator bool()

lintel::db::ConnectionType::operator bool ( )
explicitdelete

◆ operator Value()

constexpr lintel::db::ConnectionType::operator Value ( ) const
inlineconstexpr

Implicit conversion to Value.

◆ toString()

std::string lintel::db::ConnectionType::toString ( ) const
inline
Returns
string representation of the current value

◆ value()

constexpr Value lintel::db::ConnectionType::value ( ) const
inlineconstexpr
Returns
the underlying Value as an enum, e.g. for exhaustive switches

◆ values()

static std::set< Value > lintel::db::ConnectionType::values ( )
inlinestatic
Returns
set of all defined Value entries

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const ConnectionType &  connectionType 
)
friend

Streams the string representation of the connection type.


The documentation for this class was generated from the following file: