You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2007/07/06 18:02:21 UTC

svn commit: r553937 - in /xerces/c/trunk: samples/src/SAX2Print/ samples/src/SAXPrint/ src/xercesc/framework/

Author: amassari
Date: Fri Jul  6 09:02:19 2007
New Revision: 553937

URL: http://svn.apache.org/viewvc?view=rev&rev=553937
Log:
Changed XMLFormatTarget interface to have writeChars use XMLSize_t (XERCESC-1531)

Modified:
    xerces/c/trunk/samples/src/SAX2Print/SAX2PrintHandlers.cpp
    xerces/c/trunk/samples/src/SAX2Print/SAX2PrintHandlers.hpp
    xerces/c/trunk/samples/src/SAXPrint/SAXPrintHandlers.cpp
    xerces/c/trunk/samples/src/SAXPrint/SAXPrintHandlers.hpp
    xerces/c/trunk/src/xercesc/framework/LocalFileFormatTarget.cpp
    xerces/c/trunk/src/xercesc/framework/LocalFileFormatTarget.hpp
    xerces/c/trunk/src/xercesc/framework/MemBufFormatTarget.cpp
    xerces/c/trunk/src/xercesc/framework/MemBufFormatTarget.hpp
    xerces/c/trunk/src/xercesc/framework/StdOutFormatTarget.cpp
    xerces/c/trunk/src/xercesc/framework/StdOutFormatTarget.hpp
    xerces/c/trunk/src/xercesc/framework/XMLFormatter.cpp
    xerces/c/trunk/src/xercesc/framework/XMLFormatter.hpp

Modified: xerces/c/trunk/samples/src/SAX2Print/SAX2PrintHandlers.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/SAX2Print/SAX2PrintHandlers.cpp?view=diff&rev=553937&r1=553936&r2=553937
==============================================================================
--- xerces/c/trunk/samples/src/SAX2Print/SAX2PrintHandlers.cpp (original)
+++ xerces/c/trunk/samples/src/SAX2Print/SAX2PrintHandlers.cpp Fri Jul  6 09:02:19 2007
@@ -96,7 +96,7 @@
 }
 
 void SAX2PrintHandlers::writeChars(const XMLByte* const toWrite,
-                                   const unsigned int count,
+                                   const XMLSize_t      count,
                                    XMLFormatter* const /* formatter */)
 {
     // For this one, just dump them to the standard output

Modified: xerces/c/trunk/samples/src/SAX2Print/SAX2PrintHandlers.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/SAX2Print/SAX2PrintHandlers.hpp?view=diff&rev=553937&r1=553936&r2=553937
==============================================================================
--- xerces/c/trunk/samples/src/SAX2Print/SAX2PrintHandlers.hpp (original)
+++ xerces/c/trunk/samples/src/SAX2Print/SAX2PrintHandlers.hpp Fri Jul  6 09:02:19 2007
@@ -47,10 +47,10 @@
         const   XMLByte* const  toWrite
     );
 
-    void writeChars
+    virtual void writeChars
     (
         const   XMLByte* const  toWrite
-        , const unsigned int    count
+        , const XMLSize_t       count
         , XMLFormatter* const   formatter
     );
 

Modified: xerces/c/trunk/samples/src/SAXPrint/SAXPrintHandlers.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/SAXPrint/SAXPrintHandlers.cpp?view=diff&rev=553937&r1=553936&r2=553937
==============================================================================
--- xerces/c/trunk/samples/src/SAXPrint/SAXPrintHandlers.cpp (original)
+++ xerces/c/trunk/samples/src/SAXPrint/SAXPrintHandlers.cpp Fri Jul  6 09:02:19 2007
@@ -94,7 +94,7 @@
 }
 
 void SAXPrintHandlers::writeChars(const XMLByte* const toWrite,
-                                  const unsigned int count,
+                                  const XMLSize_t      count,
                                   XMLFormatter* const /* formatter */)
 {
     // For this one, just dump them to the standard output

Modified: xerces/c/trunk/samples/src/SAXPrint/SAXPrintHandlers.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/SAXPrint/SAXPrintHandlers.hpp?view=diff&rev=553937&r1=553936&r2=553937
==============================================================================
--- xerces/c/trunk/samples/src/SAXPrint/SAXPrintHandlers.hpp (original)
+++ xerces/c/trunk/samples/src/SAXPrint/SAXPrintHandlers.hpp Fri Jul  6 09:02:19 2007
@@ -47,10 +47,10 @@
         const   XMLByte* const  toWrite
     );
 
-    void writeChars
+    virtual void writeChars
     (
         const   XMLByte* const  toWrite
-        , const unsigned int    count
+        , const XMLSize_t       count
         , XMLFormatter* const   formatter
     );
 

Modified: xerces/c/trunk/src/xercesc/framework/LocalFileFormatTarget.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/LocalFileFormatTarget.cpp?view=diff&rev=553937&r1=553936&r2=553937
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/LocalFileFormatTarget.cpp (original)
+++ xerces/c/trunk/src/xercesc/framework/LocalFileFormatTarget.cpp Fri Jul  6 09:02:19 2007
@@ -92,7 +92,7 @@
 }
 
 void LocalFileFormatTarget::writeChars(const XMLByte* const toWrite
-                                     , const unsigned int   count
+                                     , const XMLSize_t      count
                                      , XMLFormatter * const        )
 {
     if (count) {
@@ -105,7 +105,7 @@
         {
             //flush whatever we have in the buffer and the incoming byte stream
             flushBuffer();
-            XMLPlatformUtils::writeBufferToFile(fSource, (long) count, toWrite, fMemoryManager);
+            XMLPlatformUtils::writeBufferToFile(fSource, count, toWrite, fMemoryManager);
         }
     }
 
@@ -117,7 +117,7 @@
     // Exception thrown in writeBufferToFile, if any, will be propagated to
     // the XMLFormatter and then to the DOMLSSerializer, which may notify
     // application through DOMErrorHandler, if any.
-    XMLPlatformUtils::writeBufferToFile(fSource, (long) fIndex, fDataBuf, fMemoryManager);
+    XMLPlatformUtils::writeBufferToFile(fSource, fIndex, fDataBuf, fMemoryManager);
     fIndex = 0;
     fDataBuf[0] = 0;
     fDataBuf[fIndex + 1] = 0;
@@ -131,14 +131,14 @@
  *   enough memory for the new buffer, we got to notify the caller 
  *
  ***/
-bool LocalFileFormatTarget::insureCapacity(const unsigned int extraNeeded)
+bool LocalFileFormatTarget::insureCapacity(const XMLSize_t extraNeeded)
 {
     // If we can handle it, do nothing yet
     if (fIndex + extraNeeded < fCapacity)
         return true;
 
     // Oops, not enough room. Calc new capacity and allocate new buffer
-    const unsigned int newCap = (unsigned int)((fIndex + extraNeeded) * 2);
+    const XMLSize_t newCap = ((fIndex + extraNeeded) * 2);
     XMLByte* newBuf = 0;
 
     try

Modified: xerces/c/trunk/src/xercesc/framework/LocalFileFormatTarget.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/LocalFileFormatTarget.hpp?view=diff&rev=553937&r1=553936&r2=553937
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/LocalFileFormatTarget.hpp (original)
+++ xerces/c/trunk/src/xercesc/framework/LocalFileFormatTarget.hpp Fri Jul  6 09:02:19 2007
@@ -50,7 +50,7 @@
     //  Implementations of the format target interface
     // -----------------------------------------------------------------------
     virtual void writeChars(const XMLByte* const toWrite
-                          , const unsigned int   count
+                          , const XMLSize_t      count
                           , XMLFormatter* const  formatter);
 
     virtual void flush();
@@ -66,7 +66,7 @@
     //  Private helpers
     // -----------------------------------------------------------------------
     void flushBuffer();
-    bool insureCapacity(const unsigned int extraNeeded);
+    bool insureCapacity(const XMLSize_t extraNeeded);
 
     // -----------------------------------------------------------------------
     //  Private data members
@@ -89,8 +89,8 @@
     // -----------------------------------------------------------------------
     FileHandle      fSource;
     XMLByte*        fDataBuf;
-    unsigned int    fIndex;
-    unsigned int    fCapacity;
+    XMLSize_t       fIndex;
+    XMLSize_t       fCapacity;
     MemoryManager*  fMemoryManager;
 };
 

Modified: xerces/c/trunk/src/xercesc/framework/MemBufFormatTarget.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/MemBufFormatTarget.cpp?view=diff&rev=553937&r1=553936&r2=553937
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/MemBufFormatTarget.cpp (original)
+++ xerces/c/trunk/src/xercesc/framework/MemBufFormatTarget.cpp Fri Jul  6 09:02:19 2007
@@ -25,7 +25,7 @@
 
 XERCES_CPP_NAMESPACE_BEGIN
 
-MemBufFormatTarget::MemBufFormatTarget( int                  initCapacity
+MemBufFormatTarget::MemBufFormatTarget( XMLSize_t            initCapacity
                                       , MemoryManager* const manager)
     : fMemoryManager(manager)
     , fDataBuf(0)
@@ -48,7 +48,7 @@
 }
 
 void MemBufFormatTarget::writeChars(const XMLByte* const toWrite
-                                  , const unsigned int   count
+                                  , const XMLSize_t      count
                                   , XMLFormatter * const)
 {
 
@@ -81,14 +81,14 @@
 // ---------------------------------------------------------------------------
 //  MemBufFormatTarget: Private helper methods
 // ---------------------------------------------------------------------------
-void MemBufFormatTarget::insureCapacity(const unsigned int extraNeeded)
+void MemBufFormatTarget::insureCapacity(const XMLSize_t extraNeeded)
 {
     // If we can handle it, do nothing yet
     if (fIndex + extraNeeded < fCapacity)
         return;
 
     // Oops, not enough room. Calc new capacity and allocate new buffer
-    const unsigned int newCap = (unsigned int)((fIndex + extraNeeded) * 2);
+    const XMLSize_t newCap = ((fIndex + extraNeeded) * 2);
     XMLByte* newBuf = (XMLByte*) fMemoryManager->allocate
     (
         (newCap+4) * sizeof(XMLByte)

Modified: xerces/c/trunk/src/xercesc/framework/MemBufFormatTarget.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/MemBufFormatTarget.hpp?view=diff&rev=553937&r1=553936&r2=553937
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/MemBufFormatTarget.hpp (original)
+++ xerces/c/trunk/src/xercesc/framework/MemBufFormatTarget.hpp Fri Jul  6 09:02:19 2007
@@ -49,7 +49,7 @@
     //@{
     MemBufFormatTarget
     (
-          int                  initCapacity = 1023
+          XMLSize_t            initCapacity = 1023
         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
     ) ;
     ~MemBufFormatTarget();
@@ -59,7 +59,7 @@
     //  Implementations of the format target interface
     // -----------------------------------------------------------------------
     virtual void writeChars(const XMLByte* const toWrite
-                          , const unsigned int   count
+                          , const XMLSize_t      count
                           , XMLFormatter* const  formatter);
 
     // -----------------------------------------------------------------------
@@ -81,7 +81,7 @@
      *
      */
     //@}
-    unsigned int getLen() const
+    XMLSize_t getLen() const
     {
         return fIndex;
     }
@@ -105,7 +105,7 @@
     // -----------------------------------------------------------------------
     //  Private helpers
     // -----------------------------------------------------------------------
-    void insureCapacity(const unsigned int extraNeeded);
+    void insureCapacity(const XMLSize_t extraNeeded);
 
     // -----------------------------------------------------------------------
     //  Private data members
@@ -125,8 +125,8 @@
     // -----------------------------------------------------------------------
     MemoryManager*  fMemoryManager;
     XMLByte*        fDataBuf;
-    unsigned int    fIndex;
-    unsigned int    fCapacity;
+    XMLSize_t       fIndex;
+    XMLSize_t       fCapacity;
 
 };
 

Modified: xerces/c/trunk/src/xercesc/framework/StdOutFormatTarget.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/StdOutFormatTarget.cpp?view=diff&rev=553937&r1=553936&r2=553937
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/StdOutFormatTarget.cpp (original)
+++ xerces/c/trunk/src/xercesc/framework/StdOutFormatTarget.cpp Fri Jul  6 09:02:19 2007
@@ -36,7 +36,7 @@
 }
 
 void StdOutFormatTarget::writeChars(const XMLByte* const  toWrite
-                                  , const unsigned int    count
+                                  , const XMLSize_t       count
                                   , XMLFormatter* const)
 {
     // Surprisingly, Solaris was the only platform on which

Modified: xerces/c/trunk/src/xercesc/framework/StdOutFormatTarget.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/StdOutFormatTarget.hpp?view=diff&rev=553937&r1=553936&r2=553937
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/StdOutFormatTarget.hpp (original)
+++ xerces/c/trunk/src/xercesc/framework/StdOutFormatTarget.hpp Fri Jul  6 09:02:19 2007
@@ -39,7 +39,7 @@
     //  Implementations of the format target interface
     // -----------------------------------------------------------------------
     virtual void writeChars(const XMLByte* const toWrite
-                          , const unsigned int   count
+                          , const XMLSize_t      count
                           , XMLFormatter* const  formatter);
 
     virtual void flush();

Modified: xerces/c/trunk/src/xercesc/framework/XMLFormatter.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/XMLFormatter.cpp?view=diff&rev=553937&r1=553936&r2=553937
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/XMLFormatter.cpp (original)
+++ xerces/c/trunk/src/xercesc/framework/XMLFormatter.cpp Fri Jul  6 09:02:19 2007
@@ -374,7 +374,7 @@
 // ---------------------------------------------------------------------------
 void
 XMLFormatter::formatBuf(const   XMLCh* const    toFormat
-                        , const unsigned int    count
+                        , const XMLSize_t       count
                         , const EscapeFlags     escapeFlags
                         , const UnRepFlags      unrepFlags)
 {
@@ -486,9 +486,9 @@
 }
 
 
-unsigned int 
+XMLSize_t 
 XMLFormatter::handleUnEscapedChars(const XMLCh *                  srcPtr, 
-                                   const unsigned int             oCount, 
+                                   const XMLSize_t                oCount, 
                                    const UnRepFlags               actualUnRep) 
 { 
    //
@@ -503,7 +503,7 @@
                                              : XMLTranscoder::UnRep_Throw;
                                              	
    XMLSize_t charsEaten; 
-   unsigned int count = oCount; 
+   XMLSize_t count = oCount; 
  
    while (count) { 
       const XMLSize_t srcChars = (count > kTmpBufSize) ? (int)kTmpBufSize : count; 
@@ -551,7 +551,7 @@
  * "0x000x000xFF0xFE"
  **/
 void XMLFormatter::writeBOM(const XMLByte* const toFormat
-                          , const unsigned int   count)
+                          , const XMLSize_t      count)
 {
     fTarget->writeChars(toFormat, count, this);    
 }
@@ -602,8 +602,8 @@
 }
 
 
-const XMLByte* XMLFormatter::getCharRef(unsigned int & count, 
-                                        XMLByte*       &ref, 
+const XMLByte* XMLFormatter::getCharRef(XMLSize_t     &count, 
+                                        XMLByte*      &ref, 
                                         const XMLCh *  stdRef) 
 {
    if (!ref) { 
@@ -631,7 +631,7 @@
 }
 
 void XMLFormatter::specialFormat(const  XMLCh* const    toFormat
-                                , const unsigned int    count
+                                , const XMLSize_t       count
                                 , const EscapeFlags     escapeFlags)
 {
     //

Modified: xerces/c/trunk/src/xercesc/framework/XMLFormatter.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/XMLFormatter.hpp?view=diff&rev=553937&r1=553936&r2=553937
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/XMLFormatter.hpp (original)
+++ xerces/c/trunk/src/xercesc/framework/XMLFormatter.hpp Fri Jul  6 09:02:19 2007
@@ -231,7 +231,7 @@
     void formatBuf
     (
         const   XMLCh* const    toFormat
-        , const unsigned int    count
+        , const XMLSize_t       count
         , const EscapeFlags     escapeFlags = DefaultEscape
         , const UnRepFlags      unrepFlags = DefaultUnRep
     );
@@ -250,7 +250,7 @@
     );
 
     void writeBOM(const XMLByte* const toFormat
-                , const unsigned int   count);
+                , const XMLSize_t      count);
 
     //@}
 
@@ -349,7 +349,7 @@
     // -----------------------------------------------------------------------
     //  Private helper methods
     // -----------------------------------------------------------------------
-    const XMLByte* getCharRef(unsigned int & count, 
+    const XMLByte* getCharRef(XMLSize_t     &count, 
                               XMLByte*      &ref, 
                               const XMLCh *  stdRef);  
  
@@ -360,14 +360,14 @@
                     , const XMLCh                     toCheck);
                               
 
-    unsigned int handleUnEscapedChars(const XMLCh *                  srcPtr, 
-                                      const unsigned int             count, 
-                                      const UnRepFlags               unrepFlags);
+    XMLSize_t handleUnEscapedChars(const XMLCh *      srcPtr, 
+                                   const XMLSize_t    count, 
+                                   const UnRepFlags   unrepFlags);
 
     void specialFormat
     (
         const   XMLCh* const    toFormat
-        , const unsigned int    count
+        , const XMLSize_t       count
         , const EscapeFlags     escapeFlags
     );
 
@@ -420,15 +420,15 @@
     XMLTranscoder*              fXCoder;
     XMLByte                     fTmpBuf[kTmpBufSize + 4];
     XMLByte*                    fAposRef;
-    unsigned int                fAposLen;
+    XMLSize_t                   fAposLen;
     XMLByte*                    fAmpRef;
-    unsigned int                fAmpLen;
+    XMLSize_t                   fAmpLen;
     XMLByte*                    fGTRef;
-    unsigned int                fGTLen;
+    XMLSize_t                   fGTLen;
     XMLByte*                    fLTRef;
-    unsigned int                fLTLen;
+    XMLSize_t                   fLTLen;
     XMLByte*                    fQuoteRef;
-    unsigned int                fQuoteLen;
+    XMLSize_t                   fQuoteLen;
     bool                        fIsXML11;
     MemoryManager*              fMemoryManager;
 };
@@ -449,7 +449,7 @@
     virtual void writeChars
     (
           const XMLByte* const      toWrite
-        , const unsigned int        count
+        , const XMLSize_t           count
         ,       XMLFormatter* const formatter
     ) = 0;
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org