#ifndef QualifiedName_h
#define QualifiedName_h
#include "AtomicString.h"
namespace WebCore {
class QualifiedName {
public:
class QualifiedNameImpl : public Shared<QualifiedNameImpl> {
public:
QualifiedNameImpl(const AtomicString& p, const AtomicString& l, const AtomicString& n) :m_prefix(p), m_localName(l), m_namespace(n) {}
AtomicString m_prefix;
AtomicString m_localName;
AtomicString m_namespace;
};
QualifiedName(const AtomicString& prefix, const AtomicString& localName, const AtomicString& namespaceURI);
~QualifiedName();
#ifdef QNAME_DEFAULT_CONSTRUCTOR
QualifiedName() : m_impl(0) { }
#endif
QualifiedName(const QualifiedName&);
const QualifiedName& operator=(const QualifiedName&);
bool operator==(const QualifiedName& other) const { return m_impl == other.m_impl; }
bool operator!=(const QualifiedName& other) const { return !(*this == other); }
bool matches(const QualifiedName& other) const { return m_impl == other.m_impl || (localName() == other.localName() && namespaceURI() == other.namespaceURI()); }
bool hasPrefix() const { return m_impl->m_prefix != nullAtom; }
void setPrefix(const AtomicString& prefix);
const AtomicString& prefix() const { return m_impl->m_prefix; }
const AtomicString& localName() const { return m_impl->m_localName; }
const AtomicString& namespaceURI() const { return m_impl->m_namespace; }
String toString() const;
QualifiedNameImpl* impl() const { return m_impl; }
static void init();
private:
void ref() { m_impl->ref(); }
void deref();
QualifiedNameImpl* m_impl;
};
#ifndef WEBCORE_QUALIFIEDNAME_HIDE_GLOBALS
extern const QualifiedName anyName;
inline const QualifiedName& anyQName() { return anyName; }
#endif
inline bool operator==(const AtomicString& a, const QualifiedName& q) { return a == q.localName(); }
inline bool operator!=(const AtomicString& a, const QualifiedName& q) { return a != q.localName(); }
inline bool operator==(const QualifiedName& q, const AtomicString& a) { return a == q.localName(); }
inline bool operator!=(const QualifiedName& q, const AtomicString& a) { return a != q.localName(); }
}
#endif