You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2008/09/14 23:04:58 UTC
svn commit: r695288 - in /xalan/c/trunk/src/xalanc/PlatformSupport:
DOMStringHelper.cpp DOMStringHelper.hpp
Author: dbertoni
Date: Sun Sep 14 14:04:58 2008
New Revision: 695288
URL: http://svn.apache.org/viewvc?rev=695288&view=rev
Log:
Beginning to add support for case-ordering for xsl:sort.
Modified:
xalan/c/trunk/src/xalanc/PlatformSupport/DOMStringHelper.cpp
xalan/c/trunk/src/xalanc/PlatformSupport/DOMStringHelper.hpp
Modified: xalan/c/trunk/src/xalanc/PlatformSupport/DOMStringHelper.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/DOMStringHelper.cpp?rev=695288&r1=695287&r2=695288&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/DOMStringHelper.cpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/DOMStringHelper.cpp Sun Sep 14 14:04:58 2008
@@ -43,15 +43,6 @@
-// Xerces header files
-#include <xercesc/util/XMLString.hpp>
-
-#if !defined(XML_LSTRSUPPORT)
-#include <xercesc/util/PlatformUtils.hpp>
-#endif
-
-
-
#include <xalanc/Include/STLHelper.hpp>
@@ -617,6 +608,20 @@
+template <class CharType>
+class CaseFlipTransform
+{
+public:
+
+ CharType
+ operator()(CharType theChar) const
+ {
+ return flipCaseASCII(theChar);
+ }
+};
+
+
+
template<class InputCharType, class OutputCharType>
IdentityTransform<InputCharType, OutputCharType>
makeIdentityTransform(
@@ -861,10 +866,10 @@
#if defined(XALAN_USE_WINDOWS_COLLATION)
return _wcscoll_l(theLHS, theRHS, s_locale);
#else
- return doCollationCompare(
- theLHS,
- theRHS,
- makeXalanDOMCharIdentityTransform());
+ return doCollationCompare(
+ theLHS,
+ theRHS,
+ makeXalanDOMCharIdentityTransform());
#endif
}
Modified: xalan/c/trunk/src/xalanc/PlatformSupport/DOMStringHelper.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/DOMStringHelper.hpp?rev=695288&r1=695287&r2=695288&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/DOMStringHelper.hpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/DOMStringHelper.hpp Sun Sep 14 14:04:58 2008
@@ -1534,6 +1534,32 @@
/**
+ * Flips the case to of the supplied character. This function works only with
+ * the Unicode characters A-Z and a-z.
+ *
+ * @param theString target string
+ * @return string containing lower case characters
+ */
+inline XalanDOMChar
+flipCaseASCII(XalanDOMChar theChar)
+{
+ if (theChar >= XalanUnicode::charLetter_A && theChar <= XalanUnicode::charLetter_Z)
+ {
+ return XalanDOMChar(theChar - (XalanUnicode::charLetter_A - XalanUnicode::charLetter_a));
+ }
+ else if (theChar >= XalanUnicode::charLetter_a && theChar <= XalanUnicode::charLetter_z)
+ {
+ return XalanDOMChar(theChar + (XalanUnicode::charLetter_A - XalanUnicode::charLetter_a));
+ }
+ else
+ {
+ return theChar;
+ }
+}
+
+
+
+/**
* Converts ASCII alphabetic characters from upper case to
* lower case. This function works only with the characters
* a-z and A-Z.
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org