14#include <sl3/config.hpp>
15#include <sl3/error.hpp>
16#include <sl3/types.hpp>
46 explicit
Value (
int val) noexcept;
51 explicit
Value (int64_t val) noexcept;
61 explicit
Value (const
char* val);
66 explicit
Value (
double val) noexcept;
112 Value& operator= (const int64_t& val);
117 Value& operator= (const
double& val);
135 explicit operator
int () const;
142 explicit operator int64_t () const;
151 explicit operator
double () const;
158 explicit operator const
std::
string& () const;
165 explicit operator const
Blob& () const;
172 const int64_t& int64 () const;
179 const
double& real () const;
186 const
std::
string& text () const;
212 void setNull () noexcept;
218 bool isNull () const noexcept;
225 Type getType () const noexcept;
231 friend
bool value_type_eq (const
Value& a, const
Value& b) noexcept;
232 friend
bool value_type_lt (const
Value& a, const
Value& b) noexcept;
234 friend
bool value_eq (const
Value& a, const
Value& b) noexcept;
235 friend
bool value_lt (const
Value& a, const
Value& b) noexcept;
247 Type _type{Type::Null};
This class models the duck typing sqlite uses. It supports int, real, text, blob and null values.
Definition: value.hpp:32
Value() noexcept
Constructor.
Namespace of libSL3.
Definition: columns.hpp:18
bool value_type_eq(const Value &a, const Value &b) noexcept
equality, including type info
Type
Definition: types.hpp:30
LIBSL3_API std::ostream & operator<<(std::ostream &stm, const sl3::DbValue &v)
Stream op for a DbValue.
bool value_lt(const Value &a, const Value &b) noexcept
less than, ignoring type info
bool value_type_lt(const Value &a, const Value &b) noexcept
less than, including type info
bool value_eq(const Value &a, const Value &b) noexcept
equality, ignoring type info
void swap(DbValues &a, DbValues &b) noexcept
DbValue specialized swap function.
std::vector< std::byte > Blob
Definition: types.hpp:126