dbertoni    01/06/15 13:14:32

  Modified:    c/src/XMLSupport FormatterToXML.hpp FormatterToXML.cpp
  Log:
  Tweaked experimental direct-writing code.
  
  Revision  Changes    Path
  1.33      +10 -7     xml-xalan/c/src/XMLSupport/FormatterToXML.hpp
  
  Index: FormatterToXML.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToXML.hpp,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- FormatterToXML.hpp        2001/06/15 17:55:07     1.32
  +++ FormatterToXML.hpp        2001/06/15 20:14:29     1.33
  @@ -165,8 +165,8 @@
   
        virtual void
        startElement(
  -                     const   XMLCh* const    name,
  -                     AttributeList&                  attrs);
  +                     const XMLCh* const      name,
  +                     AttributeList&          attrs);
   
       virtual void
        endElement(const XMLCh* const   name);
  @@ -330,6 +330,9 @@
        void
        outputLineSep();
   
  +     typedef void (FormatterToXML::*AccumFunctionType)(XalanDOMChar);
  +     typedef void (FormatterToXML::*FlushFunctionType)();
  +
        /**
         * Append a wide character to the buffer.
         *
  @@ -424,8 +427,6 @@
        void
        accumName(const XalanDOMString&         str);
   
  -     typedef void (FormatterToXML::*AccumFunctionType)(XalanDOMChar);
  -
        /**
         * Append a string to the buffer.
         *
  @@ -482,9 +483,6 @@
        flushBytes();
   
        void
  -     flush();
  -
  -     void
        flushWriter();
   
        void
  @@ -948,6 +946,11 @@
         * for content.
         */
        AccumFunctionType       m_accumContentFunction;
  +
  +     /**
  +      * A pointer to the member function that will flush the buffer.
  +      */
  +     FlushFunctionType       m_flushFunction;
   };
   
   
  
  
  
  1.50      +10 -26    xml-xalan/c/src/XMLSupport/FormatterToXML.cpp
  
  Index: FormatterToXML.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToXML.cpp,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- FormatterToXML.cpp        2001/06/15 17:55:08     1.49
  +++ FormatterToXML.cpp        2001/06/15 20:14:30     1.50
  @@ -189,6 +189,8 @@
   
                        m_accumContentFunction = &FormatterToXML::accumContentAsByte;
                }
  +
  +             m_flushFunction = &FormatterToXML::flushBytes;
        }
        else
        {
  @@ -206,6 +208,8 @@
   
                        m_accumContentFunction = &FormatterToXML::accumContentAsChar;
                }
  +
  +             m_flushFunction = &FormatterToXML::flushChars;
        }
   
        // Do this last so we initialize the map according to the value of
  @@ -396,7 +400,7 @@
   {
        if (ch > m_maxCharacter)
        {
  -             m_stream->write(XalanUnicode::charQuestionMark);
  +             m_stream->write(XalanDOMChar(XalanUnicode::charQuestionMark));
        }
        else
        {
  @@ -681,28 +685,6 @@
   }
   
   
  -     
  -void
  -FormatterToXML::flush()
  -{
  -     if (m_stream != 0)
  -     {
  -             m_stream->flush();
  -     }
  -     else
  -     {
  -             if (m_bytesEqualChars == true)
  -             {
  -                     flushBytes();
  -             }
  -             else
  -             {
  -                     flushChars();
  -             }
  -     }
  -}
  -
  -
   
   void
   FormatterToXML::flushWriter()
  @@ -775,12 +757,14 @@
   void
   FormatterToXML::endDocument()
   {
  +     assert(m_flushFunction != 0);
  +
        if(m_doIndent == true && m_isprevtext == false)
        {
                outputLineSep();
        }
   
  -     flush();
  +     (this->*m_flushFunction)();
   
        flushWriter();
   }
  @@ -789,8 +773,8 @@
   
   void
   FormatterToXML::startElement(
  -                     const   XMLCh* const    name,
  -                     AttributeList&                  attrs)
  +                     const XMLCh* const      name,
  +                     AttributeList&          attrs)
   {
       if(m_inEntityRef == false)
        {
  
  
  

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

Reply via email to