You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ga...@apache.org on 2003/05/14 20:06:53 UTC

cvs commit: xml-xerces/c/src/xercesc/dom/impl DOMErrorImpl.cpp DOMErrorImpl.hpp

gareth      2003/05/14 11:06:53

  Modified:    c/src/xercesc/dom DOMError.hpp
               c/src/xercesc/dom/impl DOMErrorImpl.cpp DOMErrorImpl.hpp
  Log:
  Updated DOMError to http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/core.html.
  
  Revision  Changes    Path
  1.9       +62 -0     xml-xerces/c/src/xercesc/dom/DOMError.hpp
  
  Index: DOMError.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/DOMError.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DOMError.hpp	7 Mar 2003 19:59:04 -0000	1.8
  +++ DOMError.hpp	14 May 2003 18:06:53 -0000	1.9
  @@ -59,6 +59,9 @@
   
   /*
    * $Log$
  + * Revision 1.9  2003/05/14 18:06:53  gareth
  + * Updated DOMError to http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/core.html.
  + *
    * Revision 1.8  2003/03/07 19:59:04  tng
    * [Bug 11692] Unimplement the hidden constructors and assignment operator to remove warnings from gcc.
    *
  @@ -201,6 +204,36 @@
        */
       virtual void* getRelatedException() const = 0;
   
  +    /**
  +     * A <code>XMLCh*</code> indicating which related data is expected in 
  +     * relatedData. Users should refer to the specification of the error
  +     * in order to find its <code>XMLCh*</code> type and relatedData
  +     * definitions if any.
  +     *
  +     * Note: As an example, [DOM Level 3 Load and Save] does not keep the
  +     * [baseURI] property defined on a Processing Instruction information item.
  +     * Therefore, the DOMBuilder generates a SEVERITY_WARNING with type 
  +     * "infoset-baseURI" and the lost [baseURI] property represented as a
  +     * DOMString in the relatedData attribute.
  +     *
  +     * <p><b>"Experimental - subject to change"</b></p>
  +     *
  +     * @see   setType
  +     * @since DOM Level 3
  +     */
  +    virtual const XMLCh* getType() const = 0;
  +
  +    /**
  +     * The related DOMError.type dependent data if any.
  +     *
  +     * <p><b>"Experimental - subject to change"</b></p>
  +     *
  +     * @see   setRelatedData
  +     * @since DOM Level 3
  +     */
  +    virtual void* getRelatedData() const = 0;
  +
  +
       // -----------------------------------------------------------------------
       //  Setter methods
       // -----------------------------------------------------------------------
  @@ -247,6 +280,35 @@
        * @since DOM Level 3
        */
       virtual void setRelatedException(void* exception) const = 0;
  +
  +    /**
  +     * A <code>XMLCh*</code> indicating which related data is expected in 
  +     * relatedData. Users should refer to the specification of the error
  +     * in order to find its <code>XMLCh*</code> type and relatedData
  +     * definitions if any.
  +     *
  +     * Note: As an example, [DOM Level 3 Load and Save] does not keep the
  +     * [baseURI] property defined on a Processing Instruction information item.
  +     * Therefore, the DOMBuilder generates a SEVERITY_WARNING with type 
  +     * "infoset-baseURI" and the lost [baseURI] property represented as a
  +     * DOMString in the relatedData attribute.
  +     *
  +     * <p><b>"Experimental - subject to change"</b></p>
  +     *
  +     * @see   getType
  +     * @since DOM Level 3
  +     */
  +    virtual void setType(const XMLCh* type) = 0;
  +
  +    /**
  +     * The related DOMError.type dependent data if any.
  +     *
  +     * <p><b>"Experimental - subject to change"</b></p>
  +     *
  +     * @see   getRelatedData
  +     * @since DOM Level 3
  +     */
  +    virtual void setRelatedData(void* relatedData) = 0;
   
       //@}
   
  
  
  
  1.5       +27 -0     xml-xerces/c/src/xercesc/dom/impl/DOMErrorImpl.cpp
  
  Index: DOMErrorImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMErrorImpl.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DOMErrorImpl.cpp	4 Nov 2002 15:07:34 -0000	1.4
  +++ DOMErrorImpl.cpp	14 May 2003 18:06:53 -0000	1.5
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.5  2003/05/14 18:06:53  gareth
  + * Updated DOMError to http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/core.html.
  + *
    * Revision 1.4  2002/11/04 15:07:34  tng
    * C++ Namespace Support.
    *
  @@ -85,6 +88,9 @@
   , fSeverity(severity)
   , fMessage(0)
   , fLocation(0)
  +, fType(0)
  +, fRelatedData(0)
  +, fAdoptRelatedData(false)
   {
   }
   
  @@ -95,13 +101,34 @@
   , fSeverity(severity)
   , fMessage(message)
   , fLocation(location)
  +, fType(0)
  +, fRelatedData(0)
  +, fAdoptRelatedData(false)
  +{
  +}
  +
  +DOMErrorImpl::DOMErrorImpl(const short severity,
  +                           const XMLCh* type,
  +                           const XMLCh* message,
  +                           void* relatedData,
  +                           bool adoptRelatedData) :
  +fAdoptLocation(false)
  +, fSeverity(severity)
  +, fMessage(message)
  +, fLocation(0)
  +, fType(type)
  +, fRelatedData(relatedData)
  +, fAdoptRelatedData(adoptRelatedData)
   {
  +
   }
   
   DOMErrorImpl::~DOMErrorImpl()
   {
       if (fAdoptLocation)
           delete fLocation;
  +    if(fAdoptRelatedData)
  +        delete fRelatedData;
   }
   
   // ---------------------------------------------------------------------------
  
  
  
  1.6       +64 -7     xml-xerces/c/src/xercesc/dom/impl/DOMErrorImpl.hpp
  
  Index: DOMErrorImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMErrorImpl.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DOMErrorImpl.hpp	7 Mar 2003 18:07:17 -0000	1.5
  +++ DOMErrorImpl.hpp	14 May 2003 18:06:53 -0000	1.6
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.6  2003/05/14 18:06:53  gareth
  + * Updated DOMError to http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/core.html.
  + *
    * Revision 1.5  2003/03/07 18:07:17  tng
    * Return a reference instead of void for operator=
    *
  @@ -78,7 +81,8 @@
   #define DOMERRORIMPL_HPP
   
   #include <xercesc/dom/DOMError.hpp>
  -
  +#include <iostream.h>
  +#include <xercesc/util/XMLString.hpp>
   XERCES_CPP_NAMESPACE_BEGIN
   
   
  @@ -105,6 +109,15 @@
           , DOMLocator* const location
       );
   
  +    DOMErrorImpl
  +    (
  +        const short severity
  +        , const XMLCh* type
  +        , const XMLCh* message
  +        , void* relatedData 
  +        , bool adoptRelatedData = false
  +    );
  +
       /** Desctructor */
       virtual ~DOMErrorImpl();
   
  @@ -144,6 +157,10 @@
        */
       virtual void* getRelatedException() const;
   
  +    virtual const XMLCh* getType() const;
  +
  +    virtual void* getRelatedData() const;
  +
       //@}
   
   
  @@ -178,10 +195,6 @@
       virtual void setLocation(DOMLocator* const location);
   
      /**
  -    * <p><b>"Experimental - subject to change"</b></p>
  -    *
  -    * Set whether the location is owned by DOMError or not
  -    *
       * @param value <code>true</code> if DOMLocator is owned and should be
       *              deleted, <code>false</code> otherwise.
       */
  @@ -198,6 +211,15 @@
        */
       virtual void setRelatedException(void* exception) const;
   
  +    virtual void setType(const XMLCh* type);
  +
  +    virtual void setRelatedData(void* relatedData);
  +
  +    /**
  +     * @param value <code>true</code> if RelatedData is owned and should be
  +     *              deleted, <code>false</code> otherwise.
  +     */
  +    void setAdoptRelatedData(bool adoptRelatedData);
       //@}
   
   
  @@ -220,15 +242,27 @@
       //      The type of the error.
       //
       //  fMessage
  -    //      The error message
  +    //      The error message.
       //
       //  fLocation
  -    //      The location info of the error
  +    //      The location info of the error.
  +    //
  +    //  fType
  +    //      The type of the error.
  +    //
  +    //  fRelatedData
  +    //      The data related to this error.
  +    //
  +    //  fAdoptRelatedData
  +    //      Indicates whether we own the fRelatedData object or not.
       // -----------------------------------------------------------------------
       bool         fAdoptLocation;
       short        fSeverity;
       const XMLCh* fMessage;
       DOMLocator*  fLocation;
  +    const XMLCh* fType;
  +    void*        fRelatedData;
  +    bool         fAdoptRelatedData;
   };
   
   // ---------------------------------------------------------------------------
  @@ -254,6 +288,16 @@
       return 0;
   }
   
  +inline const XMLCh* DOMErrorImpl::getType() const 
  +{
  +    return fType;
  +}
  +
  +inline void* DOMErrorImpl::getRelatedData() const 
  +{
  +    return fRelatedData;
  +}
  +
   // ---------------------------------------------------------------------------
   //  DOMLocatorImpl: Setter methods
   // ---------------------------------------------------------------------------
  @@ -272,6 +316,19 @@
       fAdoptLocation = value;
   }
   
  +inline void DOMErrorImpl::setType(const XMLCh* type)
  +{
  +    fType = type;
  +}
  +
  +inline void DOMErrorImpl::setRelatedData(void* relatedData)
  +{
  +    fRelatedData = relatedData;
  +}
  +
  +inline void DOMErrorImpl::setAdoptRelatedData(bool adoptRelatedData) {
  +    fAdoptRelatedData = adoptRelatedData;
  +}
   
   XERCES_CPP_NAMESPACE_END
   
  
  
  

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