7namespace Stroika::Foundation::DataExchange::StructuredStreamEvents {
14 inline Name::Name ([[maybe_unused]] NameType type)
17 Require (type == eValue);
19 inline Name::Name (
const String& localName, NameType type)
20 : fLocalName{localName}
24 inline Name::Name (
const String& namespaceURI,
const String& localName, NameType type)
25 : fNamespaceURI{namespaceURI}
26 , fLocalName{localName}
30 inline String Name::ToString ()
const
33 if (fType == NameType::eAttribute) {
36 else if (fType == NameType::eValue) {
40 result += *fNamespaceURI +
":"sv;
45 inline strong_ordering Name::operator<=> (
const Name& rhs)
const
47 return TWC_ (*
this, rhs);
49 inline bool Name::operator== (
const Name& rhs)
const
51 return TWC_ (*
this, rhs) == 0;
53 inline strong_ordering Name::TWC_ (
const Name& lhs,
const Name& rhs)
56 if (lhs.fNamespaceURI.has_value () and rhs.fNamespaceURI.has_value ()) {
57 if (
auto cmp = *lhs.fNamespaceURI <=> *rhs.fNamespaceURI; cmp != strong_ordering::equal) {
61 if (
auto cmp = lhs.fLocalName <=> rhs.fLocalName; cmp != strong_ordering::equal) {
64 return lhs.fType <=> rhs.fType;
Similar to String, but intended to more efficiently construct a String. Mutable type (String is large...
String is like std::u32string, except it is much easier to use, often much more space efficient,...