11 #ifndef PQXX_H_BINARYSTRING 12 #define PQXX_H_BINARYSTRING 14 #include "pqxx/compiler-public.hxx" 15 #include "pqxx/compiler-internal-pre.hxx" 20 #include "pqxx/result.hxx" 57 using value_type = std::char_traits<char_type>::char_type;
83 bool empty() const noexcept {
return size()==0; }
92 {
return *(data()+m_size-1); }
105 {
return data()[i]; }
107 PQXX_PURE
bool operator==(
const binarystring &)
const noexcept;
109 {
return !operator==(rhs); }
123 const char *
get()
const noexcept
124 {
return reinterpret_cast<const char *
>(m_buf.get()); }
133 std::string str()
const;
136 using smart_pointer_type = std::shared_ptr<value_type>;
139 static smart_pointer_type make_smart_pointer(
unsigned char *buf=
nullptr)
141 return smart_pointer_type(
143 internal::freemallocmem_templated<unsigned char>);
146 smart_pointer_type m_buf;
151 #include "pqxx/compiler-internal-post.hxx" const_reverse_iterator rbegin() const
Definition: binarystring.hxx:94
Binary data corresponding to PostgreSQL's "BYTEA" binary-string type.
Definition: binarystring.hxx:53
const_pointer const_iterator
Definition: binarystring.hxx:62
size_type length() const noexcept
Size of converted string in bytes.
Definition: binarystring.hxx:82
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: binarystring.hxx:63
bool empty() const noexcept
Definition: binarystring.hxx:83
const_iterator begin() const noexcept
Definition: binarystring.hxx:85
The home of all libpqxx classes, functions, templates, etc.
Definition: array.hxx:22
const_reference operator[](size_type i) const noexcept
Definition: binarystring.hxx:104
const value_type * const_pointer
Definition: binarystring.hxx:61
std::char_traits< char_type >::char_type value_type
Definition: binarystring.hxx:57
const_reference front() const noexcept
Definition: binarystring.hxx:90
const_reference back() const noexcept
Definition: binarystring.hxx:91
long difference_type
Definition: binarystring.hxx:59
const_iterator cend() const noexcept
Definition: binarystring.hxx:88
const value_type * data() const noexcept
Unescaped field contents.
Definition: binarystring.hxx:102
size_t size_type
Definition: binarystring.hxx:58
size_type size() const noexcept
Size of converted string in bytes.
Definition: binarystring.hxx:80
bool operator!=(const binarystring &rhs) const noexcept
Definition: binarystring.hxx:108
const value_type & const_reference
Definition: binarystring.hxx:60
const_reverse_iterator crend() const
Definition: binarystring.hxx:99
unsigned char char_type
Definition: binarystring.hxx:56
const_reverse_iterator rend() const
Definition: binarystring.hxx:97
const_reverse_iterator crbegin() const
Definition: binarystring.hxx:96
const_iterator end() const noexcept
Definition: binarystring.hxx:87
const_iterator cbegin() const noexcept
Definition: binarystring.hxx:86
Reference to a field in a result set.
Definition: field.hxx:41