PrevUpHomeNext

Struct template basic_unencoded_rope

boost::text::basic_unencoded_rope

Synopsis

// In header: <boost/text/unencoded_rope.hpp>

template<typename Char, typename String> 
struct basic_unencoded_rope : public boost::stl_interfaces::sequence_container_interface< basic_unencoded_rope< Char, String >, boost::stl_interfaces::element_layout::discontiguous >
{
  // types
  typedef Char                                                                                                                                              value_type;            
  typedef value_type *                                                                                                                                      pointer;               
  typedef value_type const *                                                                                                                                const_pointer;         
  typedef value_type const &                                                                                                                                reference;             
  typedef reference                                                                                                                                         const_reference;       
  typedef std::size_t                                                                                                                                       size_type;             
  typedef std::ptrdiff_t                                                                                                                                    difference_type;       
  typedef unspecified                                                                                                                                       iterator;              
  typedef iterator                                                                                                                                          const_iterator;        
  typedef stl_interfaces::reverse_iterator< iterator >                                                                                                      reverse_iterator;      
  typedef reverse_iterator                                                                                                                                  const_reverse_iterator;
  typedef String                                                                                                                                            string;                
  typedef basic_string_view< Char >                                                                                                                         string_view;           
  typedef basic_unencoded_rope_view< value_type, string >                                                                                                   unencoded_rope_view;   
  typedef boost::stl_interfaces::sequence_container_interface< basic_unencoded_rope< Char, String >, boost::stl_interfaces::element_layout::discontiguous > base_type;             

  // construct/copy/destruct
  basic_unencoded_rope();
  basic_unencoded_rope(basic_unencoded_rope const &) = default;
  basic_unencoded_rope(basic_unencoded_rope &&);
  basic_unencoded_rope(value_type const *);
  explicit basic_unencoded_rope(unencoded_rope_view);
  explicit basic_unencoded_rope(string &&);
  template<std::ranges::range R> explicit basic_unencoded_rope(R const &);
  template<std::input_iterator I, std::sentinel_for< I > S> 
    basic_unencoded_rope(I, S);
  basic_unencoded_rope & operator=(basic_unencoded_rope const &) = default;
  basic_unencoded_rope & operator=(basic_unencoded_rope &&);
  basic_unencoded_rope & operator=(unencoded_rope_view);
  basic_unencoded_rope & operator=(string);
  basic_unencoded_rope & operator=(value_type const *);

  // public member functions
  const_iterator begin();
  const_iterator end();
  size_type max_size() const;
  template<typename... Args> const_reference emplace_front(Args &&...);
  template<typename... Args> const_reference emplace_back(Args &&...);
  template<typename... Args> 
    const_iterator emplace(const_iterator, Args &&...);
  unencoded_rope_view operator()(std::ptrdiff_t, std::ptrdiff_t) const;
  int compare(basic_unencoded_rope) const;
  operator unencoded_rope_view() const;
  basic_unencoded_rope & erase(const_iterator, const_iterator);
  basic_unencoded_rope & erase(unencoded_rope_view);
  basic_unencoded_rope & 
  replace(const_iterator, const_iterator, value_type const *);
  basic_unencoded_rope & 
  replace(const_iterator, const_iterator, unencoded_rope_view);
  basic_unencoded_rope & replace(const_iterator, const_iterator, string &&);
  template<std::ranges::range R> 
    basic_unencoded_rope & replace(const_iterator, const_iterator, R const &);
  template<std::input_iterator I, std::sentinel_for< I > S> 
    basic_unencoded_rope & replace(const_iterator, const_iterator, I, S);
  template<typename R> auto replace(unencoded_rope_view const &, R &&);
  template<std::input_iterator I, std::sentinel_for< I > S> 
    auto replace(unencoded_rope_view const &, I, S);
  template<typename R> auto insert(const_iterator, R &&);
  template<std::input_iterator I, std::sentinel_for< I > S> 
    auto insert(const_iterator, I, S);
  template<typename T> auto operator+=(T &&);
  void swap(basic_unencoded_rope &);
  bool equal_root(basic_unencoded_rope) const;

  // friend functions
  std::ostream & operator<<(std::ostream &, basic_unencoded_rope);
};

Description

A mutable sequence of Char with copy-on-write semantics, and very cheap mutations at any point in the sequence (beginning, middle, or end). A basic_unencoded_rope is non-contiguous and is not null-terminated.

basic_unencoded_rope public types

  1. typedef basic_unencoded_rope_view< value_type, string > unencoded_rope_view;

    The specialization of unencoded_rope_view with the same value_type and string.

basic_unencoded_rope public construct/copy/destruct

  1. basic_unencoded_rope();

    Default ctor.

    Postconditions:

    size() == 0 && begin() == end()

  2. basic_unencoded_rope(basic_unencoded_rope const &) = default;
  3. basic_unencoded_rope(basic_unencoded_rope &&);
  4. basic_unencoded_rope(value_type const * c_str);

    Constructs a basic_unencoded_rope from a null-terminated string.

  5. explicit basic_unencoded_rope(unencoded_rope_view rv);

    Constructs a basic_unencoded_rope from a basic_unencoded_rope_view.

  6. explicit basic_unencoded_rope(string && s);

    Move-constructs a basic_unencoded_rope from a string.

  7. template<std::ranges::range R> explicit basic_unencoded_rope(R const & r);

    Constructs a basic_unencoded_rope from a range of value_type elements.

  8. template<std::input_iterator I, std::sentinel_for< I > S> 
      basic_unencoded_rope(I first, S last);

    Constructs a basic_unencoded_rope from a sequence of value_type.

  9. basic_unencoded_rope & operator=(basic_unencoded_rope const &) = default;
  10. basic_unencoded_rope & operator=(basic_unencoded_rope &&);
  11. basic_unencoded_rope & operator=(unencoded_rope_view rv);

    Assignment from a basic_unencoded_rope_view.

  12. basic_unencoded_rope & operator=(string s);

    Move-assignment from a string.

  13. basic_unencoded_rope & operator=(value_type const * c_str);

    Assignment from a null-terminated string.

basic_unencoded_rope public member functions

  1. const_iterator begin();
  2. const_iterator end();
  3. size_type max_size() const;
  4. template<typename... Args> const_reference emplace_front(Args &&... args);
  5. template<typename... Args> const_reference emplace_back(Args &&... args);
  6. template<typename... Args> 
      const_iterator emplace(const_iterator at, Args &&... args);
  7. unencoded_rope_view operator()(std::ptrdiff_t lo, std::ptrdiff_t hi) const;

    Returns a substring of *this as an unencoded_rope_view, comprising the elements at offsets [lo, hi). If either of lo or hi is a negative value x, x is taken to be an offset from the end, and so x + size() is used instead.

    These preconditions apply to the values used after size() is added to any negative arguments.

    Requires:

    0 <= lo && lo <= size()

    Requires:

    0 <= hi && lhi <= size()

    Requires:

    lo <= hi

  8. int compare(basic_unencoded_rope rhs) const;

    Lexicographical compare. Returns a value < 0 when *this is lexicographically less than rhs,0if*this == rhs, and a value> 0if*thisis lexicographically greater thanrhs`.

  9. operator unencoded_rope_view() const;
  10. basic_unencoded_rope & erase(const_iterator first, const_iterator last);

    Erases the portion of *this delimited by [first, last).

    Requires:

    rv.begin() <= rv.begin() && rv.end() <= end()

  11. basic_unencoded_rope & erase(unencoded_rope_view rv);

    Erases the portion of *this delimited by rv.

    Requires:

    rv.begin() <= rv.begin() && rv.end() <= end()

  12. basic_unencoded_rope & 
    replace(const_iterator first, const_iterator last, value_type const * c_str);

    Replaces the portion of *this delimited by [first, last) with c_str.

    Requires:

    begin() <= old_substr.begin() && old_substr.end() <= end()

  13. basic_unencoded_rope & 
    replace(const_iterator first, const_iterator last, unencoded_rope_view rv);

    Replaces the portion of *this delimited by [first, last) with rv.

    Requires:

    begin() <= old_substr.begin() && old_substr.end() <= end()

  14. basic_unencoded_rope & 
    replace(const_iterator first, const_iterator last, string && s);

    Replaces the portion of *this delimited by [first, last) with s.

    Requires:

    begin() <= old_substr.begin() && old_substr.end() <= end()

  15. template<std::ranges::range R> 
      basic_unencoded_rope & 
      replace(const_iterator first, const_iterator last, R const & r);

    Replaces the portion of *this delimited by [first, last) with r.

    Requires:

    begin() <= old_substr.begin() && old_substr.end() <= end()

  16. template<std::input_iterator I, std::sentinel_for< I > S> 
      basic_unencoded_rope & 
      replace(const_iterator first1, const_iterator last1, I first2, S last2);

    Replaces the portion of *this delimited by [first1, last1) with [first2, last2).

    Requires:

    begin() <= old_substr.begin() && old_substr.end() <= end()

  17. template<typename R> 
      auto replace(unencoded_rope_view const & old_substr, R && r);

    Replaces the portion of *this delimited by old_substr with r.

    Requires:

    begin() <= old_substr.begin() && old_substr.end() <= end()

  18. template<std::input_iterator I, std::sentinel_for< I > S> 
      auto replace(unencoded_rope_view const & old_substr, I first, S last);

    Replaces the portion of *this delimited by old_substr with [first, last).

    Requires:

    begin() <= old_substr.begin() && old_substr.end() <= end()

  19. template<typename R> auto insert(const_iterator at, R && r);

    Inserts r into *this at position at.

    Requires:

    begin() <= old_substr.begin() && old_substr.end() <= end()

  20. template<std::input_iterator I, std::sentinel_for< I > S> 
      auto insert(const_iterator at, I first, S last);

    Inserts [first, last) into *this at position at.

    Requires:

    begin() <= old_substr.begin() && old_substr.end() <= end()

  21. template<typename T> auto operator+=(T && x);

    Appends x to *this.

  22. void swap(basic_unencoded_rope & other);
  23. bool equal_root(basic_unencoded_rope other) const;

    Returns true if *this and other contain the same root node pointer. This is useful when you want to check for equality between two basic_unencoded_ropes that are likely to have originated from the same initial basic_unencoded_rope, and may have since been mutated.

basic_unencoded_rope friend functions

  1. std::ostream & operator<<(std::ostream & os, basic_unencoded_rope r);

    Stream inserter; performs unformatted output.


PrevUpHomeNext