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

The XLAppProperties class represents the extended/application properties (docProps/app.xml). More...

#include <XLProperties.hpp>

Inheritance diagram for OpenXLSX::XLAppProperties:
OpenXLSX::XLXmlFile

Public Member Functions

 XLAppProperties ()=default
 Default constructor.
 XLAppProperties (XLXmlData *xmlData, XMLDocument const &workbookXml)
 Constructor for creating from existing data and workbook.
 XLAppProperties (XLXmlData *xmlData)
 Constructor for existing XML data.
 XLAppProperties (const XLAppProperties &other)=default
 Copy constructor.
 XLAppProperties (XLAppProperties &&other) noexcept=default
 Move constructor.
 ~XLAppProperties ()
 Destructor.
XLAppProperties & operator= (const XLAppProperties &other)=default
 Copy assignment operator.
XLAppProperties & operator= (XLAppProperties &&other) noexcept=default
 Move assignment operator.
void incrementSheetCount (int16_t increment)
 Increment or decrement the worksheet count in HeadingPairs and TitlesOfParts.
void alignWorksheets (const std::vector< std::string > &workbookSheetNames)
 Align the sheet names in TitlesOfParts with the actual workbook sheet names.
void addSheetName (std::string_view title)
 Add a sheet name to TitlesOfParts.
void deleteSheetName (std::string_view title)
 Delete a sheet name from TitlesOfParts.
void setSheetName (std::string_view oldTitle, std::string_view newTitle)
 Update a sheet name in TitlesOfParts.
void addHeadingPair (std::string_view name, int value)
 Add a HeadingPair (e.g., "Worksheets").
void deleteHeadingPair (std::string_view name)
 Delete a HeadingPair.
void setHeadingPair (std::string_view name, int newValue)
 Update a HeadingPair value.
void setProperty (std::string_view name, std::string_view value)
 Set a generic property in app.xml.
std::string property (std::string_view name) const
 Get a property value from app.xml.
void deleteProperty (std::string_view name)
 Delete a property from app.xml.
void appendSheetName (std::string_view sheetName)
 Append a sheet name.
void prependSheetName (std::string_view sheetName)
 Prepend a sheet name.
void insertSheetName (std::string_view sheetName, unsigned int index)
 Insert a sheet name at a specific index.
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 XLAppProperties class represents the extended/application properties (docProps/app.xml).

Constructor & Destructor Documentation

◆ XLAppProperties() [1/5]

OpenXLSX::XLAppProperties::XLAppProperties ( )
default

Default constructor.

◆ XLAppProperties() [2/5]

XLAppProperties::XLAppProperties ( XLXmlData * xmlData,
XMLDocument const & workbookXml )
explicit

Constructor for creating from existing data and workbook.

Parameters
xmlDataPointer to the XML data.
workbookXmlThe workbook XML document.

◆ XLAppProperties() [3/5]

XLAppProperties::XLAppProperties ( XLXmlData * xmlData)
explicit

Constructor for existing XML data.

Parameters
xmlDataPointer to the XML data.

◆ XLAppProperties() [4/5]

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

Copy constructor.

◆ XLAppProperties() [5/5]

OpenXLSX::XLAppProperties::XLAppProperties ( XLAppProperties && other)
defaultnoexcept

Move constructor.

◆ ~XLAppProperties()

XLAppProperties::~XLAppProperties ( )
default

Destructor.

Member Function Documentation

◆ addHeadingPair()

void XLAppProperties::addHeadingPair ( std::string_view name,
int value )

Add a HeadingPair (e.g., "Worksheets").

Parameters
nameThe name of the pair.
valueThe value.

◆ addSheetName()

void XLAppProperties::addSheetName ( std::string_view title)

Add a sheet name to TitlesOfParts.

Parameters
titleThe sheet name.

◆ alignWorksheets()

void XLAppProperties::alignWorksheets ( const std::vector< std::string > & workbookSheetNames)

Align the sheet names in TitlesOfParts with the actual workbook sheet names.

Parameters
workbookSheetNamesVector of sheet names.

◆ appendSheetName()

void XLAppProperties::appendSheetName ( std::string_view sheetName)

Append a sheet name.

Parameters
sheetNameThe name to append.

◆ deleteHeadingPair()

void XLAppProperties::deleteHeadingPair ( std::string_view name)

Delete a HeadingPair.

Parameters
nameThe name of the pair.

◆ deleteProperty()

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

Delete a property from app.xml.

Parameters
nameThe property name.

◆ deleteSheetName()

void XLAppProperties::deleteSheetName ( std::string_view title)

Delete a sheet name from TitlesOfParts.

Parameters
titleThe sheet name.

◆ incrementSheetCount()

void XLAppProperties::incrementSheetCount ( int16_t increment)

Increment or decrement the worksheet count in HeadingPairs and TitlesOfParts.

Parameters
incrementThe change in count.

◆ insertSheetName()

void XLAppProperties::insertSheetName ( std::string_view sheetName,
unsigned int index )

Insert a sheet name at a specific index.

Parameters
sheetNameThe name to insert.
indexThe 1-based index.

◆ operator=() [1/2]

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

Copy assignment operator.

◆ operator=() [2/2]

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

Move assignment operator.

◆ prependSheetName()

void XLAppProperties::prependSheetName ( std::string_view sheetName)

Prepend a sheet name.

Parameters
sheetNameThe name to prepend.

◆ property()

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

Get a property value from app.xml.

Parameters
nameThe property name.
Returns
The property value.

◆ setHeadingPair()

void XLAppProperties::setHeadingPair ( std::string_view name,
int newValue )

Update a HeadingPair value.

Parameters
nameThe name of the pair.
newValueThe new value.

◆ setProperty()

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

Set a generic property in app.xml.

Parameters
nameThe property name.
valueThe value.

◆ setSheetName()

void XLAppProperties::setSheetName ( std::string_view oldTitle,
std::string_view newTitle )

Update a sheet name in TitlesOfParts.

Parameters
oldTitleThe old name.
newTitleThe new name.

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