20#ifndef INCLUDED_XMLOFF_NMSPMAP_HXX
21#define INCLUDED_XMLOFF_NMSPMAP_HXX
25#include <unordered_map>
30#include <rtl/ustring.hxx>
66typedef ::std::pair < sal_uInt16, OUString >
QNamePair;
73 hash = hash * 37 + r1.first;
74 hash = hash * 37 + r1.second.hashCode();
79typedef std::unordered_map < QNamePair, OUString, QNamePairHash >
QNameCache;
91 SAL_DLLPRIVATE sal_uInt16 Add_(
const OUString& rPrefix,
const OUString &rName, sal_uInt16 nKey );
103 sal_uInt16
Add(
const OUString& rPrefix,
104 const OUString& rName,
106 sal_uInt16 AddIfKnown(
const OUString& rPrefix,
107 const OUString& rName );
109 sal_uInt16 GetKeyByName(
const OUString& rName )
const;
110 const OUString& GetNameByKey( sal_uInt16 nKey )
const;
112 sal_uInt16 GetKeyByPrefix(
const OUString& rPrefix )
const;
113 const OUString& GetPrefixByKey( sal_uInt16 nKey )
const;
115 OUString GetQNameByKey( sal_uInt16 nKey,
116 const OUString& rLocalName,
117 bool bCache =
true)
const;
119 OUString GetAttrNameByKey( sal_uInt16 nKey )
const;
122 sal_uInt16 GetKeyByQName(
const OUString& rQName,
124 OUString *pLocalName,
125 OUString *pNamespace,
126 QNameMode eMode)
const;
128 sal_uInt16 GetKeyByAttrValueQName(
const OUString& rAttrName,
129 OUString *pLocalName)
const;
131 sal_uInt16 GetFirstKey()
const;
132 sal_uInt16 GetNextKey( sal_uInt16 nOldKey )
const;
141 static bool NormalizeOasisURN( OUString& rName );
142 static bool NormalizeW3URI( OUString& rName );
143 static bool NormalizeURI( OUString& rName );
145 void AddAtIndex(
const OUString& rPrefix,
146 const OUString& rName, sal_uInt16 nKey );
147 static sal_uInt16 GetIndexByKey( sal_uInt16 nKey );
148 sal_uInt16 GetIndexByPrefix(
const OUString& rPrefix )
const;
149 sal_uInt16 GetFirstIndex()
const;
150 sal_uInt16 GetNextIndex( sal_uInt16 nOldIdx )
const;
151 const OUString& GetPrefixByIndex( sal_uInt16 nIdx )
const;
152 const OUString& GetNameByIndex( sal_uInt16 nIdx )
const;
153 OUString GetAttrNameByIndex( sal_uInt16 nIdx )
const;
154 sal_uInt16 GetKeyByAttrName(
const OUString& rAttrName,
156 OUString *pLocalName,
157 OUString *pNamespace )
const;
158 sal_uInt16 GetKeyByAttrName(
const OUString& rAttrName,
159 OUString *pLocalName =
nullptr )
const;
bool operator==(NameSpaceEntry const &rhs) const
KeyToNameSpaceMap maKeyToNamespaceMap
NameSpaceHash m_aNameCache
const NameSpaceHash & GetAllEntries() const
NameSpaceHash m_aNameHash
void Clear(EHistoryType eHistory)
const sal_uInt16 XML_NAMESPACE_UNKNOWN_FLAG
::std::pair< sal_uInt16, OUString > QNamePair
std::unordered_map< sal_uInt16, KeyToNameSpaceMapEntry > KeyToNameSpaceMap
const sal_uInt16 XML_NAMESPACE_NONE
std::unordered_map< OUString, NameSpaceEntry > NameSpaceHash
const sal_uInt16 XML_NAMESPACE_UNKNOWN
const sal_uInt16 XML_NAMESPACE_XMLNS
std::unordered_map< QNamePair, OUString, QNamePairHash > QNameCache
bool operator==(const AttributeDescription &i_lhs, const AttributeDescription &i_rhs)
size_t operator()(const QNamePair &r1) const