A typed option value wrapper. It currently does not attempt conversion (i.e., getting a double option as a string).
More...
#include <base_driver.h>
|
using | Value = std::variant<Unset, std::string, std::vector<uint8_t>, int64_t, double> |
| The possible values of an option.
|
|
|
| Option (const char *value) |
| Construct an option from a C string. NULL strings are treated as unset.
|
|
| Option (std::string value) |
|
| Option (std::vector< uint8_t > value) |
|
| Option (double value) |
|
| Option (int64_t value) |
|
const Value & | value () const & |
|
Value & | value () && |
|
bool | has_value () const |
| Check whether this option is set.
|
|
Result< bool > | AsBool () const |
| Try to parse a string value as a boolean.
|
|
Result< int64_t > | AsInt () const |
| Try to parse a string or integer value as an integer.
|
|
Result< std::string_view > | AsString () const |
| Get the value if it is a string.
|
|
std::string | Format () const |
| Provide a human-readable summary of the value.
|
|
A typed option value wrapper. It currently does not attempt conversion (i.e., getting a double option as a string).
◆ Value
The possible values of an option.
◆ Option()
adbc::driver::Option::Option |
( |
const char * | value | ) |
|
|
inlineexplicit |
Construct an option from a C string. NULL strings are treated as unset.
◆ AsBool()
Result< bool > adbc::driver::Option::AsBool |
( |
| ) |
const |
|
inline |
Try to parse a string value as a boolean.
◆ AsInt()
Result< int64_t > adbc::driver::Option::AsInt |
( |
| ) |
const |
|
inline |
Try to parse a string or integer value as an integer.
◆ AsString()
Result< std::string_view > adbc::driver::Option::AsString |
( |
| ) |
const |
|
inline |
Get the value if it is a string.
◆ Format()
std::string adbc::driver::Option::Format |
( |
| ) |
const |
|
inline |
Provide a human-readable summary of the value.
◆ has_value()
bool adbc::driver::Option::has_value |
( |
| ) |
const |
|
inline |
Check whether this option is set.
The documentation for this class was generated from the following file: