Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::xml::XMLQualifiedNameRef Struct Reference

Reference type for XMLQualifiedName, to pass the value to APIs without needing to allocate an RcString. More...

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

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

Public Member Functions

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

Public Attributes

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

Friends

std::strong_ordering operator<=> (const XMLQualifiedNameRef &lhs, const XMLQualifiedName &rhs)
 Friend operator for XMLQualifiedName comparison.
 
std::strong_ordering operator<=> (const XMLQualifiedName &lhs, const XMLQualifiedNameRef &rhs)
 Friend operator for XMLQualifiedName comparison.
 
bool operator== (const XMLQualifiedName &lhs, const XMLQualifiedNameRef &rhs)
 Friend operator for XMLQualifiedName equality for gtest.
 
bool operator== (const XMLQualifiedNameRef &lhs, const XMLQualifiedName &rhs)
 Friend operator for XMLQualifiedName equality for gtest.
 
std::ostream & operator<< (std::ostream &os, const XMLQualifiedNameRef &obj)
 Ostream output operator, using XML syntax (e.g. "ns:name").
 

Detailed Description

Reference type for XMLQualifiedName, to pass the value to APIs without needing to allocate an RcString.

Constructor & Destructor Documentation

◆ XMLQualifiedNameRef() [1/4]

constexpr donner::xml::XMLQualifiedNameRef::XMLQualifiedNameRef ( const RcStringOrRef & name)
inlineconstexpr

Construct from an attribute name as a string_view, assumes no namespacePrefix.

Parameters
nameThe attribute name.

◆ XMLQualifiedNameRef() [2/4]

constexpr donner::xml::XMLQualifiedNameRef::XMLQualifiedNameRef ( const char * name)
inlineconstexpr

Construct from an attribute name as a const char*, assumes no namespacePrefix.

Parameters
nameThe attribute name.

◆ XMLQualifiedNameRef() [3/4]

constexpr donner::xml::XMLQualifiedNameRef::XMLQualifiedNameRef ( std::string_view name)
inlineconstexpr

Construct from an attribute name as a std::string_view, assumes no namespacePrefix.

Parameters
nameThe attribute name.

◆ XMLQualifiedNameRef() [4/4]

constexpr donner::xml::XMLQualifiedNameRef::XMLQualifiedNameRef ( const RcStringOrRef & namespacePrefix,
const RcStringOrRef & 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< XMLQualifiedNameRef > donner::xml::XMLQualifiedNameRef::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";
Reference type for XMLQualifiedName, to pass the value to APIs without needing to allocate an RcStrin...
Definition XMLQualifiedName.h:135
RcStringOrRef name
The attribute name.
Definition XMLQualifiedName.h:138

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