BadFileException.h

Go to the documentation of this file.
00001 //
00002 // Copyright 2003-2006 Greg Landrum and Rational Discovery LLC
00003 //
00004 //  @@ All Rights Reserved @@
00005 //  This file is part of the RDKit.
00006 //  The contents are covered by the terms of the BSD license
00007 //  which is included in the file license.txt, found at the root
00008 //  of the RDKit source tree.
00009 //
00010 #ifndef _RD_BADFILEEXCEPTION_H
00011 #define _RD_BADFILEEXCEPTION_H
00012 
00013 #include <string>
00014 #include <vector>
00015 #include <exception>
00016 
00017 namespace RDKit {
00018   
00019   //! used by various file parsing classes to indicate a bad file
00020   class BadFileException : public std::exception {
00021   public :
00022     //! construct with an error message
00023     explicit BadFileException(const char *msg) : _msg(msg) {};
00024     //! construct with an error message
00025     explicit BadFileException(const std::string msg) : _msg(msg) {};
00026     //! get the error message
00027     const char *message () const { return _msg.c_str(); };
00028     ~BadFileException () throw () {};
00029     
00030     private :
00031       std::string _msg;
00032   };
00033 }
00034 
00035 #endif