|
xlnt - community edition
|
A range is a 2D collection of cells with defined extens that can be iterated upon. More...
#include <range.hpp>
Public Types | |
| using | iterator = range_iterator |
| Alias for the iterator type More... | |
| using | const_iterator = const_range_iterator |
| Alias for the const iterator type More... | |
| using | reverse_iterator = std::reverse_iterator< iterator > |
| Alias for the reverse iterator type More... | |
| using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
| Alias for the const reverse iterator type More... | |
Public Member Functions | |
| range (worksheet ws, const range_reference &reference, major_order order=major_order::row, bool skip_null=false) | |
| Constructs a range on the given worksheet. More... | |
| ~range () | |
| Desctructor More... | |
| range (const range &)=default | |
| Default copy constructor. More... | |
| void | clear_cells () |
| Erases all cell data from the worksheet for cells within this range. More... | |
| cell_vector | vector (std::size_t n) |
| Returns a vector pointing to the n-th row or column in this range (depending on major order). More... | |
| const cell_vector | vector (std::size_t n) const |
| Returns a vector pointing to the n-th row or column in this range (depending on major order). More... | |
| class cell | cell (const cell_reference &ref) |
| Returns a wrapper pointing to the cell in the range relative to its top left cell. If the cell doesn't exist, an empty cell will be created, added to the worksheet, and returned. More... | |
| const class cell | cell (const cell_reference &ref) const |
| Returns a wrapper pointing to the cell in the range relative to its top left cell. Assumes that the cell exists. If the cell doesn't exist, an invalid_parameter exception will be thrown. More... | |
| const worksheet & | target_worksheet () const |
| The worksheet this range targets More... | |
| range_reference | reference () const |
| Returns the reference defining the bounds of this range. More... | |
| std::size_t | length () const |
| Returns the number of rows or columns in this range (depending on major order). More... | |
| bool | contains (const cell_reference &ref) |
| Returns true if the given cell exists in the parent worksheet of this range. More... | |
| range | alignment (const xlnt::alignment &new_alignment) |
| Sets the alignment of all cells in the range to new_alignment and returns the range. More... | |
| range | border (const xlnt::border &new_border) |
| Sets the border of all cells in the range to new_border and returns the range. More... | |
| range | fill (const xlnt::fill &new_fill) |
| Sets the fill of all cells in the range to new_fill and returns the range. More... | |
| range | font (const xlnt::font &new_font) |
| Sets the font of all cells in the range to new_font and returns the range. More... | |
| range | number_format (const xlnt::number_format &new_number_format) |
| Sets the number format of all cells in the range to new_number_format and returns the range. More... | |
| range | protection (const xlnt::protection &new_protection) |
| Sets the protection of all cells in the range to new_protection and returns the range. More... | |
| range | style (const class style &new_style) |
| Sets the named style applied to all cells in this range to a style named style_name. More... | |
| range | style (const std::string &style_name) |
| Sets the named style applied to all cells in this range to a style named style_name. Assumes that the style has been previously created in the workbook (please call workbook::has_style() to check). If this style has not been previously created in the workbook, a key_not_found exception will be thrown. More... | |
| xlnt::conditional_format | conditional_format (const condition &when) |
| Creates a conditional format for the given condition and returns a wrapper pointing to it. More... | |
| cell_vector | front () |
| Returns the first row or column in this range. More... | |
| const cell_vector | front () const |
| Returns the first row or column in this range. More... | |
| cell_vector | back () |
| Returns the last row or column in this range. More... | |
| const cell_vector | back () const |
| Returns the last row or column in this range. More... | |
| iterator | begin () |
| Returns an iterator to the first row or column in this range. More... | |
| iterator | end () |
| Returns an iterator to one past the last row or column in this range. More... | |
| const_iterator | begin () const |
| Returns an iterator to the first row or column in this range. More... | |
| const_iterator | end () const |
| Returns an iterator to one past the last row or column in this range. More... | |
| const_iterator | cbegin () const |
| Returns an iterator to the first row or column in this range. More... | |
| const_iterator | cend () const |
| Returns an iterator to one past the last row or column in this range. More... | |
| reverse_iterator | rbegin () |
| Returns a reverse iterator to the first row or column in this range. More... | |
| reverse_iterator | rend () |
| Returns a reverse iterator to one past the last row or column in this range. More... | |
| const_reverse_iterator | rbegin () const |
| Returns a reverse iterator to the first row or column in this range. More... | |
| const_reverse_iterator | rend () const |
| Returns a reverse iterator to one past the last row or column in this range. More... | |
| const_reverse_iterator | crbegin () const |
| Returns a reverse iterator to the first row or column in this range. More... | |
| const_reverse_iterator | crend () const |
| Returns a reverse iterator to one past the last row or column in this range. More... | |
| void | apply (std::function< void(class cell)> f) |
| Applies function f to all cells in the range More... | |
| cell_vector | operator[] (std::size_t n) |
| Returns the n-th row or column in this range. More... | |
| const cell_vector | operator[] (std::size_t n) const |
| Returns the n-th row or column in this range. More... | |
| bool | operator== (const range &comparand) const |
| Returns true if this range is equivalent to comparand. More... | |
| bool | operator!= (const range &comparand) const |
| Returns true if this range is not equivalent to comparand. More... | |
A range is a 2D collection of cells with defined extens that can be iterated upon.
Alias for the const iterator type
| using xlnt::range::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Alias for the const reverse iterator type
| using xlnt::range::iterator = range_iterator |
Alias for the iterator type
| using xlnt::range::reverse_iterator = std::reverse_iterator<iterator> |
Alias for the reverse iterator type
| xlnt::range::range | ( | worksheet | ws, |
| const range_reference & | reference, | ||
| major_order | order = major_order::row, |
||
| bool | skip_null = false |
||
| ) |
Constructs a range on the given worksheet.
| xlnt::range::~range | ( | ) |
Desctructor
|
default |
Default copy constructor.
| range xlnt::range::alignment | ( | const xlnt::alignment & | new_alignment | ) |
Sets the alignment of all cells in the range to new_alignment and returns the range.
| void xlnt::range::apply | ( | std::function< void(class cell)> | f | ) |
Applies function f to all cells in the range
| cell_vector xlnt::range::back | ( | ) |
Returns the last row or column in this range.
| const cell_vector xlnt::range::back | ( | ) | const |
Returns the last row or column in this range.
| iterator xlnt::range::begin | ( | ) |
Returns an iterator to the first row or column in this range.
| const_iterator xlnt::range::begin | ( | ) | const |
Returns an iterator to the first row or column in this range.
| range xlnt::range::border | ( | const xlnt::border & | new_border | ) |
Sets the border of all cells in the range to new_border and returns the range.
| const_iterator xlnt::range::cbegin | ( | ) | const |
Returns an iterator to the first row or column in this range.
| class cell xlnt::range::cell | ( | const cell_reference & | ref | ) |
Returns a wrapper pointing to the cell in the range relative to its top left cell. If the cell doesn't exist, an empty cell will be created, added to the worksheet, and returned.
| const class cell xlnt::range::cell | ( | const cell_reference & | ref | ) | const |
Returns a wrapper pointing to the cell in the range relative to its top left cell. Assumes that the cell exists. If the cell doesn't exist, an invalid_parameter exception will be thrown.
| const_iterator xlnt::range::cend | ( | ) | const |
Returns an iterator to one past the last row or column in this range.
| void xlnt::range::clear_cells | ( | ) |
Erases all cell data from the worksheet for cells within this range.
| xlnt::conditional_format xlnt::range::conditional_format | ( | const condition & | when | ) |
Creates a conditional format for the given condition and returns a wrapper pointing to it.
| bool xlnt::range::contains | ( | const cell_reference & | ref | ) |
Returns true if the given cell exists in the parent worksheet of this range.
| const_reverse_iterator xlnt::range::crbegin | ( | ) | const |
Returns a reverse iterator to the first row or column in this range.
| const_reverse_iterator xlnt::range::crend | ( | ) | const |
Returns a reverse iterator to one past the last row or column in this range.
| iterator xlnt::range::end | ( | ) |
Returns an iterator to one past the last row or column in this range.
| const_iterator xlnt::range::end | ( | ) | const |
Returns an iterator to one past the last row or column in this range.
| range xlnt::range::fill | ( | const xlnt::fill & | new_fill | ) |
Sets the fill of all cells in the range to new_fill and returns the range.
| range xlnt::range::font | ( | const xlnt::font & | new_font | ) |
Sets the font of all cells in the range to new_font and returns the range.
| cell_vector xlnt::range::front | ( | ) |
Returns the first row or column in this range.
| const cell_vector xlnt::range::front | ( | ) | const |
Returns the first row or column in this range.
| std::size_t xlnt::range::length | ( | ) | const |
Returns the number of rows or columns in this range (depending on major order).
| range xlnt::range::number_format | ( | const xlnt::number_format & | new_number_format | ) |
Sets the number format of all cells in the range to new_number_format and returns the range.
| bool xlnt::range::operator!= | ( | const range & | comparand | ) | const |
Returns true if this range is not equivalent to comparand.
| bool xlnt::range::operator== | ( | const range & | comparand | ) | const |
Returns true if this range is equivalent to comparand.
| cell_vector xlnt::range::operator[] | ( | std::size_t | n | ) |
Returns the n-th row or column in this range.
| const cell_vector xlnt::range::operator[] | ( | std::size_t | n | ) | const |
Returns the n-th row or column in this range.
| range xlnt::range::protection | ( | const xlnt::protection & | new_protection | ) |
Sets the protection of all cells in the range to new_protection and returns the range.
| reverse_iterator xlnt::range::rbegin | ( | ) |
Returns a reverse iterator to the first row or column in this range.
| const_reverse_iterator xlnt::range::rbegin | ( | ) | const |
Returns a reverse iterator to the first row or column in this range.
| range_reference xlnt::range::reference | ( | ) | const |
Returns the reference defining the bounds of this range.
| reverse_iterator xlnt::range::rend | ( | ) |
Returns a reverse iterator to one past the last row or column in this range.
| const_reverse_iterator xlnt::range::rend | ( | ) | const |
Returns a reverse iterator to one past the last row or column in this range.
Sets the named style applied to all cells in this range to a style named style_name.
| range xlnt::range::style | ( | const std::string & | style_name | ) |
Sets the named style applied to all cells in this range to a style named style_name. Assumes that the style has been previously created in the workbook (please call workbook::has_style() to check). If this style has not been previously created in the workbook, a key_not_found exception will be thrown.
| const worksheet& xlnt::range::target_worksheet | ( | ) | const |
The worksheet this range targets
| cell_vector xlnt::range::vector | ( | std::size_t | n | ) |
Returns a vector pointing to the n-th row or column in this range (depending on major order).
| const cell_vector xlnt::range::vector | ( | std::size_t | n | ) | const |
Returns a vector pointing to the n-th row or column in this range (depending on major order).
1.8.13