Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
Loading...
Searching...
No Matches
donner::xml::XMLQualifiedName Struct Reference

Represents an XML attribute name with an optional namespace. More...

#include "donner/base/xml/XMLQualifiedName.h"

Public Member Functions

 XMLQualifiedName (const RcString &name)
 Construct from an attribute with an empty (default) namespace.
 XMLQualifiedName (const char *name)
 Construct from an attribute with an empty (default) namespace.
 XMLQualifiedName (std::string_view name)
 Construct from an attribute with an empty (default) namespace.
 XMLQualifiedName (const RcString &namespacePrefix, const RcString &name)
 Construct from an attribute with a namespace prefix.
 XMLQualifiedName (const XMLQualifiedNameRef &attr)
 Construct by copying from a qualified-name reference.
 ~XMLQualifiedName ()=default
 Destructor.
 XMLQualifiedName (XMLQualifiedName &&)=default
 Move constructor.
 XMLQualifiedName (const XMLQualifiedName &)=default
 Copy constructor.
XMLQualifiedNameoperator= (XMLQualifiedName &&)=default
 Move assignment operator.
XMLQualifiedNameoperator= (const XMLQualifiedName &)=default
 Copy assignment operator.
std::strong_ordering operator<=> (const XMLQualifiedName &other) const
 Comparison operator.
bool operator== (const XMLQualifiedName &other) const =default
 Equality operator for gtest.
std::string toString () const
 Convert to string operator using XML syntax (e.g. "ns:name").
details::DeferredCssSyntaxPrinter< XMLQualifiedNameprintCssSyntax () const
 When used in an ostream output stream, prints the qualified name as a CSS selector (e.g.

Public Attributes

RcString namespacePrefix
 The namespace prefix of the attribute, or an empty string if no namespace (default namespace).
RcString name
 The attribute name.

Friends

bool operator== (const XMLQualifiedName &lhs, std::string_view rhs)
 Compare against an unqualified name string in the default namespace.
bool operator== (std::string_view lhs, const XMLQualifiedName &rhs)
 Compare against an unqualified name string in the default namespace.
std::ostream & operator<< (std::ostream &os, const XMLQualifiedName &obj)
 Ostream output operator using XML syntax (e.g. "ns:name").

Detailed Description

Represents an XML attribute name with an optional namespace.

Constructor & Destructor Documentation

◆ XMLQualifiedName() [1/5]

donner::xml::XMLQualifiedName::XMLQualifiedName ( const RcString & name)
inline

Construct from an attribute with an empty (default) namespace.

Parameters
nameThe attribute name.

◆ XMLQualifiedName() [2/5]

donner::xml::XMLQualifiedName::XMLQualifiedName ( const char * name)
inlineexplicit

Construct from an attribute with an empty (default) namespace.

Parameters
nameThe attribute name.

◆ XMLQualifiedName() [3/5]

donner::xml::XMLQualifiedName::XMLQualifiedName ( std::string_view name)
inlineexplicit

Construct from an attribute with an empty (default) namespace.

Parameters
nameThe attribute name.

◆ XMLQualifiedName() [4/5]

donner::xml::XMLQualifiedName::XMLQualifiedName ( const RcString & namespacePrefix,
const RcString & name )
inline

Construct from an attribute with a namespace prefix.

Parameters
namespacePrefixThe namespace of the name, or empty if the name belongs to the default namespace.
nameThe attribute name.

◆ XMLQualifiedName() [5/5]

donner::xml::XMLQualifiedName::XMLQualifiedName ( const XMLQualifiedNameRef & attr)
inlineexplicit

Construct by copying from a qualified-name reference.

Parameters
attrQualified name reference to copy from.

Member Function Documentation

◆ printCssSyntax()

details::DeferredCssSyntaxPrinter< XMLQualifiedName > donner::xml::XMLQualifiedName::printCssSyntax ( ) const
inline

When used in an ostream output stream, prints the qualified name as a CSS selector (e.g.

"ns|name").

Example usage:

std::cout << name.printCssSyntax() << "\n";
XMLQualifiedName(const RcString &name)
Construct from an attribute with an empty (default) namespace.
Definition XMLQualifiedName.h:64
RcString name
The attribute name.
Definition XMLQualifiedName.h:57

The documentation for this struct was generated from the following file: