FileParseException.h

Go to the documentation of this file.
00001 //
00002 // Copyright 2003-2006 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_FILEPARSEEXCEPTION_H
00011 #define _RD_FILEPARSEEXCEPTION_H
00012 
00013 #include <string>
00014 #include <exception>
00015 
00016 namespace RDKit {
00017   //! used by various file parsing classes to indicate a parse error
00018   class FileParseException : public std::exception {
00019   public:
00020     //! construct with an error message
00021     explicit FileParseException(const char *msg) : _msg(msg) {};
00022     //! construct with an error message
00023     explicit FileParseException(const std::string msg) : _msg(msg) {};
00024     //! get the error message
00025     const char *message () const { return _msg.c_str(); };
00026     ~FileParseException () throw () {};
00027   private:
00028     std::string _msg;
00029   };
00030 }  
00031 
00032 #endif
00033