Donner
C++20 SVG rendering library
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"

Collaboration diagram for donner::xml::XMLQualifiedName:
[legend]

Public Member Functions

constexpr XMLQualifiedName (const RcString &name)
 Construct from an attribute with an empty (default) namespace.
 
constexpr XMLQualifiedName (const RcString &namespacePrefix, const RcString &name)
 Construct from an attribute with a namespace prefix.
 
 ~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").
 
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

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/2]

constexpr donner::xml::XMLQualifiedName::XMLQualifiedName ( const RcString & name)
inlineconstexpr

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

Parameters
nameThe attribute name.

◆ XMLQualifiedName() [2/2]

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

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.

Member Function Documentation

◆ printCssSyntax()

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";
Represents an XML attribute name with an optional namespace.
Definition XMLQualifiedName.h:48
RcString name
The attribute name.
Definition XMLQualifiedName.h:51

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