dbertoni    01/06/06 14:49:08

  Modified:    c/src/XPath XNodeSet.cpp XNodeSet.hpp XNumber.cpp
                        XNumber.hpp XObject.cpp XObject.hpp
                        XResultTreeFrag.cpp XResultTreeFrag.hpp
  Log:
  Added an overload for str() that allows for string data to be appended to a 
buffer.
  
  Revision  Changes    Path
  1.23      +18 -0     xml-xalan/c/src/XPath/XNodeSet.cpp
  
  Index: XNodeSet.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XNodeSet.cpp,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- XNodeSet.cpp      2001/05/02 15:52:46     1.22
  +++ XNodeSet.cpp      2001/06/06 21:49:00     1.23
  @@ -200,6 +200,24 @@
   
   
   
  +void
  +XNodeSet::str(XalanDOMString&        theBuffer) const
  +{
  +     if (isEmpty(m_cachedStringValue) == false)
  +     {
  +             append(theBuffer, m_cachedStringValue);
  +     }
  +     else if (m_value->getLength() > 0)
  +     {
  +             const XalanNode* const  theNode = m_value->item(0);
  +             assert(theNode != 0);
  +
  +             DOMServices::getNodeData(*theNode, theBuffer);
  +     }
  +}
  +
  +
  +
   const ResultTreeFragBase&
   XNodeSet::rtree(XPathExecutionContext&       executionContext) const
   {
  
  
  
  1.20      +3 -0      xml-xalan/c/src/XPath/XNodeSet.hpp
  
  Index: XNodeSet.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XNodeSet.hpp,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- XNodeSet.hpp      2001/05/02 15:52:47     1.19
  +++ XNodeSet.hpp      2001/06/06 21:49:01     1.20
  @@ -140,6 +140,9 @@
                        FormatterListener&      formatterListener,
                        MemberFunctionPtr       function) const;
   
  +     virtual void
  +     str(XalanDOMString&     theBuffer) const;
  +
        virtual const ResultTreeFragBase&
        rtree(XPathExecutionContext&    executionContext) const;
   
  
  
  
  1.14      +15 -0     xml-xalan/c/src/XPath/XNumber.cpp
  
  Index: XNumber.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XNumber.cpp,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- XNumber.cpp       2001/05/02 15:52:52     1.13
  +++ XNumber.cpp       2001/06/06 21:49:01     1.14
  @@ -137,6 +137,21 @@
   
   
   void
  +XNumber::str(XalanDOMString& theBuffer) const
  +{
  +     if (isEmpty(m_cachedStringValue) == false)
  +     {
  +             append(theBuffer, m_cachedStringValue);
  +     }
  +     else
  +     {
  +             DoubleToDOMString(m_value, theBuffer);
  +     }
  +}
  +
  +
  +
  +void
   XNumber::set(double          theValue)
   {
        m_value = theValue;
  
  
  
  1.13      +3 -0      xml-xalan/c/src/XPath/XNumber.hpp
  
  Index: XNumber.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XNumber.hpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- XNumber.hpp       2001/05/02 15:52:53     1.12
  +++ XNumber.hpp       2001/06/06 21:49:02     1.13
  @@ -109,6 +109,9 @@
                        FormatterListener&      formatterListener,
                        MemberFunctionPtr       function) const;
   
  +     virtual void
  +     str(XalanDOMString&     theBuffer) const;
  +
        // These methods are new to XNumber...
   
        /**
  
  
  
  1.24      +8 -0      xml-xalan/c/src/XPath/XObject.cpp
  
  Index: XObject.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XObject.cpp,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- XObject.cpp       2001/05/10 17:55:29     1.23
  +++ XObject.cpp       2001/06/06 21:49:02     1.24
  @@ -172,6 +172,14 @@
   
   
   
  +void
  +XObject::str(XalanDOMString& theBuffer) const
  +{
  +     append(theBuffer, str());
  +}
  +
  +
  +
   const ResultTreeFragBase&
   XObject::rtree(XPathExecutionContext&        /* executionContext */) const
   {
  
  
  
  1.20      +8 -0      xml-xalan/c/src/XPath/XObject.hpp
  
  Index: XObject.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XObject.hpp,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- XObject.hpp       2001/05/10 17:56:21     1.19
  +++ XObject.hpp       2001/06/06 21:49:03     1.20
  @@ -182,6 +182,14 @@
                        MemberFunctionPtr       function) const = 0;
   
        /**
  +      * Append the string value directly a string
  +      *
  +      * @param theBuffer The buffer for the data
  +      */
  +     virtual void
  +     str(XalanDOMString&     theBuffer) const;
  +
  +     /**
         * Cast result object to a result tree fragment.
         *
         * @param executionContext the current execution context
  
  
  
  1.22      +15 -0     xml-xalan/c/src/XPath/XResultTreeFrag.cpp
  
  Index: XResultTreeFrag.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XResultTreeFrag.cpp,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- XResultTreeFrag.cpp       2001/05/17 16:12:24     1.21
  +++ XResultTreeFrag.cpp       2001/06/06 21:49:03     1.22
  @@ -193,6 +193,21 @@
   
   
   
  +void
  +XResultTreeFrag::str(XalanDOMString& theBuffer) const
  +{
  +     if (isEmpty(m_cachedStringValue) == false)
  +     {
  +             append(theBuffer, m_cachedStringValue);
  +     }
  +     else
  +     {
  +             DOMServices::getNodeData(*m_value, theBuffer);
  +     }
  +}
  +
  +
  +
   const ResultTreeFragBase&
   XResultTreeFrag::rtree(XPathExecutionContext&        /* executionContext */) 
const
   {
  
  
  
  1.23      +18 -12    xml-xalan/c/src/XPath/XResultTreeFrag.hpp
  
  Index: XResultTreeFrag.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XResultTreeFrag.hpp,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- XResultTreeFrag.hpp       2001/05/17 16:12:25     1.22
  +++ XResultTreeFrag.hpp       2001/06/06 21:49:04     1.23
  @@ -146,6 +146,9 @@
                        FormatterListener&      formatterListener,
                        MemberFunctionPtr       function) const;
   
  +     virtual void
  +     str(XalanDOMString&     theBuffer) const;
  +
        virtual const ResultTreeFragBase&
        rtree(XPathExecutionContext&    executionContext) const;
   
  @@ -161,16 +164,6 @@
        virtual void
        ProcessXObjectTypeCallback(XObjectTypeCallback&         
theCallbackObject) const;
   
  -     // New member functions for node list compatibility...
  -     XalanNode*
  -     item(unsigned int       index) const;
  -
  -     unsigned int
  -     getLength() const;
  -
  -     unsigned int
  -     indexOf(const XalanNode*        theNode) const;
  -
        /**
         * Release the ResultTreeFrag held by the instance.
         */
  @@ -185,8 +178,6 @@
        void
        set(BorrowReturnResultTreeFrag& theValue);
   
  -private:
  -
        class  NodeRefListBaseProxy : public NodeRefListBase
        {
        public:
  @@ -212,6 +203,21 @@
   
                const XResultTreeFrag&  m_xresultTreeFrag;              
        };
  +
  +     friend class NodeRefListBaseProxy;
  +
  +private:
  +
  +     // New member functions for node list compatibility...
  +     XalanNode*
  +     item(unsigned int       index) const;
  +
  +     unsigned int
  +     getLength() const;
  +
  +     unsigned int
  +     indexOf(const XalanNode*        theNode) const;
  +
   
        // Data members...
        BorrowReturnResultTreeFrag              m_value;        
  
  
  

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

Reply via email to