![]() |
Qt 4.8
|
A helper class for handling nested namespace declarations. More...
#include <qnamespacesupport_p.h>
Public Types | |
| enum | NameType { AttributeName, ElementName } |
Public Functions | |
| QList< QXmlName > | namespaceBindings () const |
| NamespaceSupport () | |
| NamespaceSupport (NamePool &namePool) | |
| void | popContext () |
| QXmlName::PrefixCode | prefix (const QXmlName::NamespaceCode code) const |
| bool | processName (const QString &qualifiedName, NameType type, QXmlName &name) const |
| void | pushContext () |
| void | setPrefix (const QXmlName::PrefixCode prefixCode, const QXmlName::NamespaceCode namespaceCode) |
| void | setPrefixes (const QXmlStreamNamespaceDeclarations &declarations) |
| void | setTargetNamespace (const QXmlName::NamespaceCode code) |
| QXmlName::NamespaceCode | uri (const QXmlName::PrefixCode code) const |
Private Types | |
| typedef QHash< QXmlName::PrefixCode, QXmlName::NamespaceCode > | NamespaceHash |
Properties | |
| NamePool * | m_namePool |
| NamespaceHash | m_ns |
| QStack< NamespaceHash > | m_nsStack |
A helper class for handling nested namespace declarations.
This class is mostly an adaption of QXmlNamespaceSupport to the NamePool mechanism used in XmlPatterns.
Definition at line 78 of file qnamespacesupport_p.h.
|
private |
Definition at line 161 of file qnamespacesupport_p.h.
Describes whether the name to process is an attribute or element.
| Enumerator | |
|---|---|
| AttributeName | An attribute name to process. |
| ElementName | An element name to process. |
Definition at line 84 of file qnamespacesupport_p.h.
| NamespaceSupport::NamespaceSupport | ( | ) |
Creates an empty namespace support object.
Definition at line 58 of file qnamespacesupport.cpp.
| NamespaceSupport::NamespaceSupport | ( | NamePool & | namePool | ) |
Creates a new namespace support object.
| namePool | The name pool where all processed names are stored in. |
Definition at line 62 of file qnamespacesupport.cpp.
Returns the list of namespace bindings.
Definition at line 147 of file qnamespacesupport.cpp.
Referenced by QPatternist::XsdSchemaParser::readXPathAttribute(), and QPatternist::XsdSchemaParser::readXPathExpression().
| void NamespaceSupport::popContext | ( | ) |
Pops the current namespace mapping from the stack.
Definition at line 140 of file qnamespacesupport.cpp.
Referenced by QPatternist::XsdSchemaParser::parseUnknown(), QPatternist::XsdSchemaParser::parseUnknownDocumentation(), and QPatternist::ElementNamespaceHandler::~ElementNamespaceHandler().
| QXmlName::PrefixCode NamespaceSupport::prefix | ( | const QXmlName::NamespaceCode | code | ) | const |
Returns the prefix code for the given namespace code.
Definition at line 90 of file qnamespacesupport.cpp.
| bool NamespaceSupport::processName | ( | const QString & | qualifiedName, |
| NameType | type, | ||
| QXmlName & | name | ||
| ) | const |
Converts the given qualifiedName to a resolved QXmlName name according to the current namespace mapping.
| qualifiedName | The full qualified name. |
| type | The type of name processing. |
| name | The resolved QXmlName. |
true if the name could be processed correctly or false if the namespace prefix is unknown. Definition at line 106 of file qnamespacesupport.cpp.
Referenced by QPatternist::XsdSchemaParser::convertName().
| void NamespaceSupport::pushContext | ( | ) |
Pushes the current namespace mapping onto the stack.
Definition at line 135 of file qnamespacesupport.cpp.
Referenced by QPatternist::ElementNamespaceHandler::ElementNamespaceHandler(), QPatternist::XsdSchemaParser::parseUnknown(), and QPatternist::XsdSchemaParser::parseUnknownDocumentation().
| void NamespaceSupport::setPrefix | ( | const QXmlName::PrefixCode | prefixCode, |
| const QXmlName::NamespaceCode | namespaceCode | ||
| ) |
Adds a new prefix-to-namespace binding.
| prefixCode | The name pool code for the prefix. |
| namespaceCode | The name pool code for the namespace. |
Definition at line 69 of file qnamespacesupport.cpp.
| void NamespaceSupport::setPrefixes | ( | const QXmlStreamNamespaceDeclarations & | declarations | ) |
Adds the prefix-to-namespace bindings from declarations to the namespace support.
Definition at line 74 of file qnamespacesupport.cpp.
Referenced by QPatternist::ElementNamespaceHandler::ElementNamespaceHandler(), QPatternist::XsdSchemaParser::parseUnknown(), and QPatternist::XsdSchemaParser::parseUnknownDocumentation().
| void NamespaceSupport::setTargetNamespace | ( | const QXmlName::NamespaceCode | code | ) |
Sets the name pool code of the target namespace of the schema the namespace support works on.
Definition at line 85 of file qnamespacesupport.cpp.
Referenced by QPatternist::XsdSchemaParser::setTargetNamespaceExtended().
| QXmlName::NamespaceCode NamespaceSupport::uri | ( | const QXmlName::PrefixCode | code | ) | const |
Returns the namespace code for the given prefix code.
Definition at line 101 of file qnamespacesupport.cpp.
Referenced by processName().
|
private |
Definition at line 163 of file qnamespacesupport_p.h.
Referenced by processName(), and setPrefixes().
|
private |
Definition at line 165 of file qnamespacesupport_p.h.
Referenced by namespaceBindings(), NamespaceSupport(), popContext(), prefix(), processName(), pushContext(), setPrefix(), setPrefixes(), setTargetNamespace(), and uri().
|
private |
Definition at line 164 of file qnamespacesupport_p.h.
Referenced by popContext(), and pushContext().