18#include "pqxx/types.hxx"
37class zview :
public std::string_view
45 std::string_view{
text,
static_cast<std::size_t
>(
len)}
50 noexcept(std::string_view{
text,
static_cast<std::size_t
>(
len)})) :
51 std::string_view{
text,
static_cast<std::size_t
>(
len)}
56 std::string_view{
other}
62 template<
typename...
Args>
64 std::string_view(std::forward<
Args>(
args)...)
70 std::string_view{str.c_str(), str.size()}
78 constexpr zview(
char const str[])
noexcept(
noexcept(std::string_view{str})) :
111constexpr zview operator"" _zv(
char const str[], std::size_t
len)
noexcept
118#if defined(PQXX_HAVE_CONCEPTS)
120template<>
inline constexpr bool std::ranges::enable_view<pqxx::zview>{
true};
125inline constexpr bool std::ranges::enable_borrowed_range<pqxx::zview>{
true};
135concept ZString = std::is_convertible_v<strip_t<T>,
char const *>
or
136 std::is_convertible_v<strip_t<T>, zview>
or
137 std::is_convertible_v<T, std::string const &>;
145inline constexpr char const *
as_c_string(
char const str[])
noexcept
150template<std::
size_t N>
The home of all libpqxx classes, functions, templates, etc.
Definition array.hxx:33
constexpr char array_separator
Element separator between SQL array elements of this type.
Definition strconv.hxx:557
Internal items for libpqxx' own use. Do not use these yourself.
Definition composite.hxx:84
constexpr char const * as_c_string(char const str[]) noexcept
Get a raw C string pointer.
Definition zview.hxx:145
Marker-type wrapper: zero-terminated std::string_view.
Definition zview.hxx:38
constexpr zview(char const (&literal)[size])
Construct a zview from a string literal.
Definition zview.hxx:92
constexpr char const * c_str() const &noexcept
Either a null pointer, or a zero-terminated text buffer.
Definition zview.hxx:96
constexpr zview(Args &&...args)
Construct from any initialiser you might use for std::string_view.
Definition zview.hxx:63
constexpr zview(char text[], std::ptrdiff_t len) noexcept(noexcept(std::string_view{text, static_cast< std::size_t >(len)}))
Convenience overload: construct using pointer and signed length.
Definition zview.hxx:49
constexpr zview() noexcept=default
constexpr zview(char const str[]) noexcept(noexcept(std::string_view{str}))
Construct a zview from a C-style string.
Definition zview.hxx:78
constexpr zview(std::string_view other) noexcept
Explicitly promote a string_view to a zview.
Definition zview.hxx:55
zview(std::string const &str) noexcept
Definition zview.hxx:69