#ifndef ARABICA_XPATH_COMPILE_CONTEXT_HPP #define ARABICA_XPATH_COMPILE_CONTEXT_HPP namespace Arabica { namespace XPath { template class XPath; template class NamespaceContext; template class FunctionResolver; namespace impl { template class CompilationContext : private NamespaceContext { public: CompilationContext(const XPath& xpathCompiler, const NamespaceContext& namespaceContext, const FunctionResolver& functionResolver) : xpath_(xpathCompiler), namespaceContext_(namespaceContext), functionResolver_(functionResolver) { } // CompilationContext const XPath& xpath() const { return xpath_; } const NamespaceContext& namespaceContext() const { return *this; } const FunctionResolver& functionResolver() const { return functionResolver_; } private: virtual string_type namespaceURI(const string_type& prefix) const { string_type uri = namespaceContext_.namespaceURI(prefix); if(string_adaptor::empty(uri)) throw Arabica::XPath::UnboundNamespacePrefixException(string_adaptor::asStdString(prefix)); return uri; } // namespaceURI const XPath& xpath_; const NamespaceContext& namespaceContext_; const FunctionResolver& functionResolver_; CompilationContext(const CompilationContext&); CompilationContext& operator=(const CompilationContext&); bool operator==(const CompilationContext&) const; }; // class CompilationContext } // namespace impl } // namespace XPath } // namespace Arabica #endif