OpenXLSX 1.9.1
Loading...
Searching...
No Matches
XLXmlFile.hpp
Go to the documentation of this file.
1#ifndef OPENXLSX_XLXMLFILE_HPP
2#define OPENXLSX_XLXMLFILE_HPP
3
4#ifdef _MSC_VER // conditionally enable MSVC specific pragmas to avoid other compilers warning about unknown pragmas
5# pragma warning(push)
6# pragma warning(disable : 4251)
7# pragma warning(disable : 4275)
8#endif // _MSC_VER
9
10// ===== External Includes ===== //
11#include <gsl/gsl>
12
13// ===== OpenXLSX Includes ===== //
14#include "OpenXLSX-Exports.hpp"
15#include "XLXmlParser.hpp"
17
18namespace OpenXLSX
19{
20 class XLXmlData;
21 class XLDocument;
22
27 class OPENXLSX_EXPORT XLUnsupportedElement
28 {
29 public:
31 bool empty() const { return true; }
32 std::string summary() const { return "XLUnsupportedElement"; }
33 };
34
41 class OPENXLSX_EXPORT XLXmlFile
42 {
43 public: // ===== PUBLIC MEMBER FUNCTIONS
47 XLXmlFile() = default;
48
54 std::string xmlData(XLXmlSavingDeclaration savingDeclaration = XLXmlSavingDeclaration{}) const;
55
60 explicit XLXmlFile(XLXmlData* xmlData);
61
66 XLXmlFile(const XLXmlFile& other) = default;
67
72 XLXmlFile(XLXmlFile&& other) noexcept = default;
73
77 ~XLXmlFile() = default;
78
86 bool valid() const { return m_xmlData != nullptr; }
87
93 XLXmlFile& operator=(const XLXmlFile& other) = default;
94
100 XLXmlFile& operator=(XLXmlFile&& other) noexcept = default;
101
106 XLDocument& parentDoc();
107
112 const XLDocument& parentDoc() const;
113
118 XMLDocument& xmlDocument();
119
124 const XMLDocument& xmlDocument() const;
125
130 std::string getXmlPath() const;
131
132 protected: // ===== PROTECTED MEMBER FUNCTIONS
137 void setXmlData(std::string_view xmlData);
138
144 std::string relationshipID() const;
145
146 protected: // ===== PROTECTED MEMBER VARIABLES
147 XLXmlData* m_xmlData{nullptr};
148 };
149} // namespace OpenXLSX
150
151#ifdef _MSC_VER // conditionally enable MSVC specific pragmas to avoid other compilers warning about unknown pragmas
152# pragma warning(pop)
153#endif // _MSC_VER
154
155#endif // OPENXLSX_XLXMLFILE_HPP
XLXmlData * xmlData
Definition XLDocument.cpp:1422
Definition XLXmlParser.hpp:241
This class encapsulates the concept of an excel file. It is different from the XLWorkbook,...
Definition XLDocument.hpp:82
The XLUnsupportedElement class provides a stub implementation that can be used as function parameter ...
Definition XLXmlFile.hpp:28
XLUnsupportedElement()
Definition XLXmlFile.hpp:30
std::string summary() const
Definition XLXmlFile.hpp:32
bool empty() const
Definition XLXmlFile.hpp:31
The XLXmlData class encapsulates the properties and behaviour of the .xml files in an ....
Definition XLXmlData.hpp:29
The XLXmlFile class provides an interface for derived classes to use. It functions as an ancestor to ...
Definition XLXmlFile.hpp:42
~XLXmlFile()=default
Destructor. Default implementation used.
bool valid() const
check whether class is linked to a valid XML file
Definition XLXmlFile.hpp:86
XLXmlFile & operator=(const XLXmlFile &other)=default
The copy assignment operator. The default implementation has been used.
XLXmlFile(XLXmlFile &&other) noexcept=default
Move constructor. Default implementation used.
XLXmlFile(const XLXmlFile &other)=default
Copy constructor. Default implementation used.
XLXmlFile & operator=(XLXmlFile &&other) noexcept=default
The move assignment operator. The default implementation has been used.
XLXmlFile()=default
Default constructor.
The XLXmlSavingDeclaration class encapsulates the properties of an XML saving declaration,...
Definition XLXmlSavingDeclaration.hpp:19
Definition IZipArchive.hpp:18