| 
    rippled
    
   | 
 
An immutable linear range of bytes. More...
#include <Slice.h>

Public Types | |
| using | value_type = std::uint8_t | 
| using | const_iterator = value_type const * | 
Public Member Functions | |
| Slice () noexcept=default | |
| Default constructed Slice has length 0.   | |
| Slice (Slice const &) noexcept=default | |
| Slice & | operator= (Slice const &) noexcept=default | 
| Slice (void const *data, std::size_t size) noexcept | |
| Create a slice pointing to existing memory.   | |
| bool | empty () const noexcept | 
Return true if the byte range is empty.   | |
| std::uint8_t const * | data () const noexcept | 
| Return a pointer to beginning of the storage.   | |
| std::uint8_t | operator[] (std::size_t i) const noexcept | 
| Access raw bytes.   | |
| void | remove_prefix (std::size_t n) | 
| Shrinks the slice by moving its start forward by n characters.   | |
| void | remove_suffix (std::size_t n) | 
| Shrinks the slice by moving its end backward by n characters.   | |
| const_iterator | begin () const noexcept | 
| const_iterator | cbegin () const noexcept | 
| const_iterator | end () const noexcept | 
| const_iterator | cend () const noexcept | 
| Slice | substr (std::size_t pos, std::size_t count=std::numeric_limits< std::size_t >::max()) const | 
| Return a "sub slice" of given length starting at the given position.   | |
| std::size_t | size () const noexcept | 
| Returns the number of bytes in the storage.   | |
| std::size_t | length () const noexcept | 
| Slice & | operator+= (std::size_t n) | 
| Advance the buffer.   | |
| Slice | operator+ (std::size_t n) const | 
Private Attributes | |
| std::uint8_t const * | data_ = nullptr | 
| std::size_t | size_ = 0 | 
An immutable linear range of bytes.
A fully constructed Slice is guaranteed to be in a valid state. A Slice is lightweight and copyable, it retains no ownership of the underlying memory.
| using ripple::Slice::const_iterator = value_type const* | 
      
  | 
  defaultnoexcept | 
Default constructed Slice has length 0.
      
  | 
  defaultnoexcept | 
      
  | 
  noexcept | 
      
  | 
  noexcept | 
      
  | 
  noexcept | 
      
  | 
  noexcept | 
      
  | 
  noexcept | 
      
  | 
  noexcept | 
| Slice & ripple::Slice::operator+= | ( | std::size_t | n | ) | 
| Slice ripple::Slice::operator+ | ( | std::size_t | n | ) | const | 
| void ripple::Slice::remove_prefix | ( | std::size_t | n | ) | 
| void ripple::Slice::remove_suffix | ( | std::size_t | n | ) | 
      
  | 
  noexcept | 
      
  | 
  noexcept | 
      
  | 
  noexcept | 
      
  | 
  noexcept | 
| Slice ripple::Slice::substr | ( | std::size_t | pos, | 
| std::size_t | count = std::numeric_limits<std::size_t>::max()  | 
        ||
| ) | const | 
Return a "sub slice" of given length starting at the given position.
Note that the subslice encompasses the range [pos, pos + rcount), where rcount is the smaller of count and size() - pos.
| pos | position of the first character @count requested length | 
| std::out_of_range | if pos > size() | 
      
  | 
  private | 
      
  | 
  private |