StormByte-Database 3.0.0
C++26 database module of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Database::NamedValue Class Reference

Value plus column name. More...

#include <StormByte/database/named_value.hxx>

Inheritance diagram for StormByte::Database::NamedValue:
Collaboration diagram for StormByte::Database::NamedValue:

Public Member Functions

 NamedValue ()
 Construct an unnamed SQL NULL column value.
 NamedValue (std::string_view name, const Value &value)
 Copy name and value.
 NamedValue (std::string_view name, Value &&value)
 Move name and value.
 NamedValue (const NamedValue &other)
 Copy constructor.
 NamedValue (NamedValue &&other) noexcept
 Move constructor.
 ~NamedValue () noexcept override
 Destructor.
NamedValue & operator= (const NamedValue &other)
 Copy assignment.
NamedValue & operator= (NamedValue &&other) noexcept
 Move assignment.
bool operator== (const NamedValue &other) const noexcept
 Equality (name and value).
bool operator!= (const NamedValue &other) const noexcept
 Inequality.
std::string_view Name () const noexcept
 Column name.
Public Member Functions inherited from StormByte::Database::Value
 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
 Equality of the stored alternatives.
bool operator!= (const Value &other) const
 Inequality.
virtual ~Value () noexcept
 Destructor.
template<typename T>
requires (ValuesVariant::AlternativeIndex<std::decay_t<T>>() != ValuesVariant::npos)
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 ()
 Default constructor.
 Value (int value)
 From a signed int.
 Value (unsigned int value)
 From an unsigned int.
 Value (long int value)
 From a signed long int, stored as long long int.
 Value (unsigned long int value)
 From an unsigned long int, stored as unsigned long long int.
 Value (long long int value)
 From a signed long long int.
 Value (unsigned long long int value)
 From an unsigned long long int.
 Value (double value)
 From a double.
 Value (std::string_view value)
 Copy UTF-8 text into a String-owned value.
 Value (const StormByte::Safe::Binary &value)
 Copy a blob into Base-owned storage.
 Value (StormByte::Safe::Binary &&value)
 Move a blob into this value.
template<typename T>
requires StormByte::Type::SameAs<std::remove_cvref_t<T>, bool>
 Value (T &&value)
 From a bool.

Additional Inherited Members

Public Types inherited from StormByte::Database::Value
enum class  Type : unsigned short {
  Null = 0 , Integer , UnsignedInteger , LongInteger ,
  UnsignedLongInteger , Double , Text , Blob ,
  Boolean
}
 Discriminator for the stored alternative. More...

Detailed Description

Value plus column name.

Constructor & Destructor Documentation

◆ NamedValue() [1/5]

StormByte::Database::NamedValue::NamedValue ( )

Construct an unnamed SQL NULL column value.

◆ NamedValue() [2/5]

StormByte::Database::NamedValue::NamedValue ( std::string_view name,
const Value & value )

Copy name and value.

Parameters
nameColumn name.
valueValue.

◆ NamedValue() [3/5]

StormByte::Database::NamedValue::NamedValue ( std::string_view name,
Value && value )

Move name and value.

Parameters
nameColumn name.
valueValue.

◆ NamedValue() [4/5]

StormByte::Database::NamedValue::NamedValue ( const NamedValue & other)

Copy constructor.

◆ NamedValue() [5/5]

StormByte::Database::NamedValue::NamedValue ( NamedValue && other)
noexcept

Move constructor.

◆ ~NamedValue()

StormByte::Database::NamedValue::~NamedValue ( )
overridenoexcept

Destructor.

Member Function Documentation

◆ Name()

std::string_view StormByte::Database::NamedValue::Name ( ) const
inlinenoexcept

Column name.

Returns
Name.

◆ operator!=()

bool StormByte::Database::NamedValue::operator!= ( const NamedValue & other) const
inlinenoexcept

Inequality.

Parameters
otherOther value.
Returns
true if not equal.

◆ operator=() [1/2]

NamedValue & StormByte::Database::NamedValue::operator= ( const NamedValue & other)

Copy assignment.

◆ operator=() [2/2]

NamedValue & StormByte::Database::NamedValue::operator= ( NamedValue && other)
noexcept

Move assignment.

◆ operator==()

bool StormByte::Database::NamedValue::operator== ( const NamedValue & other) const
inlinenoexcept

Equality (name and value).

Parameters
otherOther value.
Returns
true if equal.

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