StormByte-Database 2.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 (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 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.
 

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/4]

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

Copy name and value.

Parameters
nameColumn name.
valueValue.

◆ NamedValue() [2/4]

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

Move name and value.

Parameters
nameColumn name.
valueValue.

◆ NamedValue() [3/4]

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

Copy constructor.

◆ NamedValue() [4/4]

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: