|
OpenXLSX 1.9.1
|
An encapsulation of the XLSX number formats (numFmts) More...
#include <XLStyles.hpp>
Public Member Functions | |
| XLNumberFormats () | |
| XLNumberFormats (const XMLNode &node) | |
| Constructor. New items should only be created through an XLStyles object. | |
| XLNumberFormats (const XLNumberFormats &other) | |
| Copy Constructor. | |
| XLNumberFormats (XLNumberFormats &&other) | |
| Move Constructor. | |
| ~XLNumberFormats () | |
| XLNumberFormats & | operator= (const XLNumberFormats &other) |
| Copy assignment operator. | |
| XLNumberFormats & | operator= (XLNumberFormats &&other) noexcept=default |
| Move assignment operator. | |
| size_t | count () const |
| Get the count of number formats. | |
| XLNumberFormat | numberFormatByIndex (XLStyleIndex index) const |
| Get the number format identified by index. | |
| XLNumberFormat | operator[] (XLStyleIndex index) const |
| Operator overload: allow [] as shortcut access to numberFormatByIndex. | |
| XLNumberFormat | numberFormatById (uint32_t numberFormatId) const |
| Get the number format identified by numberFormatId. | |
| uint32_t | numberFormatIdFromIndex (XLStyleIndex index) const |
| Get the numFmtId from the number format identified by index. | |
| uint32_t | createNumberFormat (std::string_view formatCode) |
| Create a new custom number format with a unique ID. | |
| uint32_t | getFreeNumberFormatId () const |
| Get a free (unused) number format ID, skipping reserved IDs (0-163). | |
| XLStyleIndex | create (XLNumberFormat copyFrom=XLNumberFormat{}, std::string_view styleEntriesPrefix=XLDefaultStyleEntriesPrefix) |
| Append a new XLNumberFormat, based on copyFrom, and return its index in numFmts node. | |
An encapsulation of the XLSX number formats (numFmts)
| XLNumberFormats::XLNumberFormats | ( | ) |
|
explicit |
Constructor. New items should only be created through an XLStyles object.
| node | An XMLNode object with the styles item. If no input is provided, a null node is used. |
| XLNumberFormats::XLNumberFormats | ( | const XLNumberFormats & | other | ) |
Copy Constructor.
| other | Object to be copied. |
| XLNumberFormats::XLNumberFormats | ( | XLNumberFormats && | other | ) |
Move Constructor.
| other | Object to be moved. |
| XLNumberFormats::~XLNumberFormats | ( | ) |
| size_t XLNumberFormats::count | ( | ) | const |
Get the count of number formats.
| XLStyleIndex XLNumberFormats::create | ( | XLNumberFormat | copyFrom = XLNumberFormat{}, |
| std::string_view | styleEntriesPrefix = XLDefaultStyleEntriesPrefix |
||
| ) |
Append a new XLNumberFormat, based on copyFrom, and return its index in numFmts node.
| copyFrom | Can provide an XLNumberFormat to use as template for the new style |
| styleEntriesPrefix | Prefix the newly created cell style XMLNode with this pugi::node_pcdata text |
| uint32_t XLNumberFormats::createNumberFormat | ( | std::string_view | formatCode | ) |
Create a new custom number format with a unique ID.
| formatCode | The explicit format code string |
| uint32_t XLNumberFormats::getFreeNumberFormatId | ( | ) | const |
Get a free (unused) number format ID, skipping reserved IDs (0-163).
| XLNumberFormat XLNumberFormats::numberFormatById | ( | uint32_t | numberFormatId | ) | const |
Get the number format identified by numberFormatId.
| numberFormatId | a numFmtId reference to a number format |
| XLException | if no match for numberFormatId is found within m_numberFormats |
| XLNumberFormat XLNumberFormats::numberFormatByIndex | ( | XLStyleIndex | index | ) | const |
Get the number format identified by index.
| index | an array index within XLStyles::numberFormats() |
| XLException | when index is out of m_numberFormats range |
| uint32_t XLNumberFormats::numberFormatIdFromIndex | ( | XLStyleIndex | index | ) | const |
Get the numFmtId from the number format identified by index.
| index | an array index within XLStyles::numberFormats() |
| XLException | when index is out of m_numberFormats range |
| XLNumberFormats & XLNumberFormats::operator= | ( | const XLNumberFormats & | other | ) |
Copy assignment operator.
| other | Right hand side of assignment operation. |
|
defaultnoexcept |
Move assignment operator.
| other | Right hand side of assignment operation. |
|
inline |
Operator overload: allow [] as shortcut access to numberFormatByIndex.