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

An encapsulation of the XLSX borders. More...

#include <XLStyles.hpp>

Public Member Functions

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

Detailed Description

An encapsulation of the XLSX borders.

Constructor & Destructor Documentation

◆ XLBorders() [1/4]

XLBorders::XLBorders ( )

◆ XLBorders() [2/4]

XLBorders::XLBorders ( const XMLNode node)
explicit

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

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

◆ XLBorders() [3/4]

XLBorders::XLBorders ( const XLBorders other)

Copy Constructor.

Parameters
otherObject to be copied.

◆ XLBorders() [4/4]

XLBorders::XLBorders ( XLBorders &&  other)

Move Constructor.

Parameters
otherObject to be moved.

◆ ~XLBorders()

XLBorders::~XLBorders ( )

Member Function Documentation

◆ borderByIndex()

XLBorder XLBorders::borderByIndex ( XLStyleIndex  index) const

Get the border description identified by index.

Parameters
indexThe index within the XML sequence
Returns
An XLBorder object

◆ count()

size_t XLBorders::count ( ) const

Get the count of border descriptions.

Returns
The amount of border description entries

◆ create()

XLStyleIndex XLBorders::create ( XLBorder  copyFrom = XLBorder{},
std::string_view  styleEntriesPrefix = XLDefaultStyleEntriesPrefix 
)

Append a new XLBorder, based on copyFrom, and return its index in borders node.

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

◆ findOrCreate()

XLStyleIndex XLBorders::findOrCreate ( XLBorder  copyFrom,
std::string_view  styleEntriesPrefix = XLDefaultStyleEntriesPrefix 
)

Find an existing border 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]

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

Copy assignment operator.

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

◆ operator=() [2/2]

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

Move assignment operator.

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

◆ operator[]()

XLBorder OpenXLSX::XLBorders::operator[] ( XLStyleIndex  index) const
inline

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

Parameters
indexThe index within the XML sequence
Returns
An XLBorder object

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