dbertoni    01/06/15 13:13:47

  Modified:    c/src/PlatformSupport XalanNullOutputStream.cpp
                        XalanNullOutputStream.hpp XalanOutputStream.cpp
                        XalanOutputStream.hpp
  Log:
  Made virtual functions non-virtual and in-line.
  
  Revision  Changes    Path
  1.2       +3 -40     xml-xalan/c/src/PlatformSupport/XalanNullOutputStream.cpp
  
  Index: XalanNullOutputStream.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/PlatformSupport/XalanNullOutputStream.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XalanNullOutputStream.cpp 2000/09/27 16:24:12     1.1
  +++ XalanNullOutputStream.cpp 2001/06/15 20:13:42     1.2
  @@ -60,7 +60,7 @@
   
   
   XalanNullOutputStream::XalanNullOutputStream() :
  -     XalanOutputStream()
  +     XalanOutputStream(1)
   {
   }
   
  @@ -73,42 +73,7 @@
   
   
   void
  -XalanNullOutputStream::flush()
  -{
  -}
  -
  -
  -
  -void
  -XalanNullOutputStream::write(char    /* theChar */)
  -{
  -}
  -
  -
  -
  -void
  -XalanNullOutputStream::write(XalanDOMChar    /* theChar */)
  -{
  -}
  -
  -
  -
  -void
  -XalanNullOutputStream::write(const XalanDOMChar*             /* theBuffer */)
  -{
  -}
  -
  -
  -
  -void
  -XalanNullOutputStream::write(const char*             /* theBuffer */)
  -{
  -}
  -
  -
  -
  -void
  -XalanNullOutputStream::write(
  +XalanNullOutputStream::writeData(
                        const char*             /* theBuffer */,
                        unsigned long   /* theBufferLength */)
   {
  @@ -117,8 +82,6 @@
   
   
   void
  -XalanNullOutputStream::write(
  -                     const XalanDOMChar*             /* theBuffer */,
  -                     unsigned long                   /* theBufferLength */)
  +XalanNullOutputStream::doFlush()
   {
   }
  
  
  
  1.2       +6 -21     xml-xalan/c/src/PlatformSupport/XalanNullOutputStream.hpp
  
  Index: XalanNullOutputStream.hpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/PlatformSupport/XalanNullOutputStream.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XalanNullOutputStream.hpp 2000/09/27 16:24:12     1.1
  +++ XalanNullOutputStream.hpp 2001/06/15 20:13:43     1.2
  @@ -79,31 +79,16 @@
       virtual
        ~XalanNullOutputStream();
   
  -    // These are inherited from XalanOutputStream...
  -    virtual void
  -     flush();
  -
  -    virtual void
  -     write(char      theChar);
  -
  -    virtual void
  -     write(XalanDOMChar      theChar);
  +protected:
   
  -    virtual void
  -     write(const XalanDOMChar*       theBuffer);
  -
  -    virtual void
  -     write(const char*       theBuffer);
  -
  -    virtual void
  -     write(
  +    // These are inherited from XalanOutputStream...
  +     virtual void
  +     writeData(
                        const char*             theBuffer,
                        unsigned long   theBufferLength);
   
  -    virtual void
  -     write(
  -                     const XalanDOMChar*             theBuffer,
  -                     unsigned long                   theBufferLength);
  +     virtual void
  +     doFlush();
   
   private:
   
  
  
  
  1.10      +14 -87    xml-xalan/c/src/PlatformSupport/XalanOutputStream.cpp
  
  Index: XalanOutputStream.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/XalanOutputStream.cpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- XalanOutputStream.cpp     2001/02/09 01:54:26     1.9
  +++ XalanOutputStream.cpp     2001/06/15 20:13:43     1.10
  @@ -79,6 +79,11 @@
        m_writeAsUTF16(false),
        m_transcodingBuffer()
   {
  +     if (m_bufferSize == 0)
  +     {
  +             m_bufferSize = 1;
  +     }
  +
        m_buffer.reserve(theBufferSize + 1);
   }
   
  @@ -92,44 +97,6 @@
   
   
   void
  -XalanOutputStream::flush()
  -{
  -     flushBuffer();
  -
  -     doFlush();
  -}
  -
  -
  -
  -void
  -XalanOutputStream::write(char        theChar)
  -{
  -     write(&theChar, 1);
  -}
  -
  -
  -
  -void
  -XalanOutputStream::write(XalanDOMChar        theChar)
  -{
  -     if (m_bufferSize == 0)
  -     {
  -             doWrite(&theChar, 1);
  -     }
  -     else
  -     {
  -             if (m_buffer.size() == m_bufferSize)
  -             {
  -                     flushBuffer();
  -             }
  -
  -             m_buffer.push_back(theChar);
  -     }
  -}
  -
  -
  -
  -void
   XalanOutputStream::write(
                        const XalanDOMChar*             theBuffer,
                        unsigned long                   theBufferLength)
  @@ -156,45 +123,6 @@
   
   
   void
  -XalanOutputStream::write(const XalanDOMChar* theBuffer)
  -{
  -     if (theBuffer != 0)
  -     {
  -             write(theBuffer, length(theBuffer));
  -     }
  -}
  -
  -
  -
  -void
  -XalanOutputStream::write(const char* theBuffer)
  -{
  -     assert(theBuffer != 0);
  -
  -     flushBuffer();
  -
  -     writeData(theBuffer,
  -                   strlen(theBuffer));
  -}
  -
  -
  -
  -void
  -XalanOutputStream::write(
  -                     const char*             theBuffer,
  -                     unsigned long   theBufferLength)
  -{
  -     assert(theBuffer != 0);
  -
  -     flushBuffer();
  -
  -     writeData(theBuffer,
  -                       theBufferLength);
  -}
  -
  -
  -
  -void
   XalanOutputStream::transcode(
                        const XalanDOMChar*             theBuffer,
                        TranscodeVectorType&    theDestination)
  @@ -327,14 +255,6 @@
   
   
   
  -const XalanDOMString&
  -XalanOutputStream::getOutputEncoding() const
  -{
  -     return m_encoding;
  -}
  -
  -
  -
   void
   XalanOutputStream::setOutputEncoding(const XalanDOMString&   theEncoding)
   {
  @@ -463,11 +383,18 @@
   
   
   void
  -XalanOutputStream::setBufferSize(BufferType::size_type               
theBufferSize)
  +XalanOutputStream::setBufferSize(BufferType::size_type       theBufferSize)
   {
        flushBuffer();
   
  -     m_bufferSize = theBufferSize;
  +     if (theBufferSize == 0)
  +     {
  +             m_bufferSize = 1;
  +     }
  +     else
  +     {
  +             m_bufferSize = theBufferSize;
  +     }
   
        if (m_buffer.size() < m_bufferSize)
        {
  
  
  
  1.4       +54 -17    xml-xalan/c/src/PlatformSupport/XalanOutputStream.hpp
  
  Index: XalanOutputStream.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/XalanOutputStream.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XalanOutputStream.hpp     2000/11/02 01:45:38     1.3
  +++ XalanOutputStream.hpp     2001/06/15 20:13:44     1.4
  @@ -108,17 +108,25 @@
        /**
         * Flush the stream's buffer.
         */
  -    virtual void
  -     flush();
  +    void
  +     flush()
  +     {
  +             flushBuffer();
   
  +             doFlush();
  +     }
  +
        /**
         * Write a character to the output stream.  The character
         * will not be transcoded.
         *
         * @param theChar       the character to write
         */
  -    virtual void
  -     write(char      theChar);
  +    void
  +     write(char      theChar)
  +     {
  +             write(&theChar, 1);
  +     }
   
        /**
         * Write a wide character to the output stream.  The character
  @@ -126,8 +134,18 @@
         *
         * @param theChar       the character to write
         */
  -    virtual void
  -     write(XalanDOMChar      theChar);
  +    void
  +     write(XalanDOMChar      theChar)
  +     {
  +             assert(m_bufferSize > 0);
  +
  +             if (m_buffer.size() == m_bufferSize)
  +             {
  +                     flushBuffer();
  +             }
  +
  +             m_buffer.push_back(theChar);
  +     }
   
        /**
         * Write a null-terminated string to the output file.  The character
  @@ -135,8 +153,13 @@
         *
         * @param theBuffer       character buffer to write
         */
  -    virtual void
  -     write(const char*       theBuffer);
  +    void
  +     write(const char*       theBuffer)
  +     {
  +             assert(theBuffer != 0);
  +
  +             write(theBuffer, length(theBuffer));
  +     }
   
        /**
         * Write a null-terminated wide string to the output file.  The string
  @@ -144,8 +167,11 @@
         *
         * @param theBuffer       character buffer to write
         */
  -    virtual void
  -     write(const XalanDOMChar*       theBuffer);
  +    void
  +     write(const XalanDOMChar*       theBuffer)
  +     {
  +             write(theBuffer, length(theBuffer));
  +     }
   
        /**
         * Write a specified number of characters to the output stream.  The 
string
  @@ -154,10 +180,18 @@
         * @param theBuffer       character buffer to write
         * @param theBufferLength number of characters to write
         */
  -    virtual void
  +    void
        write(
                        const char*             theBuffer,
  -                     unsigned long   theBufferLength);
  +                     unsigned long   theBufferLength)
  +     {
  +             assert(theBuffer != 0);
  +
  +             flushBuffer();
  +
  +             writeData(theBuffer,
  +                               theBufferLength);
  +     }
   
        /**
         * Write a specified number of characters to the output stream.  The 
string
  @@ -166,7 +200,7 @@
         * @param theBuffer       character buffer to write
         * @param theBufferLength number of characters to write
         */
  -    virtual void
  +    void
        write(
                        const XalanDOMChar*             theBuffer,
                        unsigned long                   theBufferLength);
  @@ -176,15 +210,18 @@
         *
         * @return The encoding name
         */
  -     virtual const XalanDOMString&
  -     getOutputEncoding() const;
  +     const XalanDOMString&
  +     getOutputEncoding() const
  +     {
  +             return m_encoding;
  +     }
   
        /**
         * Set the output encoding for the stream.
         *
         * @param theEncoding The encoding name
         */
  -     virtual void
  +     void
        setOutputEncoding(const XalanDOMString&         theEncoding);
   
        /**
  @@ -192,7 +229,7 @@
         *
         * @param theBufferSize The buffer size.
         */
  -     virtual void
  +     void
        setBufferSize(BufferType::size_type             theBufferSize);
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to