LibreOffice Module xmloff (master) 1
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
SvXMLNamespaceMap Class Reference

#include <namespacemap.hxx>

Public Types

enum class  QNameMode {
  AttrNameCached ,
  AttrValue
}
 

Public Member Functions

 SvXMLNamespaceMap ()
 
 ~SvXMLNamespaceMap ()
 
 SvXMLNamespaceMap (const SvXMLNamespaceMap &)
 
SvXMLNamespaceMapoperator= (const SvXMLNamespaceMap &rCmp)
 
bool operator== (const SvXMLNamespaceMap &rCmp) const
 
sal_uInt16 Add (const OUString &rPrefix, const OUString &rName, sal_uInt16 nKey=XML_NAMESPACE_UNKNOWN)
 
sal_uInt16 AddIfKnown (const OUString &rPrefix, const OUString &rName)
 
sal_uInt16 GetKeyByName (const OUString &rName) const
 
const OUString & GetNameByKey (sal_uInt16 nKey) const
 
sal_uInt16 GetKeyByPrefix (const OUString &rPrefix) const
 
const OUString & GetPrefixByKey (sal_uInt16 nKey) const
 
OUString GetQNameByKey (sal_uInt16 nKey, const OUString &rLocalName, bool bCache=true) const
 
OUString GetAttrNameByKey (sal_uInt16 nKey) const
 
sal_uInt16 GetKeyByQName (const OUString &rQName, OUString *pPrefix, OUString *pLocalName, OUString *pNamespace, QNameMode eMode) const
 
sal_uInt16 GetKeyByAttrValueQName (const OUString &rAttrName, OUString *pLocalName) const
 
sal_uInt16 GetFirstKey () const
 
sal_uInt16 GetNextKey (sal_uInt16 nOldKey) const
 
const NameSpaceHashGetAllEntries () const
 
void Clear ()
 
void AddAtIndex (const OUString &rPrefix, const OUString &rName, sal_uInt16 nKey)
 
sal_uInt16 GetIndexByPrefix (const OUString &rPrefix) const
 
sal_uInt16 GetFirstIndex () const
 
sal_uInt16 GetNextIndex (sal_uInt16 nOldIdx) const
 
const OUString & GetPrefixByIndex (sal_uInt16 nIdx) const
 
const OUString & GetNameByIndex (sal_uInt16 nIdx) const
 
OUString GetAttrNameByIndex (sal_uInt16 nIdx) const
 
sal_uInt16 GetKeyByAttrName (const OUString &rAttrName, OUString *pPrefix, OUString *pLocalName, OUString *pNamespace) const
 
sal_uInt16 GetKeyByAttrName (const OUString &rAttrName, OUString *pLocalName=nullptr) const
 

Static Public Member Functions

static bool NormalizeOasisURN (OUString &rName)
 
static bool NormalizeW3URI (OUString &rName)
 
static bool NormalizeURI (OUString &rName)
 
static sal_uInt16 GetIndexByKey (sal_uInt16 nKey)
 

Private Member Functions

SAL_DLLPRIVATE sal_uInt16 Add_ (const OUString &rPrefix, const OUString &rName, sal_uInt16 nKey)
 

Private Attributes

OUString m_sXMLNS
 
NameSpaceHash m_aNameHash
 
NameSpaceHash m_aNameCache
 
KeyToNameSpaceMap maKeyToNamespaceMap
 
QNameCache m_aQNameCache
 

Detailed Description

Definition at line 83 of file namespacemap.hxx.

Member Enumeration Documentation

◆ QNameMode

enum class SvXMLNamespaceMap::QNameMode
strong
Enumerator
AttrNameCached 
AttrValue 

Definition at line 121 of file namespacemap.hxx.

Constructor & Destructor Documentation

◆ SvXMLNamespaceMap() [1/2]

SvXMLNamespaceMap::SvXMLNamespaceMap ( )

Definition at line 52 of file namespacemap.cxx.

References m_aNameHash, and maKeyToNamespaceMap.

◆ ~SvXMLNamespaceMap()

SvXMLNamespaceMap::~SvXMLNamespaceMap ( )

Definition at line 74 of file namespacemap.cxx.

◆ SvXMLNamespaceMap() [2/2]

SvXMLNamespaceMap::SvXMLNamespaceMap ( const SvXMLNamespaceMap rMap)

Definition at line 60 of file namespacemap.cxx.

References m_aNameHash, and maKeyToNamespaceMap.

Member Function Documentation

◆ Add()

sal_uInt16 SvXMLNamespaceMap::Add ( const OUString &  rPrefix,
const OUString &  rName,
sal_uInt16  nKey = XML_NAMESPACE_UNKNOWN 
)

◆ Add_()

sal_uInt16 SvXMLNamespaceMap::Add_ ( const OUString &  rPrefix,
const OUString &  rName,
sal_uInt16  nKey 
)
private

◆ AddAtIndex()

void SvXMLNamespaceMap::AddAtIndex ( const OUString &  rPrefix,
const OUString &  rName,
sal_uInt16  nKey 
)

◆ AddIfKnown()

sal_uInt16 SvXMLNamespaceMap::AddIfKnown ( const OUString &  rPrefix,
const OUString &  rName 
)

◆ Clear()

void SvXMLNamespaceMap::Clear ( )

Definition at line 78 of file namespacemap.cxx.

References m_aNameCache, m_aNameHash, m_aQNameCache, and maKeyToNamespaceMap.

◆ GetAllEntries()

const NameSpaceHash & SvXMLNamespaceMap::GetAllEntries ( ) const
inline

Definition at line 137 of file namespacemap.hxx.

◆ GetAttrNameByIndex()

OUString SvXMLNamespaceMap::GetAttrNameByIndex ( sal_uInt16  nIdx) const

Definition at line 397 of file namespacemap.cxx.

References GetAttrNameByKey().

◆ GetAttrNameByKey()

OUString SvXMLNamespaceMap::GetAttrNameByKey ( sal_uInt16  nKey) const

◆ GetFirstIndex()

sal_uInt16 SvXMLNamespaceMap::GetFirstIndex ( ) const

Definition at line 373 of file namespacemap.cxx.

References first, and maKeyToNamespaceMap.

Referenced by SvXMLAttrCollection::GetFirstNamespaceIndex().

◆ GetFirstKey()

sal_uInt16 SvXMLNamespaceMap::GetFirstKey ( ) const

◆ GetIndexByKey()

sal_uInt16 SvXMLNamespaceMap::GetIndexByKey ( sal_uInt16  nKey)
static

Definition at line 369 of file namespacemap.cxx.

Referenced by XMLVersionListExport::exportDoc().

◆ GetIndexByPrefix()

sal_uInt16 SvXMLNamespaceMap::GetIndexByPrefix ( const OUString &  rPrefix) const

Definition at line 414 of file namespacemap.cxx.

References m_aNameHash.

Referenced by SvXMLAttrCollection::AddAttr(), and SvXMLAttrCollection::SetAt().

◆ GetKeyByAttrName() [1/2]

sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName ( const OUString &  rAttrName,
OUString *  pLocalName = nullptr 
) const

Definition at line 419 of file namespacemap.cxx.

References AttrNameCached, and GetKeyByQName().

◆ GetKeyByAttrName() [2/2]

sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName ( const OUString &  rAttrName,
OUString *  pPrefix,
OUString *  pLocalName,
OUString *  pNamespace 
) const

◆ GetKeyByAttrValueQName()

sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrValueQName ( const OUString &  rAttrName,
OUString *  pLocalName 
) const

◆ GetKeyByName()

sal_uInt16 SvXMLNamespaceMap::GetKeyByName ( const OUString &  rName) const

◆ GetKeyByPrefix()

sal_uInt16 SvXMLNamespaceMap::GetKeyByPrefix ( const OUString &  rPrefix) const

◆ GetKeyByQName()

sal_uInt16 SvXMLNamespaceMap::GetKeyByQName ( const OUString &  rQName,
OUString *  pPrefix,
OUString *  pLocalName,
OUString *  pNamespace,
QNameMode  eMode 
) const
Parameters
rQNameeither attribute name or qualified/namespaced attribute value
bCacheAttrNametrue: rQName is element or attribute name, cache it false: rQName is attribute value, may contain extra ':', don't cache it

Definition at line 273 of file namespacemap.cxx.

References AttrNameCached, eMode, m_aNameCache, m_aNameHash, NameSpaceEntry::m_nKey, NameSpaceEntry::m_sName, NameSpaceEntry::m_sPrefix, m_sXMLNS, maKeyToNamespaceMap, SAL_INFO, XML_NAMESPACE_NONE, XML_NAMESPACE_UNKNOWN, and XML_NAMESPACE_XMLNS.

Referenced by GetKeyByAttrName(), and GetKeyByAttrValueQName().

◆ GetNameByIndex()

const OUString & SvXMLNamespaceMap::GetNameByIndex ( sal_uInt16  nIdx) const

◆ GetNameByKey()

const OUString & SvXMLNamespaceMap::GetNameByKey ( sal_uInt16  nKey) const

◆ GetNextIndex()

sal_uInt16 SvXMLNamespaceMap::GetNextIndex ( sal_uInt16  nOldIdx) const

Definition at line 378 of file namespacemap.cxx.

References maKeyToNamespaceMap.

Referenced by SvXMLAttrCollection::GetNextNamespaceIndex().

◆ GetNextKey()

sal_uInt16 SvXMLNamespaceMap::GetNextKey ( sal_uInt16  nOldKey) const

◆ GetPrefixByIndex()

const OUString & SvXMLNamespaceMap::GetPrefixByIndex ( sal_uInt16  nIdx) const

◆ GetPrefixByKey()

const OUString & SvXMLNamespaceMap::GetPrefixByKey ( sal_uInt16  nKey) const

◆ GetQNameByKey()

OUString SvXMLNamespaceMap::GetQNameByKey ( sal_uInt16  nKey,
const OUString &  rLocalName,
bool  bCache = true 
) const

◆ NormalizeOasisURN()

bool SvXMLNamespaceMap::NormalizeOasisURN ( OUString &  rName)
static

◆ NormalizeURI()

bool SvXMLNamespaceMap::NormalizeURI ( OUString &  rName)
static

Definition at line 434 of file namespacemap.cxx.

References NormalizeOasisURN(), and NormalizeW3URI().

◆ NormalizeW3URI()

bool SvXMLNamespaceMap::NormalizeW3URI ( OUString &  rName)
static

Definition at line 443 of file namespacemap.cxx.

References xmloff::token::GetXMLToken().

Referenced by NormalizeURI().

◆ operator=()

SvXMLNamespaceMap & SvXMLNamespaceMap::operator= ( const SvXMLNamespaceMap rCmp)

Definition at line 67 of file namespacemap.cxx.

References m_aNameHash, and maKeyToNamespaceMap.

◆ operator==()

bool SvXMLNamespaceMap::operator== ( const SvXMLNamespaceMap rCmp) const

Definition at line 87 of file namespacemap.cxx.

References m_aNameHash.

Member Data Documentation

◆ m_aNameCache

NameSpaceHash SvXMLNamespaceMap::m_aNameCache
mutableprivate

Definition at line 88 of file namespacemap.hxx.

Referenced by Clear(), and GetKeyByQName().

◆ m_aNameHash

NameSpaceHash SvXMLNamespaceMap::m_aNameHash
private

◆ m_aQNameCache

QNameCache SvXMLNamespaceMap::m_aQNameCache
mutableprivate

Definition at line 90 of file namespacemap.hxx.

Referenced by Clear(), and GetQNameByKey().

◆ m_sXMLNS

OUString SvXMLNamespaceMap::m_sXMLNS
private

Definition at line 85 of file namespacemap.hxx.

Referenced by GetAttrNameByKey(), GetKeyByQName(), and GetQNameByKey().

◆ maKeyToNamespaceMap

KeyToNameSpaceMap SvXMLNamespaceMap::maKeyToNamespaceMap
private

The documentation for this class was generated from the following files: