11 #ifndef PQXX_H_BINARYSTRING 12 #define PQXX_H_BINARYSTRING 14 #include "pqxx/compiler-public.hxx" 15 #include "pqxx/internal/compiler-internal-pre.hxx" 19 #include <string_view> 21 #include "pqxx/result.hxx" 57 using value_type = std::char_traits<char_type>::char_type;
84 [[nodiscard]]
bool empty() const noexcept {
return size() == 0; }
94 return *(data() + m_size - 1);
116 [[nodiscard]] PQXX_PURE
bool operator==(
binarystring const &)
const noexcept;
119 return not operator==(rhs);
125 const_reference at(size_type)
const;
134 [[nodiscard]]
char const *
get() const noexcept
136 return reinterpret_cast<char const *>(m_buf.get());
140 [[nodiscard]] std::string_view
view() const noexcept
142 return std::string_view(get(), size());
151 [[nodiscard]] std::string str()
const;
154 std::shared_ptr<value_type> m_buf;
159 #include "pqxx/internal/compiler-internal-post.hxx" size_type size() const noexcept
Size of converted string in bytes.
Definition: binarystring.hxx:81
std::char_traits< char_type >::char_type value_type
Definition: binarystring.hxx:57
bool empty() const noexcept
Definition: binarystring.hxx:84
size_t size_type
Definition: binarystring.hxx:58
const_reference operator[](size_type i) const noexcept
Definition: binarystring.hxx:111
const_reverse_iterator rend() const
Definition: binarystring.hxx:102
const_pointer const_iterator
Definition: binarystring.hxx:62
const_iterator cbegin() const noexcept
Definition: binarystring.hxx:87
value_type const * data() const noexcept
Unescaped field contents.
Definition: binarystring.hxx:109
const_iterator end() const noexcept
Definition: binarystring.hxx:88
Reference to a field in a result set.
Definition: field.hxx:32
const_iterator begin() const noexcept
Definition: binarystring.hxx:86
value_type const & const_reference
Definition: binarystring.hxx:60
Binary data corresponding to PostgreSQL's "BYTEA" binary-string type.
Definition: binarystring.hxx:53
long difference_type
Definition: binarystring.hxx:59
value_type const * const_pointer
Definition: binarystring.hxx:61
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: binarystring.hxx:63
unsigned char char_type
Definition: binarystring.hxx:56
char const * get() const noexcept
Raw character buffer (no terminating zero is added).
Definition: binarystring.hxx:134
const_reverse_iterator rbegin() const
Definition: binarystring.hxx:97
size_type length() const noexcept
Size of converted string in bytes.
Definition: binarystring.hxx:83
Dedicated namespace for helper types related to prepared statements.
Definition: array.hxx:25
const_reference front() const noexcept
Definition: binarystring.hxx:91
bool operator!=(binarystring const &rhs) const noexcept
Definition: binarystring.hxx:117
const_reverse_iterator crend() const
Definition: binarystring.hxx:106
const_iterator cend() const noexcept
Definition: binarystring.hxx:89
std::string_view view() const noexcept
Read contents as a std::string_view.
Definition: binarystring.hxx:140
const_reverse_iterator crbegin() const
Definition: binarystring.hxx:101
const_reference back() const noexcept
Definition: binarystring.hxx:92