4#include "Stroika/Frameworks/StroikaPreComp.h"
6#include "Stroika/Foundation/Containers/Mapping.h"
40#if qStroika_Foundation_DataExchange_XML_SupportParsing and qStroika_Foundation_DataExchange_XML_SupportSchema and qStroika_Foundation_DataExchange_XML_SupportDOM
42 DISABLE_COMPILER_GCC_WARNING_START (
"GCC diagnostic ignored \"-Wunused-variable\"");
44#include "service-1-0.xsd.embed"
45 DISABLE_COMPILER_GCC_WARNING_END (
"GCC diagnostic ignored \"-Wunused-variable\"");
51using namespace Stroika::Frameworks;
52using namespace Stroika::Frameworks::UPnP;
58 auto compiled = sCompiled_.
rwget ();
59 const XML::Providers::IXMLProvider* provider = &o.GetProvider ();
60 if (optional<XML::Schema::Ptr> s = compiled->Lookup (provider)) {
63 static constexpr string_view kAsPublished_{
"<xsd:enumeration value=\"1\"/>"sv};
64 static constexpr string_view kWidened_{
"<xsd:enumeration value=\"1\"/><xsd:enumeration value=\"yes\"/><xsd:enumeration value=\"no\"/>"sv};
65 string corrected{
reinterpret_cast<const char*
> (Schemas_service_1_0_xsd), std::size (Schemas_service_1_0_xsd)};
68 [[maybe_unused]]
unsigned nWidened{0};
69 for (
size_t i = corrected.find (kAsPublished_); i != string::npos; i = corrected.find (kAsPublished_, i + kWidened_.length ())) {
70 corrected.replace (i, kAsPublished_.length (), kWidened_);
75 Assert (nWidened == 2);
77 compiled->Add (provider, s);
Wrap any object with Synchronized<> and it can be used similarly to the base type,...
nonvirtual WritableReference rwget()
get a read-write smart pointer to the underlying Synchronized<> object, holding the full lock the who...
How XML is read and written - for now, with which provider - taken last by each XML function (DOM::Do...