LibreOffice Module unoxml (master) 1
Public Member Functions | Private Attributes | List of all members
XPath::CXPathAPI Class Reference

#include <xpathapi.hxx>

Inheritance diagram for XPath::CXPathAPI:
[legend]
Collaboration diagram for XPath::CXPathAPI:
[legend]

Public Member Functions

 CXPathAPI (const css::uno::Reference< css::uno::XComponentContext > &)
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual sal_Bool SAL_CALL supportsService (const OUString &ServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
virtual void SAL_CALL registerNS (const OUString &aPrefix, const OUString &aURI) override
 
virtual void SAL_CALL unregisterNS (const OUString &aPrefix, const OUString &aURI) override
 
virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL selectNodeList (const css::uno::Reference< css::xml::dom::XNode > &contextNode, const OUString &str) override
 Use an XPath string to select a nodelist. More...
 
virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL selectNodeListNS (const css::uno::Reference< css::xml::dom::XNode > &contextNode, const OUString &str, const css::uno::Reference< css::xml::dom::XNode > &namespaceNode) override
 Use an XPath string to select a nodelist. More...
 
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL selectSingleNode (const css::uno::Reference< css::xml::dom::XNode > &contextNode, const OUString &str) override
 Use an XPath string to select a single node. More...
 
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL selectSingleNodeNS (const css::uno::Reference< css::xml::dom::XNode > &contextNode, const OUString &str, const css::uno::Reference< css::xml::dom::XNode > &namespaceNode) override
 Use an XPath string to select a single node. More...
 
virtual css::uno::Reference< css::xml::xpath::XXPathObject > SAL_CALL eval (const css::uno::Reference< css::xml::dom::XNode > &contextNode, const OUString &str) override
 evaluates an XPath string. More...
 
virtual css::uno::Reference< css::xml::xpath::XXPathObject > SAL_CALL evalNS (const css::uno::Reference< css::xml::dom::XNode > &contextNode, const OUString &str, const css::uno::Reference< css::xml::dom::XNode > &namespaceNode) override
 same as eval but registers all namespace declarations found on namespaceNode More...
 
virtual void SAL_CALL registerExtension (const OUString &aName) override
 uses the service manager to create an instance of the service denoted by aName. More...
 
virtual void SAL_CALL registerExtensionInstance (const css::uno::Reference< css::xml::xpath::XXPathExtension > &aExtension) override
 registers the given extension instance to be used by XPath evaluations performed through this XPathAPI instance More...
 

Private Attributes

std::mutex m_Mutex
 
nsmap_t m_nsmap
 
const css::uno::Reference< css::uno::XComponentContext > m_xContext
 
extensions_t m_extensions
 

Detailed Description

Definition at line 51 of file xpathapi.hxx.

Constructor & Destructor Documentation

◆ CXPathAPI()

XPath::CXPathAPI::CXPathAPI ( const css::uno::Reference< css::uno::XComponentContext > &  )
explicit

Definition at line 51 of file xpathapi.cxx.

References m_xContext.

Member Function Documentation

◆ eval()

Reference< XXPathObject > SAL_CALL XPath::CXPathAPI::eval ( const css::uno::Reference< css::xml::dom::XNode > &  contextNode,
const OUString &  str 
)
overridevirtual

evaluates an XPath string.

relative XPath expressions are evaluated relative to the context Node

Definition at line 273 of file xpathapi.cxx.

References XPath::generic_error_func(), XPath::lcl_registerExtensions(), XPath::lcl_registerNamespaces(), m_extensions, m_Mutex, m_nsmap, OUStringToOString(), and XPath::structured_error_func().

Referenced by evalNS(), and selectNodeList().

◆ evalNS()

Reference< XXPathObject > SAL_CALL XPath::CXPathAPI::evalNS ( const css::uno::Reference< css::xml::dom::XNode > &  contextNode,
const OUString &  str,
const css::uno::Reference< css::xml::dom::XNode > &  namespaceNode 
)
overridevirtual

same as eval but registers all namespace declarations found on namespaceNode

Definition at line 346 of file xpathapi.cxx.

References eval(), and XPath::lcl_collectRegisterNamespaces().

◆ getImplementationName()

OUString SAL_CALL XPath::CXPathAPI::getImplementationName ( )
overridevirtual

Definition at line 61 of file xpathapi.cxx.

◆ getSupportedServiceNames()

Sequence< OUString > SAL_CALL XPath::CXPathAPI::getSupportedServiceNames ( )
overridevirtual

Definition at line 56 of file xpathapi.cxx.

◆ registerExtension()

void SAL_CALL XPath::CXPathAPI::registerExtension ( const OUString &  aName)
overridevirtual

uses the service manager to create an instance of the service denoted by aName.

If the returned object implements the XXPathExtension interface, it is added to the list of extensions that are used when evaluating XPath strings with this XPathAPI instance

Definition at line 360 of file xpathapi.cxx.

References aName, m_extensions, m_Mutex, and m_xContext.

◆ registerExtensionInstance()

void SAL_CALL XPath::CXPathAPI::registerExtensionInstance ( const css::uno::Reference< css::xml::xpath::XXPathExtension > &  aExtension)
overridevirtual

registers the given extension instance to be used by XPath evaluations performed through this XPathAPI instance

Definition at line 375 of file xpathapi.cxx.

References m_extensions, and m_Mutex.

◆ registerNS()

void SAL_CALL XPath::CXPathAPI::registerNS ( const OUString &  aPrefix,
const OUString &  aURI 
)
overridevirtual

Definition at line 71 of file xpathapi.cxx.

References m_Mutex, and m_nsmap.

Referenced by XPath::lcl_collectRegisterNamespaces().

◆ selectNodeList()

Reference< XNodeList > SAL_CALL XPath::CXPathAPI::selectNodeList ( const css::uno::Reference< css::xml::dom::XNode > &  contextNode,
const OUString &  str 
)
overridevirtual

Use an XPath string to select a nodelist.

Definition at line 175 of file xpathapi.cxx.

References eval().

Referenced by selectNodeListNS(), and selectSingleNode().

◆ selectNodeListNS()

Reference< XNodeList > SAL_CALL XPath::CXPathAPI::selectNodeListNS ( const css::uno::Reference< css::xml::dom::XNode > &  contextNode,
const OUString &  str,
const css::uno::Reference< css::xml::dom::XNode > &  namespaceNode 
)
overridevirtual

Use an XPath string to select a nodelist.

same as selectNodeList but registers all name space declarations found on namespaceNode

Definition at line 186 of file xpathapi.cxx.

References XPath::lcl_collectRegisterNamespaces(), and selectNodeList().

◆ selectSingleNode()

Reference< XNode > SAL_CALL XPath::CXPathAPI::selectSingleNode ( const css::uno::Reference< css::xml::dom::XNode > &  contextNode,
const OUString &  str 
)
overridevirtual

Use an XPath string to select a single node.

Same as selectNodeList but returns the first node (if any)

Definition at line 198 of file xpathapi.cxx.

References selectNodeList().

Referenced by selectSingleNodeNS().

◆ selectSingleNodeNS()

Reference< XNode > SAL_CALL XPath::CXPathAPI::selectSingleNodeNS ( const css::uno::Reference< css::xml::dom::XNode > &  contextNode,
const OUString &  str,
const css::uno::Reference< css::xml::dom::XNode > &  namespaceNode 
)
overridevirtual

Use an XPath string to select a single node.

Same as selectSingleNode but registers all namespaces declared on namespaceNode.

Definition at line 211 of file xpathapi.cxx.

References XPath::lcl_collectRegisterNamespaces(), and selectSingleNode().

◆ supportsService()

sal_Bool SAL_CALL XPath::CXPathAPI::supportsService ( const OUString &  ServiceName)
overridevirtual

Definition at line 66 of file xpathapi.cxx.

References cppu::supportsService().

◆ unregisterNS()

void SAL_CALL XPath::CXPathAPI::unregisterNS ( const OUString &  aPrefix,
const OUString &  aURI 
)
overridevirtual

Definition at line 80 of file xpathapi.cxx.

References m_Mutex, and m_nsmap.

Member Data Documentation

◆ m_extensions

extensions_t XPath::CXPathAPI::m_extensions
private

Definition at line 59 of file xpathapi.hxx.

Referenced by eval(), registerExtension(), and registerExtensionInstance().

◆ m_Mutex

std::mutex XPath::CXPathAPI::m_Mutex
private

◆ m_nsmap

nsmap_t XPath::CXPathAPI::m_nsmap
private

Definition at line 57 of file xpathapi.hxx.

Referenced by eval(), registerNS(), and unregisterNS().

◆ m_xContext

const css::uno::Reference< css::uno::XComponentContext > XPath::CXPathAPI::m_xContext
private

Definition at line 58 of file xpathapi.hxx.

Referenced by registerExtension().


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