11#ifndef OPENXLSX_XLXMLDATA_HPP
12#define OPENXLSX_XLXMLDATA_HPP
16# pragma warning(disable : 4251)
17# pragma warning(disable : 4275)
27#include "OpenXLSX-Exports.hpp"
100 const std::string& xmlPath,
101 const std::string& xmlId =
"",
115 bool valid()
const {
return m_xmlDoc !=
nullptr; }
174 XLDocument* getParentDoc();
180 const XLDocument* getParentDoc()
const;
186 std::string getXmlPath()
const;
192 std::string getXmlID()
const;
198 XLContentType getXmlType()
const;
204 XMLDocument* getXmlDocument();
210 const XMLDocument* getXmlDocument()
const;
215 [[nodiscard]]
bool isDirty() const noexcept {
return m_isDirty; }
230 [[nodiscard]]
bool isLoaded() const noexcept {
return m_isLoaded; }
242 std::string m_xmlPath{};
243 std::string m_xmlID{};
245 mutable std::unique_ptr<XMLDocument> m_xmlDoc;
246 mutable bool m_isDirty{
false};
247 mutable bool m_isLoaded{
false};
This class encapsulates the concept of an excel file. It is different from the XLWorkbook,...
Definition XLDocument.hpp:97
bool valid() const
check whether class is linked to a valid XML document
Definition XLXmlData.hpp:115
uint16_t m_streamMaxCol
Definition XLXmlData.hpp:257
XLXmlData(XLXmlData &&other) noexcept=default
Move constructor. All data members are trivially movable. Hence an explicitly defaulted move construc...
std::string m_streamFilePath
Definition XLXmlData.hpp:250
uint32_t m_streamLastRow
Definition XLXmlData.hpp:256
bool m_streamWriterOpen
Definition XLXmlData.hpp:254
bool m_isStreamed
Definition XLXmlData.hpp:249
std::string m_streamMemory
Definition XLXmlData.hpp:252
void setRawData(const std::string &data)
Set the raw data for the underlying XML document. Being able to set the XML data directly is useful w...
Definition XLXmlData.cpp:90
std::string getRawData(XLXmlSavingDeclaration savingDeclaration=XLXmlSavingDeclaration{}) const
Get the raw data for the underlying XML document. This function will retrieve the raw XML text data f...
Definition XLXmlData.cpp:104
XLXmlData & operator=(XLXmlData &&other) noexcept=default
Move assignment operator. All data members are trivially movable. Hence an explicitly defaulted move ...
XLXmlData(const XLXmlData &other)=delete
Copy constructor. The m_xmlDoc data member is a XMLDocument object, which is non-copyable....
XLXmlData & operator=(const XLXmlData &other)=delete
Copy assignment operator. The m_xmlDoc data member is a XMLDocument object, which is non-copyable....
void markDirty() noexcept
Mark this XML part as modified.
Definition XLXmlData.hpp:220
bool empty() const
Test whether there is an XML file linked to this object.
XLXmlData()=default
Default constructor. All member variables are default constructed. Except for the raw XML data,...
~XLXmlData()
Default destructor. The XLXmlData does not manage any dynamically allocated resources,...
void markClean() noexcept
Reset the dirty state of this XML part.
Definition XLXmlData.hpp:225
bool isLoaded() const noexcept
Check whether the underlying XML document DOM has been loaded into memory.
Definition XLXmlData.hpp:230
bool isDirty() const noexcept
Check whether this XML part has been modified since loaded or last saved.
Definition XLXmlData.hpp:215
The XLXmlSavingDeclaration class encapsulates the properties of an XML saving declaration,...
Definition XLXmlSavingDeclaration.hpp:29
Definition IXLCellProvider.hpp:24
XLContentType
Definition XLContentTypes.hpp:38
@ Unknown
Definition XLContentTypes.hpp:62
Auto-managed malloc memory for Zero-Copy serialization.
Definition XLXmlData.hpp:37
XLAllocatedMemory(const XLAllocatedMemory &)=delete
XLAllocatedMemory(XLAllocatedMemory &&other) noexcept
Definition XLXmlData.hpp:49
void * data
Definition XLXmlData.hpp:38
~XLAllocatedMemory()
Definition XLXmlData.hpp:41
XLAllocatedMemory & operator=(XLAllocatedMemory &&other) noexcept
Definition XLXmlData.hpp:53
XLAllocatedMemory & operator=(const XLAllocatedMemory &)=delete
size_t size
Definition XLXmlData.hpp:39
XLAllocatedMemory()=default
void * release()
Definition XLXmlData.hpp:65