Hyper API for C++
0.0.16638
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. More... | |
template<typename ReturnType > | |
ReturnType | get () const |
Get the value as one of the supported types. More... | |
SqlType | getType () const noexcept |
Get the type of the value. | |
bool | isNull () const noexcept |
Returns whether the value is null. | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Value &value) |
Stream output operator. | |
bool | operator== (const Value &lhs, const Value &rhs) noexcept |
Comparison operator. | |
bool | operator!= (const Value &lhs, const Value &rhs) noexcept |
Comparison operator. | |
A value inside a row.
This class implicitly casts to all supported types.
Definition at line 44 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 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
|
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 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.