Type-erased SQL value (NULL, integers, double, text, blob, bool).
More...
#include <StormByte/database/value.hxx>
|
| | Value (const Value &other) |
| | Copy constructor.
|
| |
| | Value (Value &&other) noexcept |
| | Move constructor.
|
| |
| Value & | operator= (const Value &other) |
| | Copy assignment.
|
| |
| Value & | operator= (Value &&other) noexcept |
| | Move assignment.
|
| |
| bool | operator== (const Value &other) const noexcept |
| | Equality of the stored alternatives.
|
| |
| bool | operator!= (const Value &other) const noexcept |
| | Inequality.
|
| |
| virtual | ~Value () noexcept |
| | Destructor.
|
| |
template<typename T >
requires StormByte::Type::VariantHasType<ValuesVariant, std::decay_t<T>> |
| std::decay_t< T > | Get () const |
| | Stored value as T, with safe numeric conversions.
|
| |
| Type | Type () const noexcept |
| | Discriminator of the stored alternative.
|
| |
| bool | IsNull () const noexcept |
| | Whether the value is SQL NULL.
|
| |
|
| | Value () noexcept |
| | Default constructor.
|
| |
| | Value (int value) noexcept |
| | From a signed int.
|
| |
| | Value (unsigned int value) noexcept |
| | From an unsigned int.
|
| |
| | Value (long int value) noexcept |
| | From a signed long int, stored as long long int.
|
| |
| | Value (unsigned long int value) noexcept |
| | From an unsigned long int, stored as unsigned long long int.
|
| |
| | Value (long long int value) noexcept |
| | From a signed long long int.
|
| |
| | Value (unsigned long long int value) noexcept |
| | From an unsigned long long int.
|
| |
| | Value (double value) noexcept |
| | From a double.
|
| |
| | Value (std::string_view value) noexcept |
| | Copy UTF-8 text into a String-owned value.
|
| |
| | Value (const StormByte::BinaryData &value) |
| | Copy a blob into Base-owned storage.
|
| |
| | Value (StormByte::BinaryData &&value) noexcept |
| | Move a blob into this value.
|
| |
template<typename T >
requires StormByte::Type::SameAs<std::remove_cvref_t<T>, bool> |
| | Value (T &&value) noexcept |
| | From a bool.
|
| |
Type-erased SQL value (NULL, integers, double, text, blob, bool).
◆ Type
Discriminator for the stored alternative.
| Enumerator |
|---|
| Null | SQL NULL.
|
| Integer | int
|
| UnsignedInteger | unsigned int
|
| LongInteger | long long int (64-bit on every platform)
|
| UnsignedLongInteger | unsigned long long int (64-bit on every platform)
|
| Double | double
|
| Text | StormByte::String::String.
|
| Blob | StormByte::BinaryData.
|
| Boolean | bool
|
◆ Value() [1/14]
| StormByte::Database::Value::Value |
( |
| ) |
|
|
inlinenoexcept |
Default constructor.
Stores SQL NULL.
◆ Value() [2/14]
| StormByte::Database::Value::Value |
( |
int |
value | ) |
|
|
inlinenoexcept |
From a signed int.
- Parameters
-
◆ Value() [3/14]
| StormByte::Database::Value::Value |
( |
unsigned int |
value | ) |
|
|
inlinenoexcept |
From an unsigned int.
- Parameters
-
◆ Value() [4/14]
| StormByte::Database::Value::Value |
( |
long int |
value | ) |
|
|
inlinenoexcept |
From a signed long int, stored as long long int.
- Parameters
-
◆ Value() [5/14]
| StormByte::Database::Value::Value |
( |
unsigned long int |
value | ) |
|
|
inlinenoexcept |
From an unsigned long int, stored as unsigned long long int.
- Parameters
-
◆ Value() [6/14]
| StormByte::Database::Value::Value |
( |
long long int |
value | ) |
|
|
inlinenoexcept |
From a signed long long int.
- Parameters
-
◆ Value() [7/14]
| StormByte::Database::Value::Value |
( |
unsigned long long int |
value | ) |
|
|
inlinenoexcept |
From an unsigned long long int.
- Parameters
-
◆ Value() [8/14]
| StormByte::Database::Value::Value |
( |
double |
value | ) |
|
|
inlinenoexcept |
From a double.
- Parameters
-
◆ Value() [9/14]
| StormByte::Database::Value::Value |
( |
std::string_view |
value | ) |
|
|
noexcept |
Copy UTF-8 text into a String-owned value.
- Parameters
-
◆ Value() [10/14]
Copy a blob into Base-owned storage.
- Parameters
-
◆ Value() [11/14]
Move a blob into this value.
- Parameters
-
◆ Value() [12/14]
| StormByte::Database::Value::Value |
( |
T && |
value | ) |
|
|
inlinenoexcept |
◆ Value() [13/14]
| StormByte::Database::Value::Value |
( |
const Value & |
other | ) |
|
◆ Value() [14/14]
| StormByte::Database::Value::Value |
( |
Value && |
other | ) |
|
|
noexcept |
◆ ~Value()
| virtual StormByte::Database::Value::~Value |
( |
| ) |
|
|
virtualnoexcept |
◆ Get()
| std::decay_t< T > StormByte::Database::Value::Get |
( |
| ) |
const |
|
inline |
Stored value as T, with safe numeric conversions.
- Template Parameters
-
| T | Requested type (must be a ValuesVariant alternative). |
- Returns
- Converted value.
- Exceptions
-
◆ IsNull()
| bool StormByte::Database::Value::IsNull |
( |
| ) |
const |
|
inlinenoexcept |
Whether the value is SQL NULL.
- Returns
- true if NULL.
◆ operator!=()
| bool StormByte::Database::Value::operator!= |
( |
const Value & |
other | ) |
const |
|
inlinenoexcept |
Inequality.
- Parameters
-
- Returns
- true if not equal.
◆ operator=() [1/2]
| Value & StormByte::Database::Value::operator= |
( |
const Value & |
other | ) |
|
◆ operator=() [2/2]
| Value & StormByte::Database::Value::operator= |
( |
Value && |
other | ) |
|
|
noexcept |
◆ operator==()
| bool StormByte::Database::Value::operator== |
( |
const Value & |
other | ) |
const |
|
inlinenoexcept |
Equality of the stored alternatives.
- Parameters
-
- Returns
- true if equal.
◆ Type()
Discriminator of the stored alternative.
- Returns
- Type.
The documentation for this class was generated from the following file: