|
OpenXLSX 1.9.1
|
The purpose of this class is to load, store add and save item in the [Content_Types].xml file. More...
#include <XLContentTypes.hpp>
Public Member Functions | |
| XLContentTypes () | |
| XLContentTypes (gsl::not_null< XLXmlData * > xmlData) | |
| ~XLContentTypes ()=default | |
| XLContentTypes (const XLContentTypes &other) | |
| XLContentTypes (XLContentTypes &&other) noexcept | |
| XLContentTypes & | operator= (const XLContentTypes &other) |
| XLContentTypes & | operator= (XLContentTypes &&other) noexcept |
| bool | hasDefault (std::string_view extension) const |
| Check if a default extension exists. | |
| bool | hasOverride (std::string_view path) const |
| Check if an override exists. | |
| void | addDefault (std::string_view extension, std::string_view contentType) |
| Add a new default extension key/value pair to the data store. | |
| void | addOverride (std::string_view path, XLContentType type) |
| Add a new override key/getValue pair to the data store. | |
| void | updateOverride (std::string_view path, XLContentType type) |
| Update an existing override key/getValue pair or add if it does not exist. | |
| void | deleteOverride (std::string_view path) |
| void | deleteOverride (const XLContentItem &item) |
| void | deleteDefault (std::string_view extension) |
| Delete a default extension from the content types. | |
| XLContentItem | contentItem (std::string_view path) |
| std::vector< XLContentItem > | getContentItems () |
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. | |
| 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. | |
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} |
The purpose of this class is to load, store add and save item in the [Content_Types].xml file.
|
default |
|
explicit |
|
default |
|
default |
|
defaultnoexcept |
| void XLContentTypes::addDefault | ( | std::string_view | extension, |
| std::string_view | contentType | ||
| ) |
Add a new default extension key/value pair to the data store.
| extension | The extension |
| contentType | The content type |
| void XLContentTypes::addOverride | ( | std::string_view | path, |
| XLContentType | type | ||
| ) |
Add a new override key/getValue pair to the data store.
| path | The key |
| type | The getValue |
| XLContentItem XLContentTypes::contentItem | ( | std::string_view | path | ) |
| void XLContentTypes::deleteDefault | ( | std::string_view | extension | ) |
Delete a default extension from the content types.
| extension | The extension to remove (e.g. "bin"). |
| void XLContentTypes::deleteOverride | ( | const XLContentItem & | item | ) |
| void XLContentTypes::deleteOverride | ( | std::string_view | path | ) |
| std::vector< XLContentItem > XLContentTypes::getContentItems | ( | ) |
| bool XLContentTypes::hasDefault | ( | std::string_view | extension | ) | const |
Check if a default extension exists.
| extension | The extension |
| bool XLContentTypes::hasOverride | ( | std::string_view | path | ) | const |
Check if an override exists.
| path | The path |
|
default |
|
defaultnoexcept |
| void XLContentTypes::updateOverride | ( | std::string_view | path, |
| XLContentType | type | ||
| ) |
Update an existing override key/getValue pair or add if it does not exist.
| path | The key |
| type | The getValue |