18 #if !defined(XPATHFUNCTIONTABLE_HEADER_GUARD_1357924680) 19 #define XPATHFUNCTIONTABLE_HEADER_GUARD_1357924680 45 XALAN_CPP_NAMESPACE_BEGIN
61 const Locator* theLocator);
79 const XalanDOMChar* theFunctionName,
81 const Locator* theLocator);
97 enum { InvalidFunctionNumberID = -1, TableSize = 36 };
115 m_memoryManager = &theManager;
140 const Locator* theLocator)
const 142 const int theFunctionID =
143 getFunctionIndex(theFunctionName);
145 if (theFunctionID != InvalidFunctionNumberID)
147 return *m_functionTable[theFunctionID];
151 MemoryManager*
const theManager = m_memoryManager;
174 const int theFunctionID =
175 getFunctionIndex(theFunctionName);
177 if (theFunctionID != InvalidFunctionNumberID)
179 return *m_functionTable[theFunctionID];
183 MemoryManager*
const theManager = m_memoryManager;
205 assert(theFunctionID >= 0 && theFunctionID < TableSize);
206 assert(m_functionTable[theFunctionID] != 0);
208 return *m_functionTable[theFunctionID];
222 if (theFunctionID >= 0 && theFunctionID < TableSize)
225 s_functionNames[theFunctionID].m_name,
226 s_functionNames[theFunctionID].m_size);
241 return getFunctionIndex(theName);
255 InstallFunction(theFunctionName.
c_str(), theFunction);
267 return UninstallFunction(theFunctionName.
c_str());
278 const XalanDOMChar* theFunctionName,
288 UninstallFunction(
const XalanDOMChar* theFunctionName);
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);
321 *theIterator = theString;
340 static const XalanDOMChar s_id[];
343 static const XalanDOMChar s_key[];
346 static const XalanDOMChar s_not[];
349 static const XalanDOMChar s_sum[];
352 static const XalanDOMChar s_lang[];
355 static const XalanDOMChar s_last[];
358 static const XalanDOMChar s_name[];
361 static const XalanDOMChar s_true[];
364 static const XalanDOMChar s_count[];
367 static const XalanDOMChar s_false[];
370 static const XalanDOMChar s_floor[];
373 static const XalanDOMChar s_round[];
376 static const XalanDOMChar s_concat[];
379 static const XalanDOMChar s_number[];
382 static const XalanDOMChar s_string[];
385 static const XalanDOMChar s_boolean[];
388 static const XalanDOMChar s_ceiling[];
391 static const XalanDOMChar s_current[];
394 static const XalanDOMChar s_contains[];
397 static const XalanDOMChar s_document[];
400 static const XalanDOMChar s_position[];
403 static const XalanDOMChar s_substring[];
406 static const XalanDOMChar s_translate[];
409 static const XalanDOMChar s_localName[];
412 static const XalanDOMChar s_generateId[];
415 static const XalanDOMChar s_startsWith[];
418 static const XalanDOMChar s_formatNumber[];
421 static const XalanDOMChar s_namespaceUri[];
424 static const XalanDOMChar s_stringLength[];
427 static const XalanDOMChar s_normalizeSpace[];
430 static const XalanDOMChar s_substringAfter[];
433 static const XalanDOMChar s_systemProperty[];
436 static const XalanDOMChar s_substringBefore[];
439 static const XalanDOMChar s_elementAvailable[];
442 static const XalanDOMChar s_functionAvailable[];
445 static const XalanDOMChar s_unparsedEntityUri[];
458 return getFunctionIndex(
464 getFunctionIndex(
const XalanDOMChar* theName)
466 return getFunctionIndex(
473 const XalanDOMChar* theName,
474 StringSizeType theNameLength);
476 MemoryManager* m_memoryManager;
478 const Function* m_functionTable[TableSize];
480 const Function**
const m_functionTableEnd;
488 XALAN_CPP_NAMESPACE_END
492 #endif // XPATHFUNCTIONTABLE_HEADER_GUARD_1357924680 const XalanDOMChar * m_name
static MemoryManager & getDefaultXercesMemMgr()
int nameToID(const XalanDOMString &theName) const
Map a function name to the corresponding ID number.
const XalanDOMString & idToName(int theFunctionID, XalanDOMString &theResult) const
Map a function ID to the corresponding name.
void InstallFunction(const XalanDOMString &theFunctionName, const Function &theFunction)
Insert a named function into the function table.
Class defines a table of functions that can be called in XPath expresions.
Function::LocatorType LocatorType
const XalanDOMChar * c_str() const
XalanDOMString & assign(const XalanDOMChar *theSource)
static const SizeType s_functionNamesSize
Functor to delete objects, used in STL iteration algorithms.
void getInstalledFunctionNames(OutputIteratorType theIterator) const
Add a list of the names of installed functions to a vector of names.
const Function & operator[](int theFunctionID) const
Retrieve the function object for a specified function ID number.
XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType
void setMemoryManager(MemoryManager &theManager)
Exception class thrown when an unknown function is encountered.
bool isInstalledFunction(const XalanDOMString &theFunctionName) const
Whether a named function is in the function table.
XalanDOMString::size_type StringSizeType
DeleteFunctor< Function > DeleteFunctorType
Exception class thrown when an installFunction() is called with a function name that is not supported...
bool UninstallFunction(const XalanDOMString &theFunctionName)
Remove a named function from the function table.
#define XALAN_XPATH_EXPORT