30 #include <unordered_map> 32 #include <xlnt/xlnt_config.hpp> 33 #include <xlnt/cell/cell_type.hpp> 34 #include <xlnt/cell/index_types.hpp> 35 #include <xlnt/cell/rich_text.hpp> 95 static const std::unordered_map<std::string, int> &error_codes();
107 bool has_value()
const;
114 template <
typename T>
126 void value(std::nullptr_t);
131 void value(
bool boolean_value);
136 void value(
int int_value);
141 void value(
unsigned int int_value);
146 void value(
long long int int_value);
151 void value(
unsigned long long int int_value);
156 void value(
float float_value);
161 void value(
double float_value);
166 void value(
const date &date_value);
171 void value(
const time &time_value);
176 void value(
const datetime &datetime_value);
181 void value(
const timedelta &timedelta_value);
186 void value(
const std::string &string_value);
191 void value(
const char *string_value);
201 void value(
const cell other_cell);
207 void value(
const std::string &string_value,
bool infer_type);
212 type data_type()
const;
218 void data_type(
type t);
226 bool garbage_collectible()
const;
231 bool is_date()
const;
258 std::pair<int, int> anchor()
const;
271 void hyperlink(
const std::string &url,
const std::string &display =
"");
286 bool has_hyperlink()
const;
295 class alignment computed_alignment() const;
302 class border computed_border() const;
309 class fill computed_fill() const;
316 class font computed_font() const;
337 bool has_format()
const;
428 bool has_style()
const;
451 void style(
const std::string &style_name);
465 std::string formula()
const;
471 void formula(
const std::string &formula);
476 void clear_formula();
481 bool has_formula()
const;
489 std::string to_string()
const;
497 bool is_merged()
const;
504 void merged(
bool merged);
511 bool phonetics_visible()
const;
516 void show_phonetics(
bool phonetics);
521 std::string
error()
const;
532 cell offset(
int column,
int row);
562 std::string check_string(
const std::string &to_check);
574 void clear_comment();
585 void comment(
const std::string &text,
586 const std::string &author =
"Microsoft Office User");
592 void comment(
const std::string &comment_text,
593 const class font &comment_font,
594 const std::string &author =
"Microsoft Office User");
604 double width()
const;
609 double height()
const;
632 friend class detail::xlsx_consumer;
633 friend class detail::xlsx_producer;
634 friend struct detail::cell_impl;
640 class format modifiable_format();
650 cell(detail::cell_impl *d);
655 detail::cell_impl *d_;
675 bool cell::value<bool>()
const;
678 int cell::value<int>()
const;
681 unsigned int cell::value<unsigned int>()
const;
684 long long int cell::value<long long int>()
const;
687 unsigned long long cell::value<unsigned long long int>()
const;
690 float cell::value<float>()
const;
693 double cell::value<double>()
const;
696 date cell::value<date>()
const;
699 time cell::value<time>()
const;
702 datetime cell::value<datetime>()
const;
705 timedelta cell::value<timedelta>()
const;
708 std::string cell::value<std::string>()
const;
711 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:55
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:54
std::uint32_t row_t
All rows should be referred to by an instance of this type.
Definition: index_types.hpp:41
Enumerates the possible types a cell can be determined by it's current value.
Definition: cell.hpp:37
Describes the font style of a particular cell.
Definition: font.hpp:41
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:77
Represents a span of time between two datetimes. This is not fully supported yet throughout the libra...
Definition: timedelta.hpp:37
Describes the border style of a particular cell.
Definition: border.hpp:94
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
Describes a unit of data in a worksheet at a specific coordinate and its associated properties...
Definition: cell.hpp:84
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:48
cell_type
Enumerates the possible types a cell can be determined by it's current value.
Definition: cell_type.hpp:39
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.
Describes the protection style of a particular cell.
Definition: protection.hpp:38
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:56
A date is a specific day specified in terms of a year, month, and day. It can also be initialized as ...
Definition: date.hpp:39
workbook is the container for all other parts of the document.
Definition: workbook.hpp:92
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