You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ca...@apache.org on 2005/04/05 19:00:45 UTC
cvs commit: xml-xerces/c/src/xercesc/util XMLString.cpp XMLString.hpp
cargilld 2005/04/05 10:00:45
Modified: c/src/xercesc/dom/impl DOMConfigurationImpl.cpp
c/src/xercesc/util XMLString.cpp XMLString.hpp
Log:
Implement version of lowercase that only check a to z, instead of all characters, and don't rely on functionality provided in the transcoders.
Revision Changes Path
1.12 +3 -3 xml-xerces/c/src/xercesc/dom/impl/DOMConfigurationImpl.cpp
Index: DOMConfigurationImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMConfigurationImpl.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- DOMConfigurationImpl.cpp 26 Jan 2005 13:40:20 -0000 1.11
+++ DOMConfigurationImpl.cpp 5 Apr 2005 17:00:45 -0000 1.12
@@ -93,7 +93,7 @@
XMLCh* lowerCaseName = XMLString::replicate(name, fMemoryManager);
ArrayJanitor<XMLCh> janName(lowerCaseName, fMemoryManager);
- XMLString::lowerCase(lowerCaseName);
+ XMLString::lowerCaseASCII(lowerCaseName);
if(!canSetParameter(lowerCaseName, value)) {
throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, fMemoryManager);
@@ -176,7 +176,7 @@
XMLCh* lowerCaseName = XMLString::replicate(name, fMemoryManager);
ArrayJanitor<XMLCh> janName(lowerCaseName, fMemoryManager);
- XMLString::lowerCase(lowerCaseName);
+ XMLString::lowerCaseASCII(lowerCaseName);
DOMConfigurationFeature whichFlag;
try {
@@ -247,7 +247,7 @@
XMLCh* lowerCaseName = XMLString::replicate(name, fMemoryManager);
ArrayJanitor<XMLCh> janName(lowerCaseName, fMemoryManager);
- XMLString::lowerCase(lowerCaseName);
+ XMLString::lowerCaseASCII(lowerCaseName);
if(XMLString::equals(lowerCaseName, fgCANONICAL_FORM)) {
return FEATURE_CANONICAL_FORM;
1.45 +16 -1 xml-xerces/c/src/xercesc/util/XMLString.cpp
Index: XMLString.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XMLString.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- XMLString.cpp 20 Mar 2005 19:02:45 -0000 1.44
+++ XMLString.cpp 5 Apr 2005 17:00:45 -0000 1.45
@@ -1472,6 +1472,21 @@
XMLPlatformUtils::fgTransService->lowerCase(toLowerCase);
}
+void XMLString::lowerCaseASCII(XMLCh* const toLowerCase)
+{
+ XMLCh* psz1 = toLowerCase;
+
+ if (!psz1)
+ return;
+
+ while (*psz1) {
+ if (*psz1 >= chLatin_A && *psz1 <= chLatin_Z)
+ *psz1 = *psz1 - chLatin_A + chLatin_a;
+
+ psz1++;
+ }
+}
+
void XMLString::subString(XMLCh* const targetStr, const XMLCh* const srcStr
, const int startIndex, const int endIndex
, MemoryManager* const manager)
1.34 +11 -1 xml-xerces/c/src/xercesc/util/XMLString.hpp
Index: XMLString.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XMLString.hpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- XMLString.hpp 20 Mar 2005 19:02:45 -0000 1.33
+++ XMLString.hpp 5 Apr 2005 17:00:45 -0000 1.34
@@ -16,6 +16,9 @@
/*
* $Log$
+ * Revision 1.34 2005/04/05 17:00:45 cargilld
+ * Implement version of lowercase that only check a to z, instead of all characters, and don't rely on functionality provided in the transcoders.
+ *
* Revision 1.33 2005/03/20 19:02:45 cargilld
* Implement versions of uppercase and compareIstring that only check a to z, instead of all characters, and don't rely on functionality provided in the transcoders.
*
@@ -1514,7 +1517,7 @@
static void upperCase(XMLCh* const toUpperCase);
/** Converts a string to uppercase
- * The routine only uppercases A to Z.
+ * The routine only uppercases A to Z (other characters not changed).
* @param toUpperCase The string which needs to be converted to uppercase.
* On return, this buffer also holds the converted uppercase string
*/
@@ -1526,6 +1529,13 @@
*/
static void lowerCase(XMLCh* const toLowerCase);
+ /** Converts a string to lowercase
+ * The routine only lowercases a to z (other characters not changed).
+ * @param toLowerCase The string which needs to be converted to lowercase.
+ * On return, this buffer also holds the converted lowercase string
+ */
+ static void lowerCaseASCII(XMLCh* const toLowerCase);
+
/** Check if string is WhiteSpace:replace
* @param toCheck The string which needs to be checked.
*/
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org