Hyper API for C++ 0.0.20746
Hyper client library for C++ applications
|
A value inside a row. More...
#include <Result.hpp>
Public Member Functions | |
Value (hyper_value_t value, SqlType type, string_view columnName) noexcept | |
Constructs a Value object. | |
Value () noexcept | |
Default constructs a Value object. | |
template<typename ReturnType > | |
operator ReturnType () const | |
Cast the value to one of the supported types. | |
template<typename ReturnType > | |
ReturnType | get () const |
Get the value as one of the supported types. | |
SqlType | getType () const noexcept |
Get the type of the value. | |
bool | isNull () const noexcept |
Returns whether the value is null. | |
A value inside a row.
This class implicitly casts to all supported types.
Definition at line 44 of file Result.hpp.
|
inlinenoexcept |
Constructs a Value object.
Definition at line 47 of file Result.hpp.
|
inlinenoexcept |
Default constructs a Value object.
Definition at line 52 of file Result.hpp.
ReturnType hyperapi::Value::get | ( | ) | const |
Get the value as one of the supported types.
If the value is nullable, retrieve optional<Type> instead.
The following types are supported: short int long long long bool float double long double hyperapi::Numeric<precision, scale> uint32_t hyperapi::string_view // Attention: A string_view does not own its memory, so it will become invalid if the result or row go out of scope. Use std::string instead. std::string ByteSpan // Attention: A ByteSpan does not own its memory, so it will become invalid if the result or row go out of scope. Use vector<const uint8_t> instead. std::vector<uint8_t> hyperapi::Interval hyperapi::Date hyperapi::Time hyperapi::Timestamp hyperapi::OffsetTimestamp
|
inlinenoexcept |
Get the type of the value.
Definition at line 92 of file Result.hpp.
|
inlinenoexcept |
Returns whether the value is null.
Definition at line 95 of file Result.hpp.
|
inline |
Cast the value to one of the supported types.
If the value is nullable, retrieve optional<Type> instead.
The following types are supported: short int long long long bool float double long double hyperapi::Numeric<precision, scale> uint32_t hyperapi::string_view // Attention: A string_view does not own its memory, so it will become invalid if the result or row go out of scope. Use std::string instead. std::string ByteSpan // Attention: A ByteSpan does not own its memory, so it will become invalid if the result or row go out of scope. Use vector<const uint8_t> instead. std::vector<uint8_t> hyperapi::Interval hyperapi::Date hyperapi::Time hyperapi::Timestamp hyperapi::OffsetTimestamp
Definition at line 59 of file Result.hpp.