xlnt
Public Types | Public Member Functions | List of all members
xlnt::cell_iterator Class Reference

A cell iterator iterates over a 1D range by row or by column. More...

#include <cell_iterator.hpp>

Public Types

using iterator_category = std::bidirectional_iterator_tag
 iterator tags required for use with standard algorithms and adapters More...
 
using value_type = cell
 
using difference_type = std::ptrdiff_t
 
using pointer = cell *
 
using reference = cell
 

Public Member Functions

 cell_iterator ()=default
 Default constructs a cell_iterator More...
 
 cell_iterator (worksheet ws, const cell_reference &start_cell, const range_reference &limits, major_order order, bool skip_null, bool wrap)
 Constructs a cell_iterator from a worksheet, range, and iteration settings. More...
 
 cell_iterator (const cell_iterator &)=default
 Constructs a cell_iterator as a copy of an existing cell_iterator. More...
 
cell_iteratoroperator= (const cell_iterator &)=default
 Assigns this iterator to match the data in rhs. More...
 
 cell_iterator (cell_iterator &&)=default
 Constructs a cell_iterator by moving from a cell_iterator temporary More...
 
cell_iteratoroperator= (cell_iterator &&)=default
 Assigns this iterator to from a cell_iterator temporary More...
 
 ~cell_iterator ()=default
 destructor for const_cell_iterator More...
 
reference operator* ()
 Dereferences this iterator to return the cell it points to. More...
 
const reference operator* () const
 Dereferences this iterator to return the cell it points to. More...
 
bool operator== (const cell_iterator &other) const
 Returns true if this iterator is equivalent to other. More...
 
bool operator!= (const cell_iterator &other) const
 Returns true if this iterator isn't equivalent to other. More...
 
cell_iteratoroperator-- ()
 Pre-decrements the iterator to point to the previous cell and returns a reference to the iterator. More...
 
cell_iterator operator-- (int)
 Post-decrements the iterator to point to the previous cell and return a copy of the iterator before the decrement. More...
 
cell_iteratoroperator++ ()
 Pre-increments the iterator to point to the previous cell and returns a reference to the iterator. More...
 
cell_iterator operator++ (int)
 Post-increments the iterator to point to the previous cell and return a copy of the iterator before the decrement. More...
 
bool has_value () const
 When iterating over a range that doesn't ignore null cells, operator*() will throw when trying to access the cells that are null. This method checks the existence of a cell. More...
 

Detailed Description

A cell iterator iterates over a 1D range by row or by column.

Member Typedef Documentation

◆ iterator_category

using xlnt::cell_iterator::iterator_category = std::bidirectional_iterator_tag

iterator tags required for use with standard algorithms and adapters

Constructor & Destructor Documentation

◆ cell_iterator() [1/4]

xlnt::cell_iterator::cell_iterator ( )
default

Default constructs a cell_iterator

◆ cell_iterator() [2/4]

xlnt::cell_iterator::cell_iterator ( worksheet  ws,
const cell_reference start_cell,
const range_reference limits,
major_order  order,
bool  skip_null,
bool  wrap 
)

Constructs a cell_iterator from a worksheet, range, and iteration settings.

◆ cell_iterator() [3/4]

xlnt::cell_iterator::cell_iterator ( const cell_iterator )
default

Constructs a cell_iterator as a copy of an existing cell_iterator.

◆ cell_iterator() [4/4]

xlnt::cell_iterator::cell_iterator ( cell_iterator &&  )
default

Constructs a cell_iterator by moving from a cell_iterator temporary

◆ ~cell_iterator()

xlnt::cell_iterator::~cell_iterator ( )
default

destructor for const_cell_iterator

Member Function Documentation

◆ has_value()

bool xlnt::cell_iterator::has_value ( ) const

When iterating over a range that doesn't ignore null cells, operator*() will throw when trying to access the cells that are null. This method checks the existence of a cell.

◆ operator!=()

bool xlnt::cell_iterator::operator!= ( const cell_iterator other) const

Returns true if this iterator isn't equivalent to other.

◆ operator*() [1/2]

reference xlnt::cell_iterator::operator* ( )

Dereferences this iterator to return the cell it points to.

◆ operator*() [2/2]

const reference xlnt::cell_iterator::operator* ( ) const

Dereferences this iterator to return the cell it points to.

◆ operator++() [1/2]

cell_iterator& xlnt::cell_iterator::operator++ ( )

Pre-increments the iterator to point to the previous cell and returns a reference to the iterator.

◆ operator++() [2/2]

cell_iterator xlnt::cell_iterator::operator++ ( int  )

Post-increments the iterator to point to the previous cell and return a copy of the iterator before the decrement.

◆ operator--() [1/2]

cell_iterator& xlnt::cell_iterator::operator-- ( )

Pre-decrements the iterator to point to the previous cell and returns a reference to the iterator.

◆ operator--() [2/2]

cell_iterator xlnt::cell_iterator::operator-- ( int  )

Post-decrements the iterator to point to the previous cell and return a copy of the iterator before the decrement.

◆ operator=() [1/2]

cell_iterator& xlnt::cell_iterator::operator= ( const cell_iterator )
default

Assigns this iterator to match the data in rhs.

◆ operator=() [2/2]

cell_iterator& xlnt::cell_iterator::operator= ( cell_iterator &&  )
default

Assigns this iterator to from a cell_iterator temporary

◆ operator==()

bool xlnt::cell_iterator::operator== ( const cell_iterator other) const

Returns true if this iterator is equivalent to other.


The documentation for this class was generated from the following file: