|
static char * | into_buf (char *begin, char *end, std::variant< T... > const &value) |
|
static zview | to_buf (char *begin, char *end, std::variant< T... > const &value) |
|
static std::size_t | size_buffer (std::variant< T... > const &value) noexcept |
|
static std::variant< T... > | from_string (std::string_view)=delete |
|
static zview | to_buf (char *begin, char *end, std::variant< T... > const &value) |
| Return a string_view representing value, plus terminating zero.
|
|
static char * | into_buf (char *begin, char *end, std::variant< T... > const &value) |
| Write value's string representation into buffer at begin .
|
|
static std::variant< T... > | from_string (std::string_view text) |
| Parse a string representation of a TYPE value.
|
|
static std::size_t | size_buffer (std::variant< T... > const &value) noexcept |
| Estimate how much buffer space is needed to represent value.
|
|
◆ from_string() [1/2]
static std::variant< T... > pqxx::string_traits< std::variant< T... > >::from_string |
( |
std::string_view | text | ) |
|
|
inlinestaticnodiscard |
Parse a string representation of a TYPE
value.
Throws conversion_error
if value
does not meet the expected format for a value of this type.
- Warning
- A null value has no string representation. Do not parse a null.
◆ from_string() [2/2]
template<typename... T>
static std::variant< T... > pqxx::string_traits< std::variant< T... > >::from_string |
( |
std::string_view | | ) |
|
|
staticdelete |
There's no from_string for std::variant. We could have one with a rule like "pick the first type which fits the value," but we'd have to look into how natural that API feels to users.
◆ size_buffer()
static std::size_t pqxx::string_traits< std::variant< T... > >::size_buffer |
( |
std::variant< T... > const & | value | ) |
|
|
inlinestaticnodiscardnoexcept |
Estimate how much buffer space is needed to represent value.
The estimate may be a little pessimistic, if it saves time.
The estimate includes the terminating zero.
◆ to_buf()
static zview pqxx::string_traits< std::variant< T... > >::to_buf |
( |
char * | begin, |
|
|
char * | end, |
|
|
std::variant< T... > const & | value ) |
|
inlinestaticnodiscard |
Return a string_view
representing value, plus terminating zero.
Produces a string_view
containing the PostgreSQL string representation for value
.
- Warning
- A null value has no string representation. Do not pass a null.
Uses the space from begin
to end
as a buffer, if needed. The returned string may lie somewhere in that buffer, or it may be a compile-time constant, or it may be null if value was a null value. Even if the string is stored in the buffer, its begin()
may or may not be the same as begin
.
The string_view
is guaranteed to be valid as long as the buffer from begin
to end
remains accessible and unmodified.
- Exceptions
-
pqxx::conversion_overrun | if the provided buffer space may not be enough. For maximum performance, this is a conservative estimate. It may complain about a buffer which is actually large enough for your value, if an exact check gets too expensive. |
◆ converts_from_string
Is conversion from string_view
to TYPE
supported?
When defining your own conversions, specialise this as true
to indicate that your string traits support from_string
.
◆ converts_to_string [1/2]
Initial value:{
static constexpr bool converts_to_string
Is conversion from TYPE to strings supported?
Definition strconv.hxx:159
◆ converts_to_string [2/2]
Is conversion from TYPE
to strings supported?
When defining your own conversions, specialise this as true
to indicate that your string traits support the conversions to strings.
The documentation for this struct was generated from the following file:
- /builddir/build/BUILD/libpqxx-7.10.0-build/libpqxx-7.10.0/redhat-linux-build/include/pqxx/internal/conversions.hxx