libsl3 1.2.41002
A C++ interface for SQLite
|
This class models the duck typing sqlite uses. It supports int, real, text, blob and null values. More...
#include <sl3/value.hpp>
Public Member Functions | |
Value () noexcept | |
Constructor. | |
Value (int val) noexcept | |
Constructor. | |
Value (int64_t val) noexcept | |
Constructor. | |
Value (std::string val) noexcept | |
Constructor. | |
Value (const char *val) | |
Constructor. | |
Value (double val) noexcept | |
Constructor. | |
Value (Blob val) noexcept | |
Constructor. | |
~Value () noexcept | |
Destructor. | |
Value (const Value &) noexcept | |
Copy constructor. | |
Value (Value &&) noexcept | |
Move constructor. | |
Value & | operator= (const Value &val) |
Assignment. | |
Value & | operator= (Value &&val) |
Assignment. | |
Value & | operator= (int val) |
Assignment. | |
Value & | operator= (const int64_t &val) |
Assignment. | |
Value & | operator= (const double &val) |
Assignment. | |
Value & | operator= (const std::string &val) |
Assignment. | |
Value & | operator= (const Blob &val) |
Assignment. | |
operator int () const | |
Implicit conversion operator. | |
operator int64_t () const | |
Implicit conversion operator. | |
operator double () const | |
Implicit conversion operator. | |
operator const std::string & () const | |
Implicit conversion operator. | |
operator const Blob & () const | |
Implicit conversion operator. | |
const int64_t & | int64 () const |
Access the value. | |
const double & | real () const |
Access the value. | |
const std::string & | text () const |
Access the value. | |
const Blob & | blob () const |
Access the value. | |
std::string | ejectText () |
Moves the current value into the return value. | |
Blob | ejectBlob () |
Moves the current value into the return value. | |
void | setNull () noexcept |
Set to NULL. | |
bool | isNull () const noexcept |
Check Null. | |
Type | getType () const noexcept |
The Type of the value. | |
void | swap (Value &other) noexcept |
swap function | |
This class models the duck typing sqlite uses. It supports int, real, text, blob and null values.
The class has the current type info availalbe.
|
noexcept |
Constructor.
Creates a Null Value
|
explicitnoexcept |
Constructor.
This constructor wiht an initialization value
val | initial value |
|
explicitnoexcept |
Constructor.
This constructor wiht an initialization value
val | initial value |
|
explicitnoexcept |
Constructor.
This constructor wiht an initialization value
val | initial value |
|
explicit |
Constructor.
This constructor wiht an initialization value
val | initial value |
|
explicitnoexcept |
Constructor.
This constructor wiht an initialization value
val | initial value |
|
explicitnoexcept |
Constructor.
This constructor wiht an initialization value
val | initial value |
|
noexcept |
Destructor.
|
noexcept |
Copy constructor.
|
noexcept |
Move constructor.
const Blob & sl3::Value::blob | ( | ) | const |
Access the value.
sl3::ErrNullValueAccess | if value is null. |
sl3::ErrTypeMisMatch | if the current value has a different type. |
Blob sl3::Value::ejectBlob | ( | ) |
Moves the current value into the return value.
After calling this function the value will be Null.
sl3::ErrTypeMisMatch | in case of wrong type. |
std::string sl3::Value::ejectText | ( | ) |
Moves the current value into the return value.
After calling this function the value will be Null.
sl3::ErrTypeMisMatch | in case of wrong type. |
|
noexcept |
The Type of the value.
const int64_t & sl3::Value::int64 | ( | ) | const |
Access the value.
sl3::ErrNullValueAccess | if value is null. |
sl3::ErrTypeMisMatch | if the current value has a different type. |
|
noexcept |
Check Null.
|
explicit |
Implicit conversion operator.
sl3::ErrNullValueAccess | if value is null. |
sl3::ErrTypeMisMatch | if getType is incompatible |
|
explicit |
Implicit conversion operator.
sl3::ErrNullValueAccess | if value is null. |
sl3::ErrTypeMisMatch | if getType is incompatible |
|
explicit |
Implicit conversion operator.
sl3::ErrNullValueAccess | if value is null. |
sl3::ErrTypeMisMatch | if getType is incompatible |
sl3::ErrOutOfRange | is the stored value is an int64_t and out of the min or max double range. |
|
explicit |
Implicit conversion operator.
sl3::ErrNullValueAccess | if value is null. |
sl3::ErrTypeMisMatch | if getType is incompatible |
sl3::ErrOutOfRange | is the stored value is an int64_t |
|
explicit |
Implicit conversion operator.
sl3::ErrNullValueAccess | if value is null. |
sl3::ErrTypeMisMatch | if getType is incompatible |
Assignment.
sl3::ErrTypeMisMatch | if getType is incompatible |
val | new value |
Value & sl3::Value::operator= | ( | const double & | val | ) |
Assignment.
sl3::ErrTypeMisMatch | if getType is incompatible |
val | new value |
Value & sl3::Value::operator= | ( | const int64_t & | val | ) |
Assignment.
sl3::ErrTypeMisMatch | if getType is incompatible |
val | new value |
Value & sl3::Value::operator= | ( | const std::string & | val | ) |
Assignment.
sl3::ErrTypeMisMatch | if getType is incompatible |
val | new value |
Assignment.
sl3::ErrTypeMisMatch | if getType is incompatible |
val | new value |
Value & sl3::Value::operator= | ( | int | val | ) |
Assignment.
sl3::ErrTypeMisMatch | if getType is incompatible |
val | new value |
Assignment.
sl3::ErrTypeMisMatch | if getType is incompatible |
val | new value |
const double & sl3::Value::real | ( | ) | const |
Access the value.
sl3::ErrNullValueAccess | if value is null. |
sl3::ErrTypeMisMatch | if the current value has a different type. |
|
noexcept |
Set to NULL.
|
noexcept |
swap function
Independent of the type, a Value is always swapable.
other | value to swap with |
const std::string & sl3::Value::text | ( | ) | const |
Access the value.
sl3::ErrNullValueAccess | if value is null. |
sl3::ErrTypeMisMatch | if the current value has a different type. |