Login | Register
My pages Projects Community openCollabNet

exceptions.hpp

Go to the documentation of this file.
00001 #ifndef EXCEPTIONS_H
00002 #define EXCEPTIONS_H 1
00003 /*
00004    libprf1 - Preferences Registry Format configuration file access
00005    library
00006 
00007    Copyright (C) 2003,2004 Andrei Sosnin
00008 
00009    This program is free software; you can redistribute it and/or modify
00010    it under the terms of the GNU General Public License as published by
00011    the Free Software Foundation; either version 2, or (at your option)
00012    any later version.
00013 
00014    This program is distributed in the hope that it will be useful,
00015    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017    GNU General Public License for more details.
00018 
00019    You should have received a copy of the GNU General Public License
00020    along with this program; if not, write to the Free Software Foundation,
00021    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
00022 
00023 */
00024 
00025 #include <stdexcept>
00026 #include <string>
00027 
00028 #ifdef CXX_NAMESPACES
00029 namespace prf{
00030 #endif
00031 
00038   class NotFoundError : public std::logic_error {
00039   public:
00040     explicit NotFoundError(std::string tname, std::string where) :
00041       std::logic_error(std::string("Element not found in the container: ") + tname + " : " + where){}
00042   };
00043   
00050   class DocCreationError : public std::logic_error {
00051   public:
00052     explicit DocCreationError(std::string where) :
00053       std::logic_error(std::string("Could not create the DOMDocument instance: ") + where){}
00054   };
00055   
00056   class ItemCreationError : public std::logic_error {
00057   public:
00058     explicit ItemCreationError(std::string where) :
00059       std::logic_error(std::string("Could not create the element, insertion failed: ") + where){}
00060   };
00067   class NotImplementedError : public std::logic_error {
00068   public:
00069     explicit NotImplementedError() :
00070       std::logic_error("This method or feature is not yet implemented."){}
00071   };
00072   
00087   class OptionUnusable : public std::logic_error {
00088   public:
00089     
00090     explicit OptionUnusable() : 
00091       std::logic_error("Instance of ConfigOption is unusable: representation is uninitialized!"){ }
00092   };
00093 
00094 #ifdef CXX_NAMESPACES
00095 }
00096 #endif
00097 
00098 #endif 

Generated on Tue May 11 05:03:49 2004 for libprf1 by doxygen 1.3.6-20040222