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 sXMLNS
 
NameSpaceHash aNameHash
 
NameSpaceHash aNameCache
 
KeyToNameSpaceMap maKeyToNamespaceMap
 
QNameCache 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 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 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 aNameCache, aNameHash, 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 408 of file namespacemap.cxx.

References GetAttrNameByKey().

◆ GetAttrNameByKey()

OUString SvXMLNamespaceMap::GetAttrNameByKey ( sal_uInt16  nKey) const

◆ GetFirstIndex()

sal_uInt16 SvXMLNamespaceMap::GetFirstIndex ( ) const

Definition at line 384 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 380 of file namespacemap.cxx.

Referenced by XMLVersionListExport::exportDoc().

◆ GetIndexByPrefix()

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

Definition at line 425 of file namespacemap.cxx.

References 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 430 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 284 of file namespacemap.cxx.

References aNameCache, aNameHash, AttrNameCached, eMode, maKeyToNamespaceMap, NameSpaceEntry::nKey, SAL_INFO, NameSpaceEntry::sName, NameSpaceEntry::sPrefix, sXMLNS, 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 389 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 445 of file namespacemap.cxx.

References NormalizeOasisURN(), and NormalizeW3URI().

Referenced by SvXMLImport::processNSAttributes().

◆ NormalizeW3URI()

bool SvXMLNamespaceMap::NormalizeW3URI ( OUString &  rName)
static

Definition at line 454 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 aNameHash, and maKeyToNamespaceMap.

◆ operator==()

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

Definition at line 87 of file namespacemap.cxx.

References aNameHash.

Member Data Documentation

◆ aNameCache

NameSpaceHash SvXMLNamespaceMap::aNameCache
mutableprivate

Definition at line 88 of file namespacemap.hxx.

Referenced by Clear(), and GetKeyByQName().

◆ aNameHash

NameSpaceHash SvXMLNamespaceMap::aNameHash
private

◆ aQNameCache

QNameCache SvXMLNamespaceMap::aQNameCache
mutableprivate

Definition at line 90 of file namespacemap.hxx.

Referenced by Clear(), and GetQNameByKey().

◆ maKeyToNamespaceMap

KeyToNameSpaceMap SvXMLNamespaceMap::maKeyToNamespaceMap
private

◆ sXMLNS

OUString SvXMLNamespaceMap::sXMLNS
private

Definition at line 85 of file namespacemap.hxx.

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


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