24#if defined(__cpp_lib_format)
137 template <std::ranges::sized_range T>
161 template <
class U =
typename L::inner_value_type>
162 requires std::assignable_from<U&, const char*>
183 [[nodiscard]]
constexpr bool empty()
const;
258 template <std::ranges::input_range T>
277 template <
class U =
typename L::inner_value_type>
278 requires std::assignable_from<U&, const char*>
294 template <std::ranges::input_range T>
313 template <
class U =
typename L::inner_value_type>
314 requires std::assignable_from<U&, const char*>
341 L* p_layout =
nullptr;
348 template <
typename Layout,
template <
typename>
typename TQual,
template <
typename>
typename UQual>
349 struct basic_common_reference<
sparrow::variable_size_binary_reference<Layout>, std::string, TQual, UQual>
354 template <
typename Layout,
template <
typename>
typename TQual,
template <
class>
class UQual>
360 template <
typename Layout,
template <
typename>
typename TQual,
template <
typename>
typename UQual>
361 struct basic_common_reference<
sparrow::variable_size_binary_reference<Layout>, std::vector<std::byte>, TQual, UQual>
363 using type = std::vector<std::byte>;
366 template <
typename Layout,
template <
typename>
typename TQual,
template <
class>
class UQual>
369 using type = std::vector<std::byte>;
387 template <std::ranges::sized_range T>
391 p_layout->assign(std::forward<T>(rhs), m_index);
392 p_layout->get_arrow_proxy().update_buffers();
398 requires std::assignable_from<U&, const char*>
401 return *
this = std::string_view(rhs);
407 return static_cast<size_type>(offset(m_index + 1) - offset(m_index));
419 return iterator(p_layout->data(uoffset(m_index)));
425 return iterator(p_layout->data(uoffset(m_index + 1)));
453 template <std::ranges::input_range T>
457 return std::equal(
cbegin(),
cend(), std::cbegin(rhs), std::cend(rhs));
462 requires std::assignable_from<U&, const char*>
469 template <std::ranges::input_range T>
473 return lexicographical_compare_three_way(*
this, rhs);
478 requires std::assignable_from<U&, const char*>
485 constexpr auto variable_size_binary_reference<L>::offset(size_type index)
const -> offset_type
487 return *(p_layout->offset(index));
491 constexpr auto variable_size_binary_reference<L>::uoffset(size_type index)
const -> size_type
493 return static_cast<size_type
>(offset(index));
497#if defined(__cpp_lib_format)
499template <
typename Layout>
500struct std::formatter<
sparrow::variable_size_binary_reference<Layout>>
502 constexpr auto parse(std::format_parse_context& ctx)
507 auto format(
const sparrow::variable_size_binary_reference<Layout>& ref, std::format_context& ctx)
const
512 [&ctx](
const auto& value)
514 std::format_to(ctx.out(),
"{}, ", value);
518 return std::format_to(ctx.out(),
"{}>", *std::prev(ref.
cend()));
524 template <
typename Layout>
527 os << std::format(
"{}", value);
constexpr iterator end()
Gets mutable iterator to the end of binary data.
std::ptrdiff_t difference_type
constexpr const_iterator cbegin() const
Gets const iterator to the beginning of binary data.
constexpr bool operator==(const T &rhs) const
Equality comparison with another range of binary data.
typename L::size_type size_type
typename L::data_iterator iterator
typename L::inner_const_reference const_reference
constexpr variable_size_binary_reference(L *layout, size_type index)
Constructs a variable-size binary reference for the given layout and index.
variable_size_binary_reference< L > self_type
typename L::const_data_iterator const_iterator
constexpr self_type & operator=(T &&rhs)
Assignment from a sized range of binary data.
constexpr const_iterator cend() const
Gets const iterator to the end of binary data.
typename L::inner_value_type value_type
typename L::offset_type offset_type
constexpr bool empty() const
Checks if the binary element is empty.
constexpr const_iterator begin() const
Gets const iterator to the beginning of binary data.
constexpr const_iterator end() const
Gets const iterator to the end of binary data.
typename L::inner_reference reference
constexpr self_type & operator=(const char *rhs)
Assignment from a C-string.
constexpr iterator begin()
Gets mutable iterator to the beginning of binary data.
constexpr variable_size_binary_reference(const variable_size_binary_reference &)=default
constexpr variable_size_binary_reference(variable_size_binary_reference &&)=default
constexpr auto operator<=>(const char *rhs) const
Three-way comparison with a C-string.
constexpr auto operator<=>(const T &rhs) const
Three-way comparison with another range of binary data.
constexpr bool operator==(const char *rhs) const
Equality comparison with a C-string.
constexpr size_type size() const
Gets the size of the binary element in bytes/characters.
Concept for convertible range types.
constexpr std::compare_three_way_result_t< typename cloning_ptr< T1 >::pointer, typename cloning_ptr< T2 >::pointer > operator<=>(const cloning_ptr< T1 > &lhs, const cloning_ptr< T2 > &rhs) noexcept
SPARROW_API bool operator==(const array &lhs, const array &rhs)
Compares the content of two arrays.
constexpr InputIt next(InputIt it, Distance n)
std::ostream & operator<<(std::ostream &os, const nullval_t &)
std::vector< std::byte > type
std::vector< std::byte > type