OpenXLSX 1.9.1
Loading...
Searching...
No Matches
XLXmlSavingDeclaration.hpp
Go to the documentation of this file.
1#ifndef OPENXLSX_XLXMLSAVINGDECLARATION_HPP
2#define OPENXLSX_XLXMLSAVINGDECLARATION_HPP
3
4#include "OpenXLSX-Exports.hpp"
5#include <string>
6
7namespace OpenXLSX
8{
9 constexpr const char* XLXmlDefaultVersion = "1.0";
10 constexpr const char* XLXmlDefaultEncoding = "UTF-8";
11 constexpr const bool XLXmlStandalone = true;
12 constexpr const bool XLXmlNotStandalone = false;
13
18 class OPENXLSX_EXPORT XLXmlSavingDeclaration
19 {
20 public:
21 // ===== PUBLIC MEMBER FUNCTIONS ===== //
23 XLXmlSavingDeclaration(XLXmlSavingDeclaration const& other) = default; // copy constructor
24 XLXmlSavingDeclaration(std::string version, std::string encoding, bool standalone = XLXmlStandalone)
25 : m_version(std::move(version)),
26 m_encoding(std::move(encoding)),
27 m_standalone(standalone)
28 {}
30
34 [[nodiscard]] std::string const& version() const { return m_version; }
35 [[nodiscard]] std::string const& encoding() const { return m_encoding; }
36 [[nodiscard]] bool standalone_as_bool() const { return m_standalone; }
37 [[nodiscard]] std::string standalone() const { return m_standalone ? "yes" : "no"; }
38
39 private:
40 // ===== PRIVATE MEMBER VARIABLES ===== //
41 std::string m_version;
42 std::string m_encoding;
43 bool m_standalone;
44 };
45} // namespace OpenXLSX
46
47#endif // OPENXLSX_XLXMLSAVINGDECLARATION_HPP
The XLXmlSavingDeclaration class encapsulates the properties of an XML saving declaration,...
Definition XLXmlSavingDeclaration.hpp:19
std::string const & encoding() const
Definition XLXmlSavingDeclaration.hpp:35
std::string const & version() const
: getter functions: version, encoding, standalone
Definition XLXmlSavingDeclaration.hpp:34
XLXmlSavingDeclaration(XLXmlSavingDeclaration const &other)=default
bool standalone_as_bool() const
Definition XLXmlSavingDeclaration.hpp:36
XLXmlSavingDeclaration(std::string version, std::string encoding, bool standalone=XLXmlStandalone)
Definition XLXmlSavingDeclaration.hpp:24
std::string standalone() const
Definition XLXmlSavingDeclaration.hpp:37
XLXmlSavingDeclaration()
Definition XLXmlSavingDeclaration.hpp:22
Definition IZipArchive.hpp:18
constexpr const bool XLXmlNotStandalone
Definition XLXmlSavingDeclaration.hpp:12
constexpr const char * XLXmlDefaultEncoding
Definition XLXmlSavingDeclaration.hpp:10
constexpr const bool XLXmlStandalone
Definition XLXmlSavingDeclaration.hpp:11
constexpr const char * XLXmlDefaultVersion
Definition XLXmlSavingDeclaration.hpp:9
Definition XLCellIterator.hpp:121