IDOM_DOMException.hpp
上传用户:huihehuasu
上传日期:2007-01-10
资源大小:6948k
文件大小:6k
源码类别:

xml/soap/webservice

开发平台:

C/C++

  1. /*
  2.  * The Apache Software License, Version 1.1
  3.  *
  4.  * Copyright (c) 2001 The Apache Software Foundation.  All rights
  5.  * reserved.
  6.  *
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  *
  11.  * 1. Redistributions of source code must retain the above copyright
  12.  *    notice, this list of conditions and the following disclaimer.
  13.  *
  14.  * 2. Redistributions in binary form must reproduce the above copyright
  15.  *    notice, this list of conditions and the following disclaimer in
  16.  *    the documentation and/or other materials provided with the
  17.  *    distribution.
  18.  *
  19.  * 3. The end-user documentation included with the redistribution,
  20.  *    if any, must include the following acknowledgment:
  21.  *       "This product includes software developed by the
  22.  *        Apache Software Foundation (http://www.apache.org/)."
  23.  *    Alternately, this acknowledgment may appear in the software itself,
  24.  *    if and wherever such third-party acknowledgments normally appear.
  25.  *
  26.  * 4. The names "Xerces" and "Apache Software Foundation" must
  27.  *    not be used to endorse or promote products derived from this
  28.  *    software without prior written permission. For written
  29.  *    permission, please contact apache@apache.org.
  30.  *
  31.  * 5. Products derived from this software may not be called "Apache",
  32.  *    nor may "Apache" appear in their name, without prior written
  33.  *    permission of the Apache Software Foundation.
  34.  *
  35.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  36.  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  37.  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  38.  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  39.  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  40.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  41.  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  42.  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  43.  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  44.  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  45.  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  46.  * SUCH DAMAGE.
  47.  * ====================================================================
  48.  *
  49.  * This software consists of voluntary contributions made by many
  50.  * individuals on behalf of the Apache Software Foundation, and was
  51.  * originally based on software copyright (c) 2001, International
  52.  * Business Machines, Inc., http://www.ibm.com .  For more information
  53.  * on the Apache Software Foundation, please see
  54.  * <http://www.apache.org/>.
  55.  */
  56. /*
  57.  * $Log: IDOM_DOMException.hpp,v $
  58.  * Revision 1.2  2001/05/11 13:25:50  tng
  59.  * Copyright update.
  60.  *
  61.  * Revision 1.1.1.1  2001/04/03 00:14:29  andyh
  62.  * IDOM
  63.  *
  64.  */
  65. #ifndef IDOMException_HEADER_GUARD_
  66. #define IDOMException_HEADER_GUARD_
  67. #include <util/XercesDefs.hpp>
  68. /**
  69.   * Encapsulate a general DOM error or warning.
  70.   *
  71.   * <p> The DOM will create and throw an instance of DOMException
  72.   * when an error condition is detected.  Exceptions can occur
  73.   * when an application directly manipulates the DOM document
  74.   * tree that is produced by the parser, or when a document tree
  75.   * is created from scratch using the DOM API.  DOM exceptions will
  76.   * not be generated by the parser while constructing a document
  77.   * tree from an XML source document.
  78.   *
  79.   * <p>Unlike the other classes in the C++ DOM API, DOM_DOMException
  80.   * is NOT a reference to an underlying implementation class, and
  81.   * does not provide automatic memory management.  Code that catches
  82.   * a DOM exception is responsible for deleting it, or otherwise
  83.   * arranging for its disposal.
  84.   *
  85.   */
  86. class CDOM_EXPORT IDOM_DOMException  {
  87. public:
  88.     /** @name Enumerators for DOM Exceptions */
  89.     //@{
  90.         enum ExceptionCode {
  91.                 INDEX_SIZE_ERR       = 1,
  92.                 DOMSTRING_SIZE_ERR   = 2,
  93.                 HIERARCHY_REQUEST_ERR = 3,
  94.                 WRONG_DOCUMENT_ERR   = 4,
  95.                 INVALID_CHARACTER_ERR = 5,
  96.                 NO_DATA_ALLOWED_ERR  = 6,
  97.                 NO_MODIFICATION_ALLOWED_ERR = 7,
  98.                 NOT_FOUND_ERR        = 8,
  99.                 NOT_SUPPORTED_ERR    = 9,
  100.                 INUSE_ATTRIBUTE_ERR  = 10,
  101.                 INVALID_STATE_ERR    = 11,
  102.         SYNTAX_ERR      = 12,
  103.          INVALID_MODIFICATION_ERR    = 13,
  104.          NAMESPACE_ERR      = 14,
  105.          INVALID_ACCESS_ERR   = 15
  106.         };
  107.     //@}
  108. public:
  109.     /** @name Constructors and assignment operator */
  110.     //@{
  111.     /**
  112.       * Default constructor for IDOM_DOMException.
  113.       *
  114.       */
  115.     IDOM_DOMException();
  116.     /**
  117.       * Constructor which takes an error code and a message.
  118.       *
  119.       * @param code The error code which indicates the exception
  120.       * @param message The string containing the error message
  121.       */
  122.     IDOM_DOMException(short code, const XMLCh *message);
  123.     /**
  124.       * Copy constructor.
  125.       *
  126.       * @param other The object to be copied.
  127.       */
  128.     IDOM_DOMException(const IDOM_DOMException &other);
  129.     //@}
  130.     /** @name Destructor. */
  131.     //@{
  132.  /**
  133.   * Destructor for IDOM_DOMException.  Applications are responsible
  134.       * for deleting DOM_Exception objects that they catch after they
  135.       * have completed their exception processing.
  136.   *
  137.   */
  138.     virtual ~IDOM_DOMException();
  139.     //@}
  140.     /** @name Public variables. */
  141.      //@{
  142.  /**
  143.   * A code value, from the set defined by the ExceptionCode enum,
  144.       * indicating the type of error that occured.
  145.   */
  146.    ExceptionCode   code;
  147.  /**
  148.   * A string value.  Applications may use this field to hold an error
  149.       *  message.  The field value is not set by the DOM implementation,
  150.       *  meaning that the string will be empty when an exception is first
  151.       *  thrown.
  152.   */
  153.     const XMLCh *msg;
  154.     //@}
  155. };
  156. #endif