OpenXLSX 1.12.1
Modern C++ Excel Library (Fork of OpenXLSX by Kenneth Troldal Balslev)
Loading...
Searching...
No Matches
OpenXLSX::XLCellAssignable Class Reference

#include <XLCell.hpp>

Inheritance diagram for OpenXLSX::XLCellAssignable:
OpenXLSX::XLCell

Public Member Functions

 XLCellAssignable ()
 Default constructor. Constructs a null object.
 XLCellAssignable (XLCell const &other)
 Copy constructor. Constructs an assignable XLCell from an existing cell.
 XLCellAssignable (XLCellAssignable const &other)
 XLCellAssignable (XLCell &&other)
 Move constructor. Constructs an assignable XLCell from a temporary (r)value.
 XLCellAssignable (XLCellAssignable &&other) noexcept
XLCellAssignable & operator= (const XLCell &other) override
 Copy assignment operator.
XLCellAssignable & operator= (const XLCellAssignable &other)
XLCellAssignable & operator= (XLCell &&other) noexcept override
 Move assignment operator -> overrides XLCell copy operator, becomes a copy operator.
XLCellAssignable & operator= (XLCellAssignable &&other) noexcept
XLCellAssignable & addNote (std::string_view text, std::string_view author="")
XLCellAssignable & setCellFormat (XLStyleIndex cellFormatIndex)
XLCellAssignable & setStyle (const XLStyle &style)
template<typename T, typename = std::enable_if_t< std::is_integral_v<T> or std::is_floating_point_v<T> or std::is_same_v<std::decay_t<T>, std::string> || std::is_same_v<std::decay_t<T>, std::string_view> or std::is_same_v<std::decay_t<T>, const char*> || std::is_same_v<std::decay_t<T>, char*> or std::is_same_v<T, XLDateTime>>>
XLCellAssignable & operator= (T value)
 Templated assignment operator.
Public Member Functions inherited from OpenXLSX::XLCell
 XLCell ()
 Default constructor. Constructs a null object.
 XLCell (const XMLNode &cellNode, const XLSharedStrings &sharedStrings, XLWorksheet *wks=nullptr)
 Constructs an XLCell mapped to an XML node.
 XLCell (const XLCell &other)
 Copy constructor.
 XLCell (XLCell &&other) noexcept
 Move constructor.
virtual ~XLCell ()
 Destructor.
void copyFrom (XLCell const &other)
 Copy contents of a cell, value & formula.
bool empty () const
 test if cell object has no (valid) content
 operator bool () const
 opposite of empty()
void clear (uint32_t keep)
 clear all cell content and attributes except for the cell reference (attribute r)
XLCellValueProxy & value ()
 Retrieves the mutable value proxy for the cell.
const XLCellValueProxy & value () const
 Retrieves the read-only value proxy for the cell.
XLCellReference cellReference () const
 get the XLCellReference object for the cell.
XLCell offset (uint16_t rowOffset, uint16_t colOffset) const
 get the XLCell object from the current cell offset
bool hasFormula () const
 test if cell has a formula (XML) node, even if it is an empty string
XLFormulaProxy & formula ()
 Retrieves the mutable formula proxy for the cell.
const XLFormulaProxy & formula () const
 Retrieves the read-only formula proxy for the cell.
std::string getString () const
XLStyleIndex cellFormat () const
 Get the array index of xl/styles.xml:<styleSheet>:<cellXfs> for the style used in this cell. This value is stored in the s attribute of a cell like so: s="2".
XLCell & setCellFormat (XLStyleIndex cellFormatIndex)
 Set the cell style (attribute s) with a reference to the array index of xl/styles.xml:<styleSheet>:<cellXfs>.
XLCell & setStyle (const XLStyle &style)
 Apply a high-level XLStyle to this cell. Automatically creates or reuses the required underlying XML structures in xl/styles.xml.
XLThreadedComment addComment (std::string_view text, std::string_view author="")
 Add a modern threaded comment (Excel 365) to this cell fluently.
XLCell & addNote (std::string_view text, std::string_view author="")
 Add a legacy yellow note to this cell fluently.
void print (std::basic_ostream< char > &ostr) const
 Print the XML contents of the XLCell using the underlying XMLNode print function.

Constructor & Destructor Documentation

◆ XLCellAssignable() [1/5]

OpenXLSX::XLCellAssignable::XLCellAssignable ( )
inline

Default constructor. Constructs a null object.

◆ XLCellAssignable() [2/5]

XLCellAssignable::XLCellAssignable ( XLCell const & other)

Copy constructor. Constructs an assignable XLCell from an existing cell.

Parameters
otherthe cell to construct from

◆ XLCellAssignable() [3/5]

XLCellAssignable::XLCellAssignable ( XLCellAssignable const & other)

◆ XLCellAssignable() [4/5]

XLCellAssignable::XLCellAssignable ( XLCell && other)

Move constructor. Constructs an assignable XLCell from a temporary (r)value.

Parameters
otherthe cell to construct from

◆ XLCellAssignable() [5/5]

XLCellAssignable::XLCellAssignable ( XLCellAssignable && other)
noexcept

Member Function Documentation

◆ addNote()

XLCellAssignable & OpenXLSX::XLCellAssignable::addNote ( std::string_view text,
std::string_view author = "" )
inline

◆ operator=() [1/5]

XLCellAssignable & XLCellAssignable::operator= ( const XLCell & other)
overridevirtual

Copy assignment operator.

Parameters
otherThe XLCell object to be copy assigned
Returns
A reference to the new object
Note
Copies only the cell contents, not the pointer to parent worksheet etc.

Reimplemented from OpenXLSX::XLCell.

◆ operator=() [2/5]

XLCellAssignable & XLCellAssignable::operator= ( const XLCellAssignable & other)

◆ operator=() [3/5]

template<typename T, typename = std::enable_if_t< std::is_integral_v<T> or std::is_floating_point_v<T> or std::is_same_v<std::decay_t<T>, std::string> || std::is_same_v<std::decay_t<T>, std::string_view> or std::is_same_v<std::decay_t<T>, const char*> || std::is_same_v<std::decay_t<T>, char*> or std::is_same_v<T, XLDateTime>>>
XLCellAssignable & OpenXLSX::XLCellAssignable::operator= ( T value)
inline

Templated assignment operator.

Template Parameters
TThe type of the value argument.
Parameters
valueThe value.
Returns
A reference to the assigned-to object.

◆ operator=() [4/5]

XLCellAssignable & XLCellAssignable::operator= ( XLCell && other)
overridevirtualnoexcept

Move assignment operator -> overrides XLCell copy operator, becomes a copy operator.

Parameters
otherThe XLCell object to be copy assigned
Returns
A reference to the new object
Note
Copies only the cell contents, not the pointer to parent worksheet etc.

Reimplemented from OpenXLSX::XLCell.

◆ operator=() [5/5]

XLCellAssignable & XLCellAssignable::operator= ( XLCellAssignable && other)
noexcept

◆ setCellFormat()

XLCellAssignable & OpenXLSX::XLCellAssignable::setCellFormat ( XLStyleIndex cellFormatIndex)
inline

◆ setStyle()

XLCellAssignable & OpenXLSX::XLCellAssignable::setStyle ( const XLStyle & style)
inline

The documentation for this class was generated from the following files:
  • /home/runner/work/OpenXLSX-NX/OpenXLSX-NX/OpenXLSX/headers/XLCell.hpp
  • /home/runner/work/OpenXLSX-NX/OpenXLSX-NX/OpenXLSX/sources/XLCell.cpp