1#ifndef OPENXLSX_XLRELATIONSHIPS_HPP
2#define OPENXLSX_XLRELATIONSHIPS_HPP
6# pragma warning(disable : 4251)
7# pragma warning(disable : 4275)
11#include <gsl/pointers>
17#include "OpenXLSX-Exports.hpp"
37 extern thread_local std::mt19937
Rand32;
53 class XLRelationshipItem;
129 [[nodiscard]] std::string target()
const;
131 [[nodiscard]] std::string id()
const;
133 [[nodiscard]]
bool empty()
const;
163 [[nodiscard]]
XLRelationshipItem relationshipByTarget(std::string_view target,
bool throwIfNotFound =
true)
const;
165 [[nodiscard]] std::vector<XLRelationshipItem> relationships()
const;
167 void deleteRelationship(std::string_view relID);
176 [[nodiscard]]
bool targetExists(std::string_view target)
const;
177 [[nodiscard]]
bool idExists(std::string_view
id)
const;
182 void print(std::basic_ostream<char>& ostr)
const;
XLXmlData * xmlData
Definition XLDocument.cpp:1422
return XLRelationships(xmlData, relsFilename)
Definition XLXmlParser.hpp:84
Definition XLRelationships.hpp:109
XLRelationshipItem()=default
XLRelationshipItem & operator=(const XLRelationshipItem &other)=default
XLRelationshipItem(const XLRelationshipItem &other)=default
XLRelationshipItem(XLRelationshipItem &&other) noexcept=default
XLRelationshipItem & operator=(XLRelationshipItem &&other) noexcept=default
~XLRelationshipItem()=default
Definition XLRelationships.hpp:140
XLRelationships(XLRelationships &&other) noexcept=default
XLRelationships & operator=(const XLRelationships &other)=default
XLRelationships()=default
XLRelationships(const XLRelationships &other)=default
XLRelationships & operator=(XLRelationships &&other) noexcept=default
The XLXmlFile class provides an interface for derived classes to use. It functions as an ancestor to ...
Definition XLXmlFile.hpp:42
Definition XLRelationships.hpp:97
std::string GetStringFromType(XLRelationshipType type)
helper function, used only within module and from XLProperties.cpp / XLAppProperties::createFromTempl...
Definition XLRelationships.cpp:136
Definition IZipArchive.hpp:18
void InitRandom(bool pseudoRandom=false)
Initialize XLRand32 data source.
Definition XLRelationships.cpp:56
XLRelationshipType
An enum of the possible relationship (or XML document) types used in relationship (....
Definition XLRelationships.hpp:58
uint64_t Rand64()
Return a 64 bit random value (by invoking Rand32 twice)
Definition XLRelationships.cpp:48
void UseRandomIDs()
Enable use of random (relationship) IDs.
Definition XLRelationships.cpp:33
thread_local std::mt19937 Rand32
Return a 32 bit random value.
void UseSequentialIDs()
Disable use of random (relationship) IDs (default behavior)
Definition XLRelationships.cpp:38