29 #include <unordered_map> 31 #include <xlnt/xlnt_config.hpp> 32 #include <xlnt/cell/cell_type.hpp> 33 #include <xlnt/cell/index_types.hpp> 34 #include <xlnt/cell/rich_text.hpp> 94 static const std::unordered_map<std::string, int> &error_codes();
106 bool has_value()
const;
113 template <
typename T>
125 void value(std::nullptr_t);
130 void value(
bool boolean_value);
135 void value(
int int_value);
140 void value(
unsigned int int_value);
145 void value(
long long int int_value);
150 void value(
unsigned long long int int_value);
155 void value(
float float_value);
160 void value(
double float_value);
165 void value(
const date &date_value);
170 void value(
const time &time_value);
175 void value(
const datetime &datetime_value);
180 void value(
const timedelta &timedelta_value);
185 void value(
const std::string &string_value);
190 void value(
const char *string_value);
207 void value(
const cell other_cell);
213 void value(
const std::string &string_value,
bool infer_type);
218 type data_type()
const;
224 void data_type(
type t);
232 bool garbage_collectible()
const;
237 bool is_date()
const;
264 std::pair<int, int> anchor()
const;
277 void hyperlink(
const std::string &url,
const std::string &display =
"");
292 bool has_hyperlink()
const;
301 class alignment computed_alignment() const;
308 class border computed_border() const;
315 class fill computed_fill() const;
322 class font computed_font() const;
343 bool has_format()
const;
437 bool has_style()
const;
460 void style(
const std::string &style_name);
474 std::string formula()
const;
480 void formula(
const std::string &formula);
485 void clear_formula();
490 bool has_formula()
const;
498 std::string to_string()
const;
506 bool is_merged()
const;
513 void merged(
bool merged);
520 bool phonetics_visible()
const;
525 void show_phonetics(
bool phonetics);
530 std::string
error()
const;
541 cell offset(
int column,
int row);
571 std::string check_string(
const std::string &to_check);
578 bool has_comment()
const;
583 void clear_comment();
594 void comment(
const std::string &text,
595 const std::string &author =
"Microsoft Office User");
601 void comment(
const std::string &comment_text,
602 const class font &comment_font,
603 const std::string &author =
"Microsoft Office User");
613 double width()
const;
618 double height()
const;
627 bool compare(
const cell &other,
bool compare_by_reference)
const;
650 friend class detail::xlsx_consumer;
651 friend class detail::xlsx_producer;
652 friend struct detail::cell_impl;
657 void value_no_check(
const rich_text &text);
665 void copy_from_other_workbook(
const cell &source);
673 void copy_format_from_other_workbook(
const class format &source_format);
679 class format modifiable_format();
689 cell(detail::cell_impl *d);
694 detail::cell_impl *d_ =
nullptr;
724 XLNT_API
bool cell::value<bool>()
const;
727 XLNT_API
int cell::value<int>()
const;
730 XLNT_API
unsigned int cell::value<unsigned int>()
const;
733 XLNT_API
long long int cell::value<long long int>()
const;
736 XLNT_API
unsigned long long cell::value<unsigned long long int>()
const;
739 XLNT_API
float cell::value<float>()
const;
742 XLNT_API
double cell::value<double>()
const;
745 XLNT_API
date cell::value<date>()
const;
748 XLNT_API
time cell::value<time>()
const;
751 XLNT_API
datetime cell::value<datetime>()
const;
754 XLNT_API
timedelta cell::value<timedelta>()
const;
757 XLNT_API std::string cell::value<std::string>()
const;
760 XLNT_API
rich_text cell::value<rich_text>()
const;
A range is a 2D collection of cells with defined extens that can be iterated upon.
Definition: range.hpp:53
Represents an association between a source Package or part, and a target object which can be a part o...
Definition: relationship.hpp:103
std::uint32_t index_t
Alias declaration for the internal numeric type of this column.
Definition: index_types.hpp:53
std::uint32_t row_t
All rows should be referred to by an instance of this type.
Definition: index_types.hpp:40
Enumerates the possible types a cell can be determined by it's current value.
Definition: cell.hpp:36
bool operator!=(std::nullptr_t, const cell &cell)
Returns true if this cell is initialized.
Describes the font style of a particular cell.
Definition: font.hpp:43
value is a known error code such as #VALUE!
A time is a specific time of the day specified in terms of an hour, minute, second, and microsecond (0-999999). It can also be initialized as a fraction of a day using time::from_number.
Definition: time.hpp:38
Describes the fill style of a particular cell.
Definition: fill.hpp:299
A worksheet is a 2D array of cells starting with cell A1 in the top-left corner and extending indefin...
Definition: worksheet.hpp:75
Represents a span of time between two datetimes. This is not fully supported yet throughout the libra...
Definition: timedelta.hpp:35
Describes the border style of a particular cell.
Definition: border.hpp:91
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:59
Describes a unit of data in a worksheet at a specific coordinate and its associated properties...
Definition: cell.hpp:83
Describes a hyperlink pointing from a cell to another cell or a URL.
Definition: hyperlink.hpp:43
Encapsulates zero or more formatted text runs where a text run is a string of text with the same defi...
Definition: rich_text.hpp:41
A datetime is a combination of a date and a time. IMPORTANT: The datetime could be in an empty/invali...
Definition: datetime.hpp:41
std::ostream & operator<<(std::ostream &stream, const xlnt::cell &cell)
Convenience function for writing cell to an ostream. Uses cell::to_string() internally.
Alignment options that determine how text should be displayed within a cell.
Definition: alignment.hpp:63
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:47
cell_type
Enumerates the possible types a cell can be determined by it's current value.
Definition: cell_type.hpp:39
Describes the protection style of a particular cell.
Definition: protection.hpp:36
Describes a style which has a name and can be applied to multiple individual formats. In Excel this is a "Cell Style".
Definition: style.hpp:55
A date is a specific day specified in terms of a year, month, and day. It can also be initialized as ...
Definition: date.hpp:37
workbook is the container for all other parts of the document.
Definition: workbook.hpp:96
calendar
An enumeration of possible base dates. Dates in Excel are stored as days since this base date...
Definition: calendar.hpp:35
Phonetic properties Element provides a collection of properties that affect display of East Asian Lan...
Definition: phonetic_pr.hpp:39