libpqxx
The C++ client library for PostgreSQL
Loading...
Searching...
No Matches
conversions.hxx File Reference
#include <array>
#include <cstring>
#include <map>
#include <memory>
#include <numeric>
#include <optional>
#include <type_traits>
#include <variant>
#include <vector>
#include "pqxx/types.hxx"
#include "pqxx/util.hxx"

Go to the source code of this file.

Classes

struct  pqxx::internal::disallowed_ambiguous_char_conversion< CHAR_TYPE >
 Deliberately nonfunctional conversion traits for char types. More...
struct  pqxx::internal::integral_traits< T >
 String traits for builtin integral types (though not bool). More...
struct  pqxx::internal::float_traits< T >
 String traits for builtin floating-point types. More...
struct  pqxx::nullness< T, std::enable_if_t< std::is_arithmetic_v< T > > >
 The built-in arithmetic types do not have inherent null values. More...
struct  pqxx::string_traits< short >
struct  pqxx::string_traits< unsigned short >
struct  pqxx::string_traits< int >
struct  pqxx::string_traits< unsigned >
struct  pqxx::string_traits< long >
struct  pqxx::string_traits< unsigned long >
struct  pqxx::string_traits< long long >
struct  pqxx::string_traits< unsigned long long >
struct  pqxx::string_traits< float >
struct  pqxx::string_traits< double >
struct  pqxx::string_traits< long double >
struct  pqxx::string_traits< bool >
struct  pqxx::nullness< std::optional< T > >
struct  pqxx::string_traits< std::optional< T > >
struct  pqxx::nullness< std::variant< T... > >
struct  pqxx::string_traits< std::variant< T... > >
struct  pqxx::string_traits< std::nullptr_t >
struct  pqxx::string_traits< std::nullopt_t >
struct  pqxx::string_traits< std::monostate >
struct  pqxx::nullness< char const * >
struct  pqxx::string_traits< char const * >
 String traits for C-style string ("pointer to char const"). More...
struct  pqxx::nullness< char * >
struct  pqxx::string_traits< char * >
 String traits for non-const C-style string ("pointer to char"). More...
struct  pqxx::nullness< char[N]>
struct  pqxx::string_traits< char[N]>
 String traits for C-style string constant ("pointer to array of char"). More...
struct  pqxx::nullness< std::string >
struct  pqxx::string_traits< std::string >
struct  pqxx::nullness< std::string_view >
 There's no real null for std::string_view. More...
struct  pqxx::string_traits< std::string_view >
 String traits for string_view. More...
struct  pqxx::nullness< zview >
struct  pqxx::string_traits< zview >
 String traits for zview. More...
struct  pqxx::nullness< std::stringstream >
struct  pqxx::string_traits< std::stringstream >
struct  pqxx::nullness< std::nullptr_t >
struct  pqxx::nullness< std::nullopt_t >
struct  pqxx::nullness< std::monostate >
struct  pqxx::nullness< std::unique_ptr< T > >
struct  pqxx::string_traits< std::unique_ptr< T, Args... > >
struct  pqxx::nullness< std::shared_ptr< T > >
struct  pqxx::string_traits< std::shared_ptr< T > >
struct  pqxx::nullness< bytes >
struct  pqxx::string_traits< bytes >
struct  pqxx::nullness< bytes_view >
struct  pqxx::string_traits< bytes_view >
struct  pqxx::internal::array_string_traits< Container >
 String traits for SQL arrays. More...
struct  pqxx::nullness< std::vector< T, Args... > >
struct  pqxx::string_traits< std::vector< T, Args... > >
struct  pqxx::nullness< std::array< T, N > >
struct  pqxx::string_traits< std::array< T, N > >

Namespaces

namespace  pqxx
 The home of all libpqxx classes, functions, templates, etc.
namespace  pqxx::internal
 Internal items for libpqxx' own use. Do not use these yourself.

Functions

constexpr char pqxx::internal::number_to_digit (int i) noexcept
 Convert a number in [0, 9] to its ASCII digit.
constexpr int pqxx::internal::digit_to_number (char c) noexcept
 Compute numeric value of given textual digit (assuming that it is a digit).
std::string pqxx::internal::state_buffer_overrun (int have_bytes, int need_bytes)
 Summarize buffer overrun.
template<typename HAVE, typename NEED>
std::string pqxx::internal::state_buffer_overrun (HAVE have_bytes, NEED need_bytes)
void pqxx::internal::throw_null_conversion (std::string const &type)
 Throw exception for attempt to convert SQL NULL to given type.
void pqxx::internal::throw_null_conversion (std::string_view type)
 Throw exception for attempt to convert SQL NULL to given type.
template<typename T>
PQXX_LIBEXPORT std::string pqxx::internal::to_string_float (T)
 Floating-point implementations for pqxx::to_string().
template<typename T>
char * pqxx::internal::generic_into_buf (char *begin, char *end, T const &value)
 Generic implementation for into_buf, on top of to_buf.
template<typename T>
constexpr format pqxx::param_format (std::optional< T > const &value)
template<typename... Args>
constexpr format pqxx::param_format (std::variant< Args... > const &value)
template<typename T>
pqxx::from_string (std::stringstream const &text)
template<typename T, typename... Args>
format pqxx::param_format (std::unique_ptr< T, Args... > const &value)
template<typename T>
format pqxx::param_format (std::shared_ptr< T > const &value)
template<>
constexpr format pqxx::param_format (bytes const &)
template<>
constexpr format pqxx::param_format (bytes_view const &)
template<typename T, typename... Args>
constexpr format pqxx::param_format (std::vector< T, Args... > const &)
 We don't know how to pass array params in binary format, so pass as text.
template<typename... Args>
constexpr format pqxx::param_format (std::vector< std::byte, Args... > const &)
 A std::vector<std::byte> is a binary string. Other vectors are not.
template<typename T, typename... Args, Args... args>
constexpr format pqxx::param_format (std::array< T, args... > const &)
 We don't know how to pass array params in binary format, so pass as text.
template<typename... Args, Args... args>
constexpr format pqxx::param_format (std::array< std::byte, args... > const &)
 An array of std::byte is a binary string.
template<typename T>
std::string pqxx::to_string (T const &value)
template<>
std::string pqxx::to_string (float const &value)
template<>
std::string pqxx::to_string (double const &value)
template<>
std::string pqxx::to_string (long double const &value)
template<>
std::string pqxx::to_string (std::stringstream const &value)
template<typename T>
void pqxx::into_string (T const &value, std::string &out)

Variables

template<>
constexpr bool pqxx::is_unquoted_safe< short > {true}
template<>
constexpr bool pqxx::is_unquoted_safe< unsigned short > {true}
template<>
constexpr bool pqxx::is_unquoted_safe< int > {true}
template<>
constexpr bool pqxx::is_unquoted_safe< unsigned > {true}
template<>
constexpr bool pqxx::is_unquoted_safe< long > {true}
template<>
constexpr bool pqxx::is_unquoted_safe< unsigned long > {true}
template<>
constexpr bool pqxx::is_unquoted_safe< long long > {true}
template<>
constexpr bool pqxx::is_unquoted_safe< unsigned long long > {true}
template<>
constexpr bool pqxx::is_unquoted_safe< float > {true}
template<>
constexpr bool pqxx::is_unquoted_safe< double > {true}
template<>
constexpr bool pqxx::is_unquoted_safe< long double > {true}
template<>
constexpr bool pqxx::is_unquoted_safe< bool > {true}
template<typename T>
constexpr bool pqxx::is_unquoted_safe< std::optional< T > > {is_unquoted_safe<T>}
template<typename... T>
constexpr bool pqxx::is_unquoted_safe< std::variant< T... > >
template<>
constexpr bool pqxx::is_unquoted_safe< std::nullptr_t > {true}
template<typename T, typename... Args>
constexpr bool pqxx::is_unquoted_safe< std::unique_ptr< T, Args... > >
template<typename T>
constexpr bool pqxx::is_unquoted_safe< std::shared_ptr< T > >
template<typename T>
constexpr bool pqxx::is_sql_array< std::vector< T > > {true}
template<typename T, std::size_t N>
constexpr bool pqxx::is_sql_array< std::array< T, N > > {true}