1#ifndef OPENXLSX_XLCELL_HPP
2#define OPENXLSX_XLCELL_HPP
6# pragma warning(disable : 4251)
7# pragma warning(disable : 4275)
15#include "OpenXLSX-Exports.hpp"
104 void copyFrom(
XLCell const& other);
116 explicit operator bool()
const;
125 void clear(uint32_t keep);
149 XLCell offset(uint16_t rowOffset, uint16_t colOffset)
const;
155 bool hasFormula()
const;
171 std::string
getString()
const {
return value().getString(); }
197 XLThreadedComment addComment(std::string_view text, std::string_view author =
"");
202 XLCell& addNote(std::string_view text, std::string_view author =
"");
207 void print(std::basic_ostream<char>& ostr)
const;
215 static bool isEqual(
const XLCell& lhs,
const XLCell& rhs);
264 XLCell::addNote(text, author);
269 XLCell::setCellFormat(cellFormatIndex);
274 XLCell::setStyle(style);
285 typename = std::enable_if_t<
286 std::is_integral_v<T> or std::is_floating_point_v<T> or std::is_same_v<std::decay_t<T>, std::string> ||
287 std::is_same_v<std::decay_t<T>, std::string_view> or std::is_same_v<std::decay_t<T>,
const char*> ||
288 std::is_same_v<std::decay_t<T>,
char*> or std::is_same_v<T, XLDateTime>>>
291 XLCell::value() = value;
322 switch (val.
type()) {
324 os << val.
get<int64_t>();
327 os << val.
get<
double>();
330 os << (val.
get<
bool>() ?
"true" :
"false");
350 switch (val.
type()) {
352 os << val.
get<int64_t>();
355 os << val.
get<
double>();
358 os << (val.
get<
bool>() ?
"true" :
"false");
Definition XLXmlParser.hpp:84
Definition XLCell.hpp:224
XLCellAssignable & setStyle(const XLStyle &style)
Definition XLCell.hpp:273
XLCellAssignable()
Default constructor. Constructs a null object.
Definition XLCell.hpp:229
XLCellAssignable & operator=(T value)
Templated assignment operator.
Definition XLCell.hpp:289
XLCellAssignable & addNote(std::string_view text, std::string_view author="")
Definition XLCell.hpp:263
XLCellAssignable & setCellFormat(XLStyleIndex cellFormatIndex)
Definition XLCell.hpp:268
A forward iterator for iterating over a range of cells.
Definition XLCellIterator.hpp:37
Represents a rectangular area of cells within a worksheet.
Definition XLCellRange.hpp:30
Definition XLCellReference.hpp:34
The XLCellValueProxy class is used for proxy (or placeholder) objects for XLCellValue objects.
Definition XLCellValue.hpp:408
Class encapsulating a cell value.
Definition XLCellValue.hpp:79
XLValueType type() const
Get the value type of the current object.
Definition XLCellValue.cpp:94
T get() const
Templated getter.
Definition XLCellValue.hpp:265
An implementation class encapsulating the properties and behaviours of a spreadsheet cell.
Definition XLCell.hpp:41
XLCellValueProxy & value()
Retrieves the mutable value proxy for the cell.
Definition XLCell.cpp:242
std::string getString() const
Definition XLCell.hpp:171
virtual ~XLCell()
Destructor.
This class encapsulates a (non-const) iterator, for iterating over the cells in a row.
Definition XLRowData.hpp:35
This class encapsulate the Excel concept of Shared Strings. In Excel, instead of havig individual str...
Definition XLSharedStrings.hpp:67
A class encapsulating an Excel worksheet. Access to XLWorksheet objects should be via the workbook ob...
Definition XLWorksheet.hpp:118
Definition IZipArchive.hpp:18
bool operator==(const XLCell &lhs, const XLCell &rhs)
Definition XLCell.hpp:304
bool operator!=(const XLCell &lhs, const XLCell &rhs)
Definition XLCell.hpp:311
constexpr const uint32_t XLKeepCellType
Definition XLCell.hpp:28
constexpr const uint32_t XLKeepCellValue
Definition XLCell.hpp:29
size_t XLStyleIndex
Definition XLStyles.hpp:31
constexpr const uint32_t XLKeepCellFormula
Definition XLCell.hpp:30
std::ostream & operator<<(std::ostream &os, const XLCell &c)
ostream output of XLCell content
Definition XLCell.hpp:319
constexpr const uint32_t XLKeepCellStyle
Definition XLCell.hpp:27
std::reference_wrapper< const XLSharedStrings > XLSharedStringsRef
Definition XLSharedStrings.hpp:56
A high-level, human-ergonomic structure representing the styling of a cell or range....
Definition XLStyle.hpp:19