You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@locus.apache.org on 2000/10/11 01:56:01 UTC

cvs commit: xml-xerces/c/samples/SAXPrint SAXPrintHandlers.cpp SAXPrintHandlers.hpp

andyh       00/10/10 16:56:00

  Modified:    c/samples/DOMPrint DOMPrint.cpp
               c/samples/SAX2Print SAX2PrintHandlers.cpp
                        SAX2PrintHandlers.hpp
               c/samples/SAXPrint SAXPrintHandlers.cpp SAXPrintHandlers.hpp
  Log:
  XMLFormatter patch, contributed by Bill Schindler.  Fix problems with
  output to multi-byte encodings.
  
  Revision  Changes    Path
  1.26      +8 -2      xml-xerces/c/samples/DOMPrint/DOMPrint.cpp
  
  Index: DOMPrint.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/DOMPrint/DOMPrint.cpp,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- DOMPrint.cpp	2000/09/28 17:39:50	1.25
  +++ DOMPrint.cpp	2000/10/10 23:55:47	1.26
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: DOMPrint.cpp,v 1.25 2000/09/28 17:39:50 andyh Exp $
  + * $Id: DOMPrint.cpp,v 1.26 2000/10/10 23:55:47 andyh Exp $
    */
   
   
  @@ -192,12 +192,18 @@
       // -----------------------------------------------------------------------
       void writeChars(const   XMLByte* const  toWrite)
       {
  +    }
  +
  +    void writeChars(const   XMLByte* const  toWrite,
  +                    const   unsigned int    count,
  +                            XMLFormatter *  formatter)
  +    {
           // Surprisingly, Solaris was the only platform on which
           // required the char* cast to print out the string correctly.
           // Without the cast, it was printing the pointer value in hex.
           // Quite annoying, considering every other platform printed
           // the string with the explicit cast to char* below.
  -        cout << (char *) toWrite;
  +        cout.write((char *) toWrite, (int) count);
       }
   
   private:
  
  
  
  1.3       +10 -1     xml-xerces/c/samples/SAX2Print/SAX2PrintHandlers.cpp
  
  Index: SAX2PrintHandlers.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/SAX2Print/SAX2PrintHandlers.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SAX2PrintHandlers.cpp	2000/08/09 22:20:38	1.2
  +++ SAX2PrintHandlers.cpp	2000/10/10 23:55:53	1.3
  @@ -56,6 +56,10 @@
   
   /*
    * $Log: SAX2PrintHandlers.cpp,v $
  + * Revision 1.3  2000/10/10 23:55:53  andyh
  + * XMLFormatter patch, contributed by Bill Schindler.  Fix problems with
  + * output to multi-byte encodings.
  + *
    * Revision 1.2  2000/08/09 22:20:38  jpolast
    * updates for changes to sax2 core functionality.
    *
  @@ -138,13 +142,19 @@
   // ---------------------------------------------------------------------------
   void SAX2PrintHandlers::writeChars(const XMLByte* const toWrite)
   {
  +}
  +
  +void SAX2PrintHandlers::writeChars(const XMLByte* const toWrite,
  +                                   const unsigned int count,
  +                                   XMLFormatter* const formatter)
  +{
       // For this one, just dump them to the standard output
       // Surprisingly, Solaris was the only platform on which
       // required the char* cast to print out the string correctly.
       // Without the cast, it was printing the pointer value in hex.
       // Quite annoying, considering every other platform printed
       // the string with the explicit cast to char* below.
  -    cout << (char *) toWrite;
  +  cout.write((char *) toWrite, (int) count);
   	cout.flush();
   }
   
  
  
  
  1.3       +10 -0     xml-xerces/c/samples/SAX2Print/SAX2PrintHandlers.hpp
  
  Index: SAX2PrintHandlers.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/SAX2Print/SAX2PrintHandlers.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SAX2PrintHandlers.hpp	2000/08/09 22:20:39	1.2
  +++ SAX2PrintHandlers.hpp	2000/10/10 23:55:55	1.3
  @@ -56,6 +56,10 @@
   
   /*
    * $Log: SAX2PrintHandlers.hpp,v $
  + * Revision 1.3  2000/10/10 23:55:55  andyh
  + * XMLFormatter patch, contributed by Bill Schindler.  Fix problems with
  + * output to multi-byte encodings.
  + *
    * Revision 1.2  2000/08/09 22:20:39  jpolast
    * updates for changes to sax2 core functionality.
    *
  @@ -89,6 +93,13 @@
       void writeChars
       (
           const   XMLByte* const  toWrite
  +    );
  +
  +    void writeChars
  +    (
  +        const   XMLByte* const  toWrite
  +        , const unsigned int    count
  +        , XMLFormatter* const   formatter
       );
   
   
  
  
  
  1.12      +10 -1     xml-xerces/c/samples/SAXPrint/SAXPrintHandlers.cpp
  
  Index: SAXPrintHandlers.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/SAXPrint/SAXPrintHandlers.cpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SAXPrintHandlers.cpp	2000/07/25 22:41:32	1.11
  +++ SAXPrintHandlers.cpp	2000/10/10 23:55:58	1.12
  @@ -56,6 +56,10 @@
   
   /*
    * $Log: SAXPrintHandlers.cpp,v $
  + * Revision 1.12  2000/10/10 23:55:58  andyh
  + * XMLFormatter patch, contributed by Bill Schindler.  Fix problems with
  + * output to multi-byte encodings.
  + *
    * Revision 1.11  2000/07/25 22:41:32  aruna1
    * Char definitions in XMLUni moved to XMLUniDefs
    *
  @@ -170,13 +174,19 @@
   // ---------------------------------------------------------------------------
   void SAXPrintHandlers::writeChars(const XMLByte* const toWrite)
   {
  +}
  +
  +void SAXPrintHandlers::writeChars(const XMLByte* const toWrite,
  +                                  const unsigned int count,
  +                                  XMLFormatter* const formatter)
  +{
       // For this one, just dump them to the standard output
       // Surprisingly, Solaris was the only platform on which
       // required the char* cast to print out the string correctly.
       // Without the cast, it was printing the pointer value in hex.
       // Quite annoying, considering every other platform printed
       // the string with the explicit cast to char* below.
  -    cout << (char *) toWrite;
  +  cout.write((char *) toWrite, (int) count);
   	cout.flush();
   }
   
  
  
  
  1.7       +12 -0     xml-xerces/c/samples/SAXPrint/SAXPrintHandlers.hpp
  
  Index: SAXPrintHandlers.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/SAXPrint/SAXPrintHandlers.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SAXPrintHandlers.hpp	2000/04/06 19:09:52	1.6
  +++ SAXPrintHandlers.hpp	2000/10/10 23:55:59	1.7
  @@ -56,6 +56,10 @@
   
   /*
    * $Log: SAXPrintHandlers.hpp,v $
  + * Revision 1.7  2000/10/10 23:55:59  andyh
  + * XMLFormatter patch, contributed by Bill Schindler.  Fix problems with
  + * output to multi-byte encodings.
  + *
    * Revision 1.6  2000/04/06 19:09:52  roddey
    * Some more improvements to output formatting. Now it will correctly
    * handle doing the 'replacement char' style of dealing with chars
  @@ -108,6 +112,13 @@
       void writeChars
       (
           const   XMLByte* const  toWrite
  +    );
  +
  +    void writeChars
  +    (
  +        const   XMLByte* const  toWrite
  +        , const unsigned int    count
  +        , XMLFormatter* const   formatter
       );