#include "../config/pathan_config.h" // CollationImpl.cpp: implementation of the CollationImpl class. // ////////////////////////////////////////////////////////////////////// #include #include #include #include #include ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CollationImpl::CollationImpl(XPath2MemoryManager* memMgr, CollationHelper* helper) { _memMgr=memMgr; _helper=helper; } const XMLCh* CollationImpl::getCollationName() const { return _helper->getCollationName(); } int CollationImpl::compare(const XMLCh* const string1, const XMLCh* const string2) const { return _helper->compare(string1,string2); } Sequence CollationImpl::sort(Sequence data, const DynamicContext* context) const { // build a sequence made of strings Sequence stringSeq = Sequence(data.getLength(), context->getMemoryManager()); for(Sequence::iterator it=data.begin(); it!=data.end(); ++it) { const XMLCh *str = (*it)->asString(context); stringSeq.addItem(DatatypeFactory::STR2AT::createString(context->getMemoryManager(), str, context)); } stringSeq.sortWithCollation(this, context); return stringSeq; }