20 #ifndef INCLUDED_XMLOFF_NMSPMAP_HXX
21 #define INCLUDED_XMLOFF_NMSPMAP_HXX
25 #include <unordered_map>
30 #include <rtl/ustring.hxx>
31 #include <rtl/ref.hxx>
52 typedef ::std::pair < sal_uInt16, OUString >
QNamePair;
59 hash = hash * 37 + r1.first;
60 hash = hash * 37 + r1.second.hashCode();
65 typedef std::unordered_map < QNamePair, OUString, QNamePairHash >
QNameCache;
66 typedef std::unordered_map < OUString, ::rtl::Reference <NameSpaceEntry > >
NameSpaceHash;
67 typedef std::unordered_map < sal_uInt16, ::rtl::Reference < NameSpaceEntry > >
NameSpaceMap;
77 SAL_DLLPRIVATE sal_uInt16 Add_(
const OUString& rPrefix,
const OUString &rName, sal_uInt16 nKey );
89 sal_uInt16
Add(
const OUString& rPrefix,
90 const OUString& rName,
92 sal_uInt16 AddIfKnown(
const OUString& rPrefix,
93 const OUString& rName );
95 sal_uInt16 GetKeyByName(
const OUString& rName )
const;
96 const OUString& GetNameByKey( sal_uInt16 nKey )
const;
98 sal_uInt16 GetKeyByPrefix(
const OUString& rPrefix )
const;
99 const OUString& GetPrefixByKey( sal_uInt16 nKey )
const;
101 OUString GetQNameByKey( sal_uInt16 nKey,
102 const OUString& rLocalName,
103 bool bCache =
true)
const;
105 OUString GetAttrNameByKey( sal_uInt16 nKey )
const;
108 sal_uInt16 GetKeyByQName(
const OUString& rQName,
110 OUString *pLocalName,
111 OUString *pNamespace,
112 QNameMode eMode)
const;
114 sal_uInt16 GetKeyByAttrValueQName(
const OUString& rAttrName,
115 OUString *pLocalName)
const;
117 sal_uInt16 GetFirstKey()
const;
118 sal_uInt16 GetNextKey( sal_uInt16 nOldKey )
const;
127 static bool NormalizeOasisURN( OUString& rName );
128 static bool NormalizeW3URI( OUString& rName );
129 static bool NormalizeURI( OUString& rName );
131 void AddAtIndex(
const OUString& rPrefix,
132 const OUString& rName, sal_uInt16 nKey );
133 static sal_uInt16 GetIndexByKey( sal_uInt16 nKey );
134 sal_uInt16 GetIndexByPrefix(
const OUString& rPrefix )
const;
135 sal_uInt16 GetFirstIndex()
const;
136 sal_uInt16 GetNextIndex( sal_uInt16 nOldIdx )
const;
137 const OUString& GetPrefixByIndex( sal_uInt16 nIdx )
const;
138 const OUString& GetNameByIndex( sal_uInt16 nIdx )
const;
139 OUString GetAttrNameByIndex( sal_uInt16 nIdx )
const;
140 sal_uInt16 GetKeyByAttrName(
const OUString& rAttrName,
142 OUString *pLocalName,
143 OUString *pNamespace )
const;
144 sal_uInt16 GetKeyByAttrName(
const OUString& rAttrName,
145 OUString *pLocalName =
nullptr )
const;
148 #endif // INCLUDED_XMLOFF_NMSPMAP_HXX
std::unordered_map< OUString,::rtl::Reference< NameSpaceEntry > > NameSpaceHash
std::unordered_map< sal_uInt16,::rtl::Reference< NameSpaceEntry > > NameSpaceMap
const NameSpaceHash & GetAllEntries() const
const sal_uInt16 XML_NAMESPACE_UNKNOWN
const sal_uInt16 XML_NAMESPACE_XMLNS
size_t operator()(const QNamePair &r1) const
const sal_uInt16 XML_NAMESPACE_UNKNOWN_FLAG
const sal_uInt16 XML_NAMESPACE_NONE
void Clear(EHistoryType eHistory)
::std::pair< sal_uInt16, OUString > QNamePair
bool operator==(const AttributeDescription &i_lhs, const AttributeDescription &i_rhs)
std::unordered_map< QNamePair, OUString, QNamePairHash > QNameCache