OpenXLSX 1.12.1
Modern C++ Excel Library (Fork of OpenXLSX by Kenneth Troldal Balslev)
Loading...
Searching...
No Matches
XLXmlSavingDeclaration.hpp
Go to the documentation of this file.
1/*
2 * OpenXLSX-NX - Modern High-Performance C++ Excel Library
3 *
4 * Original work Copyright (c) 2018-2025, Kenneth Troldal Balslev and OpenXLSX contributors
5 * Modified work Copyright (c) 2026, Curry Tang and OpenXLSX-NX contributors
6 *
7 * Distributed under the BSD 3-Clause License.
8 * See LICENSE.md in the project root or https://opensource.org/licenses/BSD-3-Clause
9 */
10
11#ifndef OPENXLSX_XLXMLSAVINGDECLARATION_HPP
12#define OPENXLSX_XLXMLSAVINGDECLARATION_HPP
13
14#include "OpenXLSX-Exports.hpp"
15#include <string>
16
17namespace OpenXLSX
18{
19 constexpr const char* XLXmlDefaultVersion = "1.0";
20 constexpr const char* XLXmlDefaultEncoding = "UTF-8";
21 constexpr const bool XLXmlStandalone = true;
22 constexpr const bool XLXmlNotStandalone = false;
23
28 class OPENXLSX_EXPORT XLXmlSavingDeclaration
29 {
30 public:
31 // ===== PUBLIC MEMBER FUNCTIONS ===== //
33 XLXmlSavingDeclaration(XLXmlSavingDeclaration const& other) = default; // copy constructor
35 : m_version(std::move(version)),
36 m_encoding(std::move(encoding)),
37 m_standalone(standalone)
38 {}
40
44 [[nodiscard]] std::string const& version() const { return m_version; }
45 [[nodiscard]] std::string const& encoding() const { return m_encoding; }
46 [[nodiscard]] bool standalone_as_bool() const { return m_standalone; }
47 [[nodiscard]] std::string standalone() const { return m_standalone ? "yes" : "no"; }
48
49 private:
50 // ===== PRIVATE MEMBER VARIABLES ===== //
51 std::string m_version;
52 std::string m_encoding;
53 bool m_standalone;
54 };
55} // namespace OpenXLSX
56
57#endif // OPENXLSX_XLXMLSAVINGDECLARATION_HPP
std::string const & encoding() const
Definition XLXmlSavingDeclaration.hpp:45
std::string const & version() const
: getter functions: version, encoding, standalone
Definition XLXmlSavingDeclaration.hpp:44
XLXmlSavingDeclaration(XLXmlSavingDeclaration const &other)=default
bool standalone_as_bool() const
Definition XLXmlSavingDeclaration.hpp:46
XLXmlSavingDeclaration(std::string version, std::string encoding, bool standalone=XLXmlStandalone)
Definition XLXmlSavingDeclaration.hpp:34
std::string standalone() const
Definition XLXmlSavingDeclaration.hpp:47
XLXmlSavingDeclaration()
Definition XLXmlSavingDeclaration.hpp:32
Definition IXLCellProvider.hpp:24
constexpr const bool XLXmlNotStandalone
Definition XLXmlSavingDeclaration.hpp:22
constexpr const char * XLXmlDefaultEncoding
Definition XLXmlSavingDeclaration.hpp:20
constexpr const bool XLXmlStandalone
Definition XLXmlSavingDeclaration.hpp:21
constexpr const char * XLXmlDefaultVersion
Definition XLXmlSavingDeclaration.hpp:19
Definition XLCellIterator.hpp:131