libpqxx
The C++ client library for PostgreSQL
pqxx::string_traits< std::string_view > Struct Referencefinal

String traits for string_view. More...

#include <conversions.hxx>

Static Public Member Functions

static constexpr PQXX_INLINE_ONLY std::size_t size_buffer (std::string_view const &value) noexcept
 
static PQXX_INLINE_ONLY std::string_view to_buf (std::span< char >, std::string_view const &value, ctx={})
 
static PQXX_INLINE_ONLY std::string_view from_string (std::string_view value, ctx={})
 

Detailed Description

String traits for string_view.

Warning
This conversion does not store the string's contents anywhere. When you convert a string to a std::string_view, _do not access the resulting view after the original string has been destroyed. The contents will no longer be valid, even though tests may not make this obvious.

Member Function Documentation

◆ from_string()

static PQXX_INLINE_ONLY std::string_view pqxx::string_traits< std::string_view >::from_string ( std::string_view  value,
ctx  = {} 
)
inlinestatic

◆ size_buffer()

static constexpr PQXX_INLINE_ONLY std::size_t pqxx::string_traits< std::string_view >::size_buffer ( std::string_view const &  value)
inlinestaticconstexprnoexcept

◆ to_buf()

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

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