libpqxx
The C++ client library for PostgreSQL
pqxx::string_traits< char * > Struct Referencefinal

String traits for non-const C-style string ("pointer to char"). More...

#include <conversions.hxx>

Static Public Member Functions

static std::string_view to_buf (std::span< char > buf, char *const &value, ctx c={})
 
static std::size_t size_buffer (char *const &value) noexcept
 
static char * from_string (std::string_view, ctx={})=delete
 

Detailed Description

String traits for non-const C-style string ("pointer to char").

This conversion is not bidirectional. You can convert a char * to an SQL string, but not vice versa.

There are two reasons. One is the fact that an SQL string arrives in the form of a std::string_view; there is no guarantee of a trailing zero.

The other reason is constness. We can't give you a non-const pointer into a string that was handed into the conversion as const.

Member Function Documentation

◆ from_string()

static char* pqxx::string_traits< char * >::from_string ( std::string_view  ,
ctx  = {} 
)
staticdelete

◆ size_buffer()

static std::size_t pqxx::string_traits< char * >::size_buffer ( char *const &  value)
inlinestaticnoexcept

◆ to_buf()

static std::string_view pqxx::string_traits< char * >::to_buf ( std::span< char >  buf,
char *const &  value,
ctx  c = {} 
)
inlinestatic

The documentation for this struct was generated from the following file: