| API Docs for SAX and DOM |
| Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages # SAXException.hpp Go to the documentation of this file.
    00001 /*
    00002  * Copyright 1999-2000,2004 The Apache Software Foundation.
    00003  *
    00004  * Licensed under the Apache License, Version 2.0 (the "License");
    00005  * you may not use this file except in compliance with the License.
    00006  * You may obtain a copy of the License at
    00007  *
    00008  *      http://www.apache.org/licenses/LICENSE-2.0
    00009  *
    00010  * Unless required by applicable law or agreed to in writing, software
    00011  * distributed under the License is distributed on an "AS IS" BASIS,
    00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00013  * See the License for the specific language governing permissions and
    00014  * limitations under the License.
    00015  */
    00016
    00017 /*
    00018  * $Id: SAXException.hpp 191054 2005-06-17 02:56:35Z jberry $
    00019  */
    00020
    00021
    00022 #ifndef SAXEXCEPTION_HPP
    00023 #define SAXEXCEPTION_HPP
    00024
    00025 #include <xercesc/util/XMLString.hpp>
    00026 #include <xercesc/util/XMLUni.hpp>
    00027 #include <xercesc/util/XMemory.hpp>
    00028
    00029 XERCES_CPP_NAMESPACE_BEGIN
    00030
    00031
    00051 class  SAXException : public XMemory
    00052 {
    00053 public:
    00060     SAXException(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) :
    00061
    00062         fMsg(XMLString::replicate(XMLUni::fgZeroLenString, manager))
    00063         , fMemoryManager(manager)
    00064     {
    00065     }
    00066
    00074     SAXException(const XMLCh* const msg,
    00075                  MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) :
    00076
    00077         fMsg(XMLString::replicate(msg, manager))
    00078         , fMemoryManager(manager)
    00079     {
    00080     }
    00081
    00089     SAXException(const char* const msg,
    00090                  MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) :
    00091
    00092         fMsg(XMLString::transcode(msg, manager))
    00093         , fMemoryManager(manager)
    00094     {
    00095     }
    00096
    00102     SAXException(const SAXException& toCopy) :
    00103         XMemory(toCopy)
    00104         , fMsg(XMLString::replicate(toCopy.fMsg, toCopy.fMemoryManager))
    00105         , fMemoryManager(toCopy.fMemoryManager)
    00106     {
    00107     }
    00108
    00110     virtual ~SAXException()
    00111     {
    00112         fMemoryManager->deallocate(fMsg);//delete [] fMsg;
    00113     }
    00114
    00116
    00117
    00125     SAXException& operator=(const SAXException& toCopy)
    00126     {
    00127         if (this == &toCopy)
    00128             return *this;
    00129
    00130         fMemoryManager->deallocate(fMsg);//delete [] fMsg;
    00131         fMsg = XMLString::replicate(toCopy.fMsg, toCopy.fMemoryManager);
    00132         fMemoryManager = toCopy.fMemoryManager;
    00133         return *this;
    00134     }
    00136
    00143     virtual const XMLCh* getMessage() const
    00144     {
    00145         return fMsg;
    00146     }
    00148
    00149
    00150 protected :
    00151     // -----------------------------------------------------------------------
    00152     //  Protected data members
    00153     //
    00154     //  fMsg
    00155     //      This is the text of the error that is being thrown.
    00156     // -----------------------------------------------------------------------
    00157     XMLCh*  fMsg;
    00158     MemoryManager* fMemoryManager;
    00159 };
    00160
    00161 class  SAXNotSupportedException : public SAXException
    00162 {
    00163
    00164 public:
    00165     SAXNotSupportedException(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
    00166
    00174     SAXNotSupportedException(const XMLCh* const msg,
    00175                              MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
    00176
    00184     SAXNotSupportedException(const char* const msg,
    00185                              MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
    00186
    00192     SAXNotSupportedException(const SAXException& toCopy);
    00193 };
    00194
    00195 class  SAXNotRecognizedException : public SAXException
    00196 {
    00197 public:
    00198     SAXNotRecognizedException(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
    00199
    00207     SAXNotRecognizedException(const XMLCh* const msg,
    00208                               MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
    00209
    00217     SAXNotRecognizedException(const char* const msg,
    00218                               MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
    00219
    00225     SAXNotRecognizedException(const SAXException& toCopy);
    00226 };
    00227
    00228 XERCES_CPP_NAMESPACE_END
    00229
    00230 #endif

Copyright © 1994-2004 The Apache Software Foundation. All Rights Reserved.