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

The XLCustomProperties class represents custom user-defined properties (docProps/custom.xml). More...

#include <XLProperties.hpp>

Inheritance diagram for OpenXLSX::XLCustomProperties:
OpenXLSX::XLXmlFile

Public Member Functions

 XLCustomProperties ()=default
 Default constructor.
 XLCustomProperties (XLXmlData *xmlData)
 Constructor for existing XML data.
 XLCustomProperties (const XLCustomProperties &other)=default
 Copy constructor.
 XLCustomProperties (XLCustomProperties &&other) noexcept=default
 Move constructor.
 ~XLCustomProperties ()
 Destructor.
XLCustomProperties & operator= (const XLCustomProperties &other)=default
 Copy assignment operator.
XLCustomProperties & operator= (XLCustomProperties &&other) noexcept=default
 Move assignment operator.
void setProperty (std::string_view name, std::string_view value)
 Set a string custom property (vt:lpwstr).
void setProperty (std::string_view name, const char *value)
 Overload for string literals.
void setProperty (std::string_view name, int value)
 Set an integer custom property (vt:i4).
void setProperty (std::string_view name, double value)
 Set a double custom property (vt:r8).
void setProperty (std::string_view name, bool value)
 Set a boolean custom property (vt:bool).
void setProperty (std::string_view name, const XLDateTime &value)
 Set a date/time custom property (vt:filetime).
std::string property (std::string_view name) const
 Get a custom property value as a string.
void deleteProperty (std::string_view name)
 Delete a custom property.
Public Member Functions inherited from OpenXLSX::XLXmlFile
 XLXmlFile ()=default
 Default constructor.
std::string xmlData (XLXmlSavingDeclaration savingDeclaration=XLXmlSavingDeclaration{}) const
 Method for getting the XML data represented by the object.
 XLXmlFile (XLXmlData *xmlData)
 Constructor. Creates an object based on the xmlData input.
 XLXmlFile (const XLXmlFile &other)=default
 Copy constructor. Default implementation used.
 XLXmlFile (XLXmlFile &&other) noexcept=default
 Move constructor. Default implementation used.
 ~XLXmlFile ()=default
 Destructor. Default implementation used.
bool valid () const
 check whether class is linked to a valid XML file
XLXmlFile & operator= (const XLXmlFile &other)=default
 The copy assignment operator. The default implementation has been used.
XLXmlFile & operator= (XLXmlFile &&other) noexcept=default
 The move assignment operator. The default implementation has been used.
XLDocument & parentDoc ()
 This function provides access to the parent XLDocument object.
const XLDocument & parentDoc () const
 This function provides access to the parent XLDocument object.
XLPackageServices & package ()
 Narrow package-services port (archive, managed XML parts, relationships, content types).
const XLPackageServices & package () const
XLPackagePartFactory & partFactory ()
 Narrow package-part factory port (chart / drawing / image / slicer / sheet accessories).
const XLPackagePartFactory & partFactory () const
const XLSharedStringTable & sharedStringTable () const
 Read-only shared string table (SST) port.
const XLSharedStrings & sharedStrings () const
 Full workbook SST (including getOrCreate / append).
XMLDocument & xmlDocument ()
 This function provides access to the underlying XMLDocument object.
const XMLDocument & xmlDocument () const
 This function provides access to the underlying XMLDocument object.
std::string getXmlPath () const
 Retrieve the path of the XML data in the .xlsx zip archive via m_xmlData->getXmlPath.
const XLXmlData * xmlDataPart () const noexcept
 Access the underlying XLXmlData pointer.
XLXmlData * xmlDataPart () noexcept

Additional Inherited Members

Protected Member Functions inherited from OpenXLSX::XLXmlFile
void setXmlData (std::string_view xmlData)
 Provide the XML data represented by the object.
std::string relationshipID () const
 This function returns the relationship ID (the ID used in the XLRelationships objects) for the object.
Protected Attributes inherited from OpenXLSX::XLXmlFile
XLXmlData * m_xmlData {nullptr}

Detailed Description

The XLCustomProperties class represents custom user-defined properties (docProps/custom.xml).

Constructor & Destructor Documentation

◆ XLCustomProperties() [1/4]

OpenXLSX::XLCustomProperties::XLCustomProperties ( )
default

Default constructor.

◆ XLCustomProperties() [2/4]

XLCustomProperties::XLCustomProperties ( XLXmlData * xmlData)
explicit

Constructor for existing XML data.

Parameters
xmlDataPointer to the XML data.

◆ XLCustomProperties() [3/4]

OpenXLSX::XLCustomProperties::XLCustomProperties ( const XLCustomProperties & other)
default

Copy constructor.

◆ XLCustomProperties() [4/4]

OpenXLSX::XLCustomProperties::XLCustomProperties ( XLCustomProperties && other)
defaultnoexcept

Move constructor.

◆ ~XLCustomProperties()

XLCustomProperties::~XLCustomProperties ( )
default

Destructor.

Member Function Documentation

◆ deleteProperty()

void XLCustomProperties::deleteProperty ( std::string_view name)

Delete a custom property.

Parameters
nameThe property name.

◆ operator=() [1/2]

XLCustomProperties & OpenXLSX::XLCustomProperties::operator= ( const XLCustomProperties & other)
default

Copy assignment operator.

◆ operator=() [2/2]

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

Move assignment operator.

◆ property()

std::string XLCustomProperties::property ( std::string_view name) const

Get a custom property value as a string.

Parameters
nameThe property name.
Returns
The value as string.

◆ setProperty() [1/6]

void XLCustomProperties::setProperty ( std::string_view name,
bool value )

Set a boolean custom property (vt:bool).

Parameters
nameThe property name.
valueThe value.

◆ setProperty() [2/6]

void XLCustomProperties::setProperty ( std::string_view name,
const char * value )

Overload for string literals.

Parameters
nameThe property name.
valueThe literal value.

◆ setProperty() [3/6]

void XLCustomProperties::setProperty ( std::string_view name,
const XLDateTime & value )

Set a date/time custom property (vt:filetime).

Parameters
nameThe property name.
valueThe XLDateTime value.

◆ setProperty() [4/6]

void XLCustomProperties::setProperty ( std::string_view name,
double value )

Set a double custom property (vt:r8).

Parameters
nameThe property name.
valueThe value.

◆ setProperty() [5/6]

void XLCustomProperties::setProperty ( std::string_view name,
int value )

Set an integer custom property (vt:i4).

Parameters
nameThe property name.
valueThe value.

◆ setProperty() [6/6]

void XLCustomProperties::setProperty ( std::string_view name,
std::string_view value )

Set a string custom property (vt:lpwstr).

Parameters
nameThe property name.
valueThe value.

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