4#ifndef _Stroika_Foundation_DataExchange_Variant_XML_Binding_h_
5#define _Stroika_Foundation_DataExchange_Variant_XML_Binding_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
12#include "Stroika/Foundation/Containers/Mapping.h"
13#include "Stroika/Foundation/Containers/Sequence.h"
15#include "Stroika/Foundation/DataExchange/XML/Namespace.h"
24namespace Stroika::Foundation::DataExchange::Variant::XML {
26 using Characters::String;
27 using Containers::Mapping;
28 using Containers::Sequence;
29 using DataExchange::XML::NameWithNamespace;
30 using IO::Network::URI;
95 shared_ptr<Binding> fBinding;
100 bool operator== (
const Member& rhs)
const;
122 Kind fKind{Kind::eElement};
393 nonvirtual optional<String> WhyIncomplete_ ()
const;
395 nonvirtual
String ToString_ (
bool top)
const;
String is like std::u32string, except it is much easier to use, often much more space efficient,...
A Mapping uniquely associates two elements: a key and a value (use Assocation to allow multiple value...
A generalization of a vector: a container whose elements are keyed by the natural numbers.
One member of an object: its key, and how that member differs from the default shape (nothing,...
nonvirtual String ToString() const
How a VariantValue is to be written as XML, and read back, where the default shape (.
bool operator==(const Binding &rhs) const
Equal where every field is - fItems and fDefaultArrayItems by the Bindings they point to,...
nonvirtual bool IsComplete() const
Whether, given this Binding as the top level Binding (the one a Reader or Writer is given),...
nonvirtual String KeyForName(Kind kind, const String &name) const
Reading: the key of the member of that kind (an element - or presence marker - or an attribute) writt...
static const Binding kDefaultArrayItems
The Binding each item of an array is written with where neither fItems nor fDefaultArrayItems gives o...
nonvirtual optional< String > TextMemberKey() const
Reading: the key of the member that is this element's text, if one is.
Sequence< Member > fMembers
nonvirtual Kind KindFor(const String &key) const
That member's kind: its Binding's, else an element.
nonvirtual NameWithNamespace NameFor(const String &key) const
The name that member is written with: its Binding's fName, else its own key.
optional< VariantValue::Type > fType
nonvirtual UndeclaredMembers GetUndeclaredMembers() const
fUndeclaredMembers, or its default: eReject where fType is declared, eKeep where not
UndeclaredMembers
What an object does with a member fMembers does not declare - an element or attribute in a document,...
nonvirtual String ToString() const
Mapping< URI, String > fNamespacePrefixes
A prefix for each of these namespaces, declared on this element (xmlns:p=) and used for every element...
shared_ptr< Binding > fItems
static const Binding kRepeatedArrayItems
An item Binding with no name, so no element of the items' own: the member's own element is repeated,...
optional< NameWithNamespace > fName
nonvirtual const Binding * MemberBinding(const String &key) const
The Binding for the member of this object with that key - nullptr where it has none,...
shared_ptr< Binding > fDefaultArrayItems
The Binding each item of an array is written with, where the array's own Binding has no fItems: its f...
optional< UndeclaredMembers > fUndeclaredMembers
An element's or attribute's name (local-name, not including a prefix), plus the namespace that name i...