PrevUpHomeNext

Struct grapheme

boost::text::grapheme

Synopsis

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


struct grapheme {
  // types
  typedef utf_8_to_32_iterator< char const * > const_iterator;

  // construct/copy/destruct
  grapheme();
  template<code_point_iter I, std::sentinel_for< I > S> grapheme(I, S);
  grapheme(uint32_t);
  template<code_point_iter I, std::sentinel_for< I > S> 
    grapheme(utf32_view< I, S >);

  // public member functions
  bool empty() const;
  int distance() const;
  const_iterator begin() const;
  const_iterator end() const;
  bool operator==(grapheme const &) const;
  bool operator!=(grapheme const &) const;

  // friend functions
  std::ostream & operator<<(std::ostream &, grapheme const &);
  int storage_code_units(grapheme const &);
};

Description

An owning sequence of code points that comprise an extended grapheme cluster.

grapheme public construct/copy/destruct

  1. grapheme();

    Default ctor.

  2. template<code_point_iter I, std::sentinel_for< I > S> 
      grapheme(I first, S last);

    Constructs *this from the code points [first, last).

    Requires:

    The code points in [first, last) comprise at most one grapheme.

  3. grapheme(uint32_t cp);

    Constructs *this from the code point cp.

  4. template<code_point_iter I, std::sentinel_for< I > S> 
      grapheme(utf32_view< I, S > r);

    Constructs *this from r.

    Requires:

    The code points in r comprise at most one grapheme.

    Requires:

    The code points in [first, last) comprise at most one grapheme.

grapheme public member functions

  1. bool empty() const;

    Returns true if *this contains no code points.

  2. int distance() const;

    Returns the number of code points contained in *this. This is an O(N) operation.

  3. const_iterator begin() const;
  4. const_iterator end() const;
  5. bool operator==(grapheme const & other) const;
  6. bool operator!=(grapheme const & other) const;

grapheme friend functions

  1. std::ostream & operator<<(std::ostream & os, grapheme const & g);

    Stream inserter; performs unformatted output, in UTF-8 encoding.

  2. int storage_code_units(grapheme const & g);

    Returns the number of code_units controlled by g.


PrevUpHomeNext