DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7448>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7448 Would like DOMString::operator< for STL use, code provided Summary: Would like DOMString::operator< for STL use, code provided Product: Xerces-C++ Version: 1.7.0 Platform: All OS/Version: All Status: NEW Severity: Enhancement Priority: Other Component: DOM AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] You cannot store DOMStrings in STL sorted containers unless they provide an operator<() method. I've added such a method to my local copy of Xerces and would like to see it added to the distribution. Code follows in the form of context diff output of dom/DOMString.hpp and dom/DOMString.cpp. =============================================================================== % diff -c DOMString.hpp.~1~ DOMString.hpp *** DOMString.hpp.~1~ Thu Mar 21 14:29:03 2002 --- DOMString.hpp Mon Mar 25 09:19:56 2002 *************** *** 454,459 **** --- 454,473 ---- int compareString(const DOMString &other) const; /** + * Less than operator. + * + * @param other The object to be compared with. + * @return True if this DOMString is lexically less than the argument + * DOMString. + * <p> + * This code simply calls compareString and returns true if it returns + * -1 and false otherwise. While this method may seem redundant, it + * is required if the DOMString is to be stored in one of the STL + * sorted containers. + */ + bool operator < (const DOMString &other) const; + + /** * Tells if a <code>DOMString</code> contains the same character data * as another. * =============================================================================== % diff -c DOMString.cpp.~1~ DOMString.cpp *** DOMString.cpp.~1~ Thu Mar 21 14:29:35 2002 --- DOMString.cpp Mon Mar 25 09:25:44 2002 *************** *** 1158,1163 **** --- 1158,1169 ---- }; + bool DOMString::operator < (const DOMString &other) const + { + return (compareString(other) < 0); + } + + DOMString DOMString::substringData(unsigned int offset, unsigned int count) const { if (count == 0) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]