OpenXLSX 1.9.1
Loading...
Searching...
No Matches
OpenXLSX::XLCellStyles Class Reference

An encapsulation of the XLSX cell styles. More...

#include <XLStyles.hpp>

Public Member Functions

 XLCellStyles ()
 
 XLCellStyles (const XMLNode &node)
 Constructor. New items should only be created through an XLStyles object.
 
 XLCellStyles (const XLCellStyles &other)
 Copy Constructor.
 
 XLCellStyles (XLCellStyles &&other)
 Move Constructor.
 
 ~XLCellStyles ()
 
XLCellStylesoperator= (const XLCellStyles &other)
 Copy assignment operator.
 
XLCellStylesoperator= (XLCellStyles &&other) noexcept=default
 Move assignment operator.
 
size_t count () const
 Get the count of cell styles.
 
XLCellStyle cellStyleByIndex (XLStyleIndex index) const
 Get the cell style identified by index.
 
XLCellStyle operator[] (XLStyleIndex index) const
 Operator overload: allow [] as shortcut access to cellStyleByIndex.
 
XLStyleIndex create (XLCellStyle copyFrom=XLCellStyle{}, std::string_view styleEntriesPrefix=XLDefaultStyleEntriesPrefix)
 Append a new XLCellStyle, based on copyFrom, and return its index in cellStyles node.
 

Detailed Description

An encapsulation of the XLSX cell styles.

Constructor & Destructor Documentation

◆ XLCellStyles() [1/4]

XLCellStyles::XLCellStyles ( )

◆ XLCellStyles() [2/4]

XLCellStyles::XLCellStyles ( const XMLNode node)
explicit

Constructor. New items should only be created through an XLStyles object.

Parameters
nodeAn XMLNode object with the cellStyles item. If no input is provided, a null node is used.

◆ XLCellStyles() [3/4]

XLCellStyles::XLCellStyles ( const XLCellStyles other)

Copy Constructor.

Parameters
otherObject to be copied.

◆ XLCellStyles() [4/4]

XLCellStyles::XLCellStyles ( XLCellStyles &&  other)

Move Constructor.

Parameters
otherObject to be moved.

◆ ~XLCellStyles()

XLCellStyles::~XLCellStyles ( )

Member Function Documentation

◆ cellStyleByIndex()

XLCellStyle XLCellStyles::cellStyleByIndex ( XLStyleIndex  index) const

Get the cell style identified by index.

Returns
An XLCellStyle object

◆ count()

size_t XLCellStyles::count ( ) const

Get the count of cell styles.

Returns
The amount of entries in the cell styles

◆ create()

XLStyleIndex XLCellStyles::create ( XLCellStyle  copyFrom = XLCellStyle{},
std::string_view  styleEntriesPrefix = XLDefaultStyleEntriesPrefix 
)

Append a new XLCellStyle, based on copyFrom, and return its index in cellStyles node.

Parameters
copyFromCan provide an XLCellStyle to use as template for the new style
styleEntriesPrefixPrefix the newly created cell style XMLNode with this pugi::node_pcdata text
Returns
The index of the new style as used by operator[]

◆ operator=() [1/2]

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

Copy assignment operator.

Parameters
otherRight hand side of assignment operation.
Returns
A reference to the lhs object.

◆ operator=() [2/2]

XLCellStyles & OpenXLSX::XLCellStyles::operator= ( XLCellStyles &&  other)
defaultnoexcept

Move assignment operator.

Parameters
otherRight hand side of assignment operation.
Returns
A reference to lhs object.

◆ operator[]()

XLCellStyle OpenXLSX::XLCellStyles::operator[] ( XLStyleIndex  index) const
inline

Operator overload: allow [] as shortcut access to cellStyleByIndex.

Parameters
indexThe index within the XML sequence
Returns
An XLCellStyle object

The documentation for this class was generated from the following files: