00001 #ifndef DOMException_HEADER_GUARD_ 00002 #define DOMException_HEADER_GUARD_ 00003 00004 /* 00005 * Licensed to the Apache Software Foundation (ASF) under one or more 00006 * contributor license agreements. See the NOTICE file distributed with 00007 * this work for additional information regarding copyright ownership. 00008 * The ASF licenses this file to You under the Apache License, Version 2.0 00009 * (the "License"); you may not use this file except in compliance with 00010 * the License. You may obtain a copy of the License at 00011 * 00012 * http://www.apache.org/licenses/LICENSE-2.0 00013 * 00014 * Unless required by applicable law or agreed to in writing, software 00015 * distributed under the License is distributed on an "AS IS" BASIS, 00016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00017 * See the License for the specific language governing permissions and 00018 * limitations under the License. 00019 */ 00020 00021 /* 00022 * $Id: DOMException.hpp 568078 2007-08-21 11:43:25Z amassari $ 00023 */ 00024 00025 #include <xercesc/util/XercesDefs.hpp> 00026 #include <xercesc/util/PlatformUtils.hpp> 00027 00028 XERCES_CPP_NAMESPACE_BEGIN 00029 00030 00050 class MemoryManager; 00051 00052 class CDOM_EXPORT DOMException { 00053 public: 00054 // ----------------------------------------------------------------------- 00055 // Constructors 00056 // ----------------------------------------------------------------------- 00063 DOMException(); 00064 00072 DOMException( 00073 short code 00074 , const XMLCh* message 00075 , MemoryManager* const memoryManager = XMLPlatformUtils::fgMemoryManager 00076 ); 00077 00083 DOMException(const DOMException &other); 00084 00086 00087 // ----------------------------------------------------------------------- 00088 // Destructors 00089 // ----------------------------------------------------------------------- 00096 virtual ~DOMException(); 00098 00099 public: 00100 // ----------------------------------------------------------------------- 00101 // Class Types 00102 // ----------------------------------------------------------------------- 00179 enum ExceptionCode { 00180 INDEX_SIZE_ERR = 1, 00181 DOMSTRING_SIZE_ERR = 2, 00182 HIERARCHY_REQUEST_ERR = 3, 00183 WRONG_DOCUMENT_ERR = 4, 00184 INVALID_CHARACTER_ERR = 5, 00185 NO_DATA_ALLOWED_ERR = 6, 00186 NO_MODIFICATION_ALLOWED_ERR = 7, 00187 NOT_FOUND_ERR = 8, 00188 NOT_SUPPORTED_ERR = 9, 00189 INUSE_ATTRIBUTE_ERR = 10, 00190 INVALID_STATE_ERR = 11, 00191 SYNTAX_ERR = 12, 00192 INVALID_MODIFICATION_ERR = 13, 00193 NAMESPACE_ERR = 14, 00194 INVALID_ACCESS_ERR = 15, 00195 VALIDATION_ERR = 16 00196 }; 00198 00199 // ----------------------------------------------------------------------- 00200 // Getter 00201 // ----------------------------------------------------------------------- 00202 inline const XMLCh* getMessage() const; 00203 00204 // ----------------------------------------------------------------------- 00205 // Class Types 00206 // ----------------------------------------------------------------------- 00213 ExceptionCode code; 00214 00221 const XMLCh *msg; 00223 00224 protected: 00225 00226 MemoryManager* fMemoryManager; 00227 00228 private: 00229 00237 bool fMsgOwned; 00238 00239 private: 00240 // ----------------------------------------------------------------------- 00241 // Unimplemented constructors and operators 00242 // ----------------------------------------------------------------------- 00243 DOMException & operator = (const DOMException &); 00244 }; 00245 00246 inline const XMLCh* DOMException::getMessage() const 00247 { 00248 return msg; 00249 } 00250 00251 XERCES_CPP_NAMESPACE_END 00252 00253 #endif 00254