11#ifndef OPENXLSX_XLCELL_HPP
12#define OPENXLSX_XLCELL_HPP
16# pragma warning(disable : 4251)
17# pragma warning(disable : 4275)
25#include "OpenXLSX-Exports.hpp"
126 explicit operator bool()
const;
135 void clear(uint32_t keep);
159 XLCell offset(uint16_t rowOffset, uint16_t colOffset)
const;
207 XLThreadedComment addComment(std::string_view text, std::string_view author =
"");
212 XLCell& addNote(std::string_view text, std::string_view author =
"");
217 void print(std::basic_ostream<char>& ostr)
const;
225 static bool isEqual(
const XLCell& lhs,
const XLCell& rhs);
295 typename = std::enable_if_t<
296 std::is_integral_v<T> or std::is_floating_point_v<T> or std::is_same_v<std::decay_t<T>, std::string> ||
297 std::is_same_v<std::decay_t<T>, std::string_view> or std::is_same_v<std::decay_t<T>,
const char*> ||
298 std::is_same_v<std::decay_t<T>,
char*> or std::is_same_v<T, XLDateTime>>>
332 switch (val.
type()) {
334 os << val.
get<int64_t>();
337 os << val.
get<
double>();
340 os << (val.
get<
bool>() ?
"true" :
"false");
360 switch (val.
type()) {
362 os << val.
get<int64_t>();
365 os << val.
get<
double>();
368 os << (val.
get<
bool>() ?
"true" :
"false");
Definition XLCell.hpp:234
XLCellAssignable & setStyle(const XLStyle &style)
Definition XLCell.hpp:283
XLCellAssignable()
Default constructor. Constructs a null object.
Definition XLCell.hpp:239
XLCellAssignable & operator=(T value)
Templated assignment operator.
Definition XLCell.hpp:299
XLCellAssignable & addNote(std::string_view text, std::string_view author="")
Definition XLCell.hpp:273
XLCellAssignable & setCellFormat(XLStyleIndex cellFormatIndex)
Definition XLCell.hpp:278
Represents a rectangular area of cells within a worksheet.
Definition XLCellRange.hpp:40
Definition XLCellReference.hpp:44
The XLCellValueProxy class is used for proxy (or placeholder) objects for XLCellValue objects.
Definition XLCellValue.hpp:418
Class encapsulating a cell value.
Definition XLCellValue.hpp:89
XLValueType type() const
Get the value type of the current object.
Definition XLCellValue.cpp:121
T get() const
Templated getter.
Definition XLCellValue.hpp:275
An implementation class encapsulating the properties and behaviours of a spreadsheet cell.
Definition XLCell.hpp:51
bool empty() const
test if cell object has no (valid) content
Definition XLCell.cpp:125
XLCellReference cellReference() const
get the XLCellReference object for the cell.
Definition XLCell.cpp:129
friend class XLCellValueProxy
Definition XLCell.hpp:53
XLCellValueProxy & value()
Retrieves the mutable value proxy for the cell.
Definition XLCell.cpp:253
XLCell()
Default constructor. Constructs a null object.
Definition XLCell.cpp:26
std::string getString() const
Definition XLCell.hpp:181
XLCell & setStyle(const XLStyle &style)
Apply a high-level XLStyle to this cell. Automatically creates or reuses the required underlying XML ...
Definition XLCell.cpp:286
friend bool operator!=(const XLCell &lhs, const XLCell &rhs)
Definition XLCell.hpp:321
XLCell & setCellFormat(XLStyleIndex cellFormatIndex)
Set the cell style (attribute s) with a reference to the array index of xl/styles....
Definition XLCell.cpp:166
virtual XLCell & operator=(const XLCell &other)
Copy assignment operator.
Definition XLCell.cpp:66
friend bool operator==(const XLCell &lhs, const XLCell &rhs)
Definition XLCell.hpp:314
XLFormulaProxy & formula()
Retrieves the mutable formula proxy for the cell.
Definition XLCell.cpp:150
friend class XLFormulaProxy
Definition XLCell.hpp:54
XLCell offset(uint16_t rowOffset, uint16_t colOffset) const
get the XLCell object from the current cell offset
Definition XLCell.cpp:135
XLCell & addNote(std::string_view text, std::string_view author="")
Add a legacy yellow note to this cell fluently.
Definition XLCell.cpp:270
virtual ~XLCell()
Destructor.
void clear(uint32_t keep)
clear all cell content and attributes except for the cell reference (attribute r)
Definition XLCell.cpp:219
void copyFrom(XLCell const &other)
Copy contents of a cell, value & formula.
Definition XLCell.cpp:89
friend class XLRowDataIterator
Definition XLCell.hpp:55
friend class XLCellIterator
Definition XLCell.hpp:52
bool hasFormula() const
test if cell has a formula (XML) node, even if it is an empty string
Definition XLCell.cpp:144
This class encapsulate the Excel concept of Shared Strings. In Excel, instead of havig individual str...
Definition XLSharedStrings.hpp:78
A class encapsulating an Excel worksheet. Access to XLWorksheet objects should be via the workbook ob...
Definition XLWorksheet.hpp:132
Definition IXLCellProvider.hpp:24
bool operator==(const XLCell &lhs, const XLCell &rhs)
Definition XLCell.hpp:314
bool operator!=(const XLCell &lhs, const XLCell &rhs)
Definition XLCell.hpp:321
constexpr const uint32_t XLKeepCellType
Definition XLCell.hpp:38
constexpr const uint32_t XLKeepCellValue
Definition XLCell.hpp:39
constexpr const uint32_t XLKeepCellFormula
Definition XLCell.hpp:40
@ Float
Definition XLCellValue.hpp:47
@ Boolean
Definition XLCellValue.hpp:47
@ Integer
Definition XLCellValue.hpp:47
@ Empty
Definition XLCellValue.hpp:47
OpenXLSX_xml_node XMLNode
Definition XLXmlParser.hpp:64
size_t XLStyleIndex
Definition XLStyles_Common.hpp:36
std::ostream & operator<<(std::ostream &os, const XLCell &c)
ostream output of XLCell content
Definition XLCell.hpp:329
constexpr const uint32_t XLKeepCellStyle
Definition XLCell.hpp:37
std::reference_wrapper< const XLSharedStrings > XLSharedStringsRef
Definition XLSharedStrings.hpp:67
A high-level, human-ergonomic structure representing the styling of a cell or range....
Definition XLStyle.hpp:29