27 #include <xlnt/xlnt_config.hpp> 28 #include <xlnt/cell/index_types.hpp> 39 class range_reference;
66 static std::pair<std::string, row_t> split_reference(
const std::string &reference_string);
74 static std::pair<std::string, row_t> split_reference(
75 const std::string &reference_string,
bool &absolute_column,
bool &absolute_row);
116 cell_reference &make_absolute(
bool absolute_column =
true,
bool absolute_row =
true);
121 bool column_absolute()
const;
127 void column_absolute(
bool absolute_column);
132 bool row_absolute()
const;
138 void row_absolute(
bool absolute_row);
151 void column(
const std::string &column_string);
179 cell_reference make_offset(
int column_offset,
int row_offset)
const;
184 std::string to_string()
const;
210 bool operator==(
const std::string &reference_string)
const;
216 bool operator==(
const char *reference_string)
const;
228 bool operator!=(
const std::string &reference_string)
const;
234 bool operator!=(
const char *reference_string)
const;
257 bool absolute_column_;
264 struct hash<
xlnt::cell_reference>
268 static_assert(std::is_same<decltype(x.
row()), std::uint32_t>::value,
"this hash function expects both row and column to be 32-bit numbers");
269 static_assert(std::is_same<decltype(x.
column_index()), std::uint32_t>::value,
"this hash function expects both row and column to be 32-bit numbers");
270 return hash<std::uint64_t>{}(x.
row() |
static_cast<std::uint64_t
>(x.
column_index()) << 32);
std::uint32_t index_t
Alias declaration for the internal numeric type of this column.
Definition: index_types.hpp:54
std::uint32_t row_t
All rows should be referred to by an instance of this type.
Definition: index_types.hpp:41
Definition: cell_reference.hpp:262
Enumerates the possible types a cell can be determined by it's current value.
Definition: cell.hpp:37
Functor for hashing a cell reference. Allows for use of std::unordered_set<cell_reference, cel_reference_hash> and similar.
Definition: cell_reference.hpp:45
bool operator==(std::nullptr_t, const cell &cell)
Returns true if this cell is uninitialized.
An object used to refer to a cell. References have two parts, the column and the row. In Excel, the reference string A1 refers to the top-left-most cell. A cell_reference can be initialized from a string of this form or a 1-indexed ordered pair of the form column, row.
Definition: cell_reference.hpp:60
column_t::index_t column_index() const
Returns a 1-indexed numeric index of the column of this reference.
Columns can be referred to as a string A,B,...Z,AA,AB,..,ZZ,AAA,...,ZZZ or as a 1-indexed index...
Definition: index_types.hpp:48
bool operator!=(const std::string &reference_string, const range_reference &ref)
Returns true if the string representation of the range is not equivalent to ref.
A range_reference describes a rectangular area of a worksheet with positive width and height defined ...
Definition: range_reference.hpp:36
row_t row() const
Returns a 1-indexed numeric index of the row of this reference.