You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by pe...@apache.org on 2004/05/25 20:11:32 UTC
cvs commit: xml-xerces/c/src/xercesc/util XMLString.cpp XMLString.hpp
peiyongz 2004/05/25 11:11:32
Modified: c/src/xercesc/util XMLString.cpp XMLString.hpp
Log:
removeChar() added
Revision Changes Path
1.32 +23 -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.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- XMLString.cpp 13 Jan 2004 17:12:34 -0000 1.31
+++ XMLString.cpp 25 May 2004 18:11:32 -0000 1.32
@@ -1771,6 +1771,28 @@
return;
}
+void XMLString::removeChar(const XMLCh* const srcString
+ , const XMLCh& toRemove
+ , XMLBuffer& dstBuffer)
+{
+ const XMLCh* pszSrc = srcString;
+
+ dstBuffer.reset();
+
+ while (*pszSrc)
+ {
+ if (*pszSrc == toRemove)
+ {
+ pszSrc++;
+ }
+ else
+ {
+ dstBuffer.append(*pszSrc);
+ pszSrc++;
+ }
+ }
+}
+
/**
* Fixes a platform dependent absolute path filename to standard URI form.
* 1. Windows: fix 'x:' to 'file:///x:' and convert any backslash to forward slash
1.25 +14 -0 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.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- XMLString.hpp 10 Mar 2004 17:35:17 -0000 1.24
+++ XMLString.hpp 25 May 2004 18:11:32 -0000 1.25
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.25 2004/05/25 18:11:32 peiyongz
+ * removeChar() added
+ *
* Revision 1.24 2004/03/10 17:35:17 amassari
* Fix documentation for binToText (bug# 9207)
*
@@ -257,6 +260,7 @@
#define XMLSTRING_HPP
#include <xercesc/util/BaseRefVectorOf.hpp>
+#include <xercesc/framework/XMLBuffer.hpp>
#include <xercesc/framework/MemoryManager.hpp>
#include <string.h>
@@ -1490,6 +1494,16 @@
*/
static void removeWS(XMLCh* const toConvert
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
+
+
+ /** Remove character
+ * @param srcString The string
+ * toRemove The character needs to be removed from the string
+ * dstBuffer The buffer containning the result
+ */
+ static void removeChar(const XMLCh* const srcString
+ , const XMLCh& toRemove
+ , XMLBuffer& dstBuffer);
/**
* Fixes a platform dependent absolute path filename to standard URI form.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org