18#if !defined(XPATHFUNCTIONTABLE_HEADER_GUARD_1357924680)
19#define XPATHFUNCTIONTABLE_HEADER_GUARD_1357924680
97 enum { InvalidFunctionNumberID = -1, TableSize = 36 };
143 getFunctionIndex(theFunctionName);
151 MemoryManager*
const theManager = m_memoryManager;
175 getFunctionIndex(theFunctionName);
183 MemoryManager*
const theManager = m_memoryManager;
185 XalanDOMString theResult(*theManager);
187 throw XPathExceptionFunctionNotAvailable(
241 return getFunctionIndex(
theName);
255 InstallFunction(theFunctionName.
c_str(), theFunction);
267 return UninstallFunction(theFunctionName.
c_str());
299 return getFunctionIndex(theFunctionName) != InvalidFunctionNumberID ?
true :
false;
307 template<
class OutputIteratorType>
313 for (
int i = 0;
i < TableSize; ++
i)
315 if (m_functionTable[
i] != 0)
318 s_functionNames[
i].m_name,
319 s_functionNames[
i].m_size);
458 return getFunctionIndex(
466 return getFunctionIndex(
468 XalanDOMString::length(
theName));
473 const XalanDOMChar* theName,
474 StringSizeType theNameLength);
476 MemoryManager* m_memoryManager;
478 const Function* m_functionTable[TableSize];
480 const Function**
const m_functionTableEnd;
483 static const FunctionNameTableEntry*
const s_lastFunctionName;
#define XALAN_XPATH_EXPORT
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
xercesc::Locator LocatorType
Exception class thrown when an unknown function is encountered.
XPathExceptionFunctionNotAvailable(const XPathExceptionFunctionNotAvailable &other)
Function::LocatorType LocatorType
XPathExceptionFunctionNotAvailable(const XalanDOMString &theFunctionName, XalanDOMString &theResult, const Locator *theLocator)
~XPathExceptionFunctionNotAvailable()
Exception class thrown when an installFunction() is called with a function name that is not supported...
~XPathExceptionFunctionNotSupported()
XPathExceptionFunctionNotSupported(const XalanDOMChar *theFunctionName, XalanDOMString &theResult, const Locator *theLocator)
XPathExceptionFunctionNotSupported(const XPathExceptionFunctionNotSupported &other)
Class defines a table of functions that can be called in XPath expresions.
bool UninstallFunction(const XalanDOMString &theFunctionName)
Remove a named function from the function table.
void InstallFunction(const XalanDOMString &theFunctionName, const Function &theFunction)
Insert a named function into the function table.
const Function & get(const XalanDOMString &theFunctionName, const Locator *theLocator) const
Retrieve the function object for a specified function name.
void DestroyTable()
Destroy the internal table.
void setMemoryManager(MemoryManager &theManager)
bool isInstalledFunction(const XalanDOMString &theFunctionName) const
Whether a named function is in the function table.
const Function & operator[](int theFunctionID) const
Retrieve the function object for a specified function ID number.
int nameToID(const XalanDOMString &theName) const
Map a function name to the corresponding ID number.
void CreateTable()
Set up the internal table.
const XalanDOMString & idToName(int theFunctionID, XalanDOMString &theResult) const
Map a function ID to the corresponding name.
static const SizeType s_functionNamesSize
XPathFunctionTable(bool fCreateTable=true)
Constructor.
XalanDOMString::size_type StringSizeType
DeleteFunctor< Function > DeleteFunctorType
void InstallFunction(const XalanDOMChar *theFunctionName, const Function &theFunction)
Insert a named function into the function table.
bool UninstallFunction(const XalanDOMChar *theFunctionName)
Remove a named function from the function table.
void getInstalledFunctionNames(OutputIteratorType theIterator) const
Add a list of the names of installed functions to a vector of names.
const XalanDOMChar * c_str() const
const XalanDOMChar * m_name