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

An encapsulation of the XLSX fills. More...

#include <XLStyles.hpp>

Public Member Functions

 XLFills ()
 
 XLFills (const XMLNode &node)
 Constructor. New items should only be created through an XLStyles object.
 
 XLFills (const XLFills &other)
 Copy Constructor.
 
 XLFills (XLFills &&other)
 Move Constructor.
 
 ~XLFills ()
 
XLFillsoperator= (const XLFills &other)
 Copy assignment operator.
 
XLFillsoperator= (XLFills &&other) noexcept=default
 Move assignment operator.
 
size_t count () const
 Get the count of fills.
 
XLFill fillByIndex (XLStyleIndex index) const
 Get the fill entry identified by index.
 
XLFill operator[] (XLStyleIndex index) const
 Operator overload: allow [] as shortcut access to fillByIndex.
 
XLStyleIndex create (XLFill copyFrom=XLFill{}, std::string_view styleEntriesPrefix=XLDefaultStyleEntriesPrefix)
 Append a new XLFill, based on copyFrom, and return its index in fills node.
 
XLStyleIndex findOrCreate (XLFill copyFrom, std::string_view styleEntriesPrefix=XLDefaultStyleEntriesPrefix)
 Find an existing fill matching copyFrom's properties, or create a new one.
 

Detailed Description

An encapsulation of the XLSX fills.

Constructor & Destructor Documentation

◆ XLFills() [1/4]

XLFills::XLFills ( )

◆ XLFills() [2/4]

XLFills::XLFills ( const XMLNode node)
explicit

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

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

◆ XLFills() [3/4]

XLFills::XLFills ( const XLFills other)

Copy Constructor.

Parameters
otherObject to be copied.

◆ XLFills() [4/4]

XLFills::XLFills ( XLFills &&  other)

Move Constructor.

Parameters
otherObject to be moved.

◆ ~XLFills()

XLFills::~XLFills ( )

Member Function Documentation

◆ count()

size_t XLFills::count ( ) const

Get the count of fills.

Returns
The amount of fill entries

◆ create()

XLStyleIndex XLFills::create ( XLFill  copyFrom = XLFill{},
std::string_view  styleEntriesPrefix = XLDefaultStyleEntriesPrefix 
)

Append a new XLFill, based on copyFrom, and return its index in fills node.

Parameters
copyFromCan provide an XLFill 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[]

◆ fillByIndex()

XLFill XLFills::fillByIndex ( XLStyleIndex  index) const

Get the fill entry identified by index.

Parameters
indexThe index within the XML sequence
Returns
An XLFill object

◆ findOrCreate()

XLStyleIndex XLFills::findOrCreate ( XLFill  copyFrom,
std::string_view  styleEntriesPrefix = XLDefaultStyleEntriesPrefix 
)

Find an existing fill matching copyFrom's properties, or create a new one.

Uses a canonical XML fingerprint for O(1) cache lookups after the first call.

◆ operator=() [1/2]

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

Copy assignment operator.

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

◆ operator=() [2/2]

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

Move assignment operator.

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

◆ operator[]()

XLFill OpenXLSX::XLFills::operator[] ( XLStyleIndex  index) const
inline

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

Parameters
indexThe index within the XML sequence
Returns
An XLFill object

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