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...@locus.apache.org on 2000/07/25 16:45:07 UTC
cvs commit: xml-xalan/c/src/XercesPlatformSupport XercesDOMPrintWriter.cpp
dbertoni 00/07/25 07:45:06
Modified: c/src/XercesPlatformSupport XercesDOMPrintWriter.cpp
Log:
Added code to write const char* directly to the stream, rather than transcoding to UTF-16.
Revision Changes Path
1.11 +23 -1 xml-xalan/c/src/XercesPlatformSupport/XercesDOMPrintWriter.cpp
Index: XercesDOMPrintWriter.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XercesPlatformSupport/XercesDOMPrintWriter.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- XercesDOMPrintWriter.cpp 2000/06/30 21:27:29 1.10
+++ XercesDOMPrintWriter.cpp 2000/07/25 14:45:05 1.11
@@ -118,7 +118,29 @@
unsigned int theOffset,
unsigned int theLength)
{
- write(DOMString(s), theOffset, theLength);
+ assert(s != 0);
+ assert(length(s) == 0 || theOffset < length(s));
+
+ if (theLength == -1)
+ {
+ if (theOffset == 0)
+ {
+ m_OutputStream.write(s);
+ }
+ else
+ {
+ m_OutputStream.write(s + theOffset);
+ }
+ }
+ else
+ {
+ const long theStopIndex = theOffset + theLength;
+
+ for (long i = theOffset; i < theStopIndex; i++)
+ {
+ m_OutputStream.write(s[i]);
+ }
+ }
}