GME
13
|
00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one or more 00003 * contributor license agreements. See the NOTICE file distributed with 00004 * this work for additional information regarding copyright ownership. 00005 * The ASF licenses this file to You under the Apache License, Version 2.0 00006 * (the "License"); you may not use this file except in compliance with 00007 * the License. You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 00018 /* 00019 * $Id: DOMErrorImpl.cpp 671894 2008-06-26 13:29:21Z borisk $ 00020 */ 00021 00022 #include "DOMErrorImpl.hpp" 00023 #include <xercesc/dom/DOMException.hpp> 00024 #include <xercesc/dom/DOMLocator.hpp> 00025 00026 XERCES_CPP_NAMESPACE_BEGIN 00027 00028 00029 // --------------------------------------------------------------------------- 00030 // DOMErrorImpl: Constructors and Destructor 00031 // --------------------------------------------------------------------------- 00032 DOMErrorImpl::DOMErrorImpl(const ErrorSeverity severity) : 00033 fAdoptLocation(false) 00034 , fSeverity(severity) 00035 , fMessage(0) 00036 , fLocation(0) 00037 , fType(0) 00038 , fRelatedData(0) 00039 { 00040 } 00041 00042 DOMErrorImpl::DOMErrorImpl(const ErrorSeverity severity, 00043 const XMLCh* const message, 00044 DOMLocator* const location) : 00045 fAdoptLocation(false) 00046 , fSeverity(severity) 00047 , fMessage(message) 00048 , fLocation(location) 00049 , fType(0) 00050 , fRelatedData(0) 00051 { 00052 } 00053 00054 DOMErrorImpl::DOMErrorImpl(const ErrorSeverity severity, 00055 const XMLCh* type, 00056 const XMLCh* message, 00057 void* relatedData) : 00058 fAdoptLocation(false) 00059 , fSeverity(severity) 00060 , fMessage(message) 00061 , fLocation(0) 00062 , fType(type) 00063 , fRelatedData(relatedData) 00064 { 00065 00066 } 00067 00068 DOMErrorImpl::~DOMErrorImpl() 00069 { 00070 if (fAdoptLocation) 00071 delete fLocation; 00072 } 00073 00074 // --------------------------------------------------------------------------- 00075 // DOMErrorImpl: Setter methods 00076 // --------------------------------------------------------------------------- 00077 void DOMErrorImpl::setLocation(DOMLocator* const location) 00078 { 00079 if (fAdoptLocation) 00080 delete fLocation; 00081 00082 fLocation = location; 00083 } 00084 00085 void DOMErrorImpl::setRelatedException(void*) const 00086 { 00087 throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0); 00088 } 00089 00090 XERCES_CPP_NAMESPACE_END