RDKit
Open-source cheminformatics and machine learning.
BadFileException.h
Go to the documentation of this file.
1 //
2 // Copyright 2003-2006 Greg Landrum and Rational Discovery LLC
3 //
4 // @@ All Rights Reserved @@
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10 #include <RDGeneral/export.h>
11 #ifndef _RD_BADFILEEXCEPTION_H
12 #define _RD_BADFILEEXCEPTION_H
13 
14 #include <string>
15 #include <vector>
16 #include <stdexcept>
17 
18 namespace RDKit {
19 
20 //! used by various file parsing classes to indicate a bad file
21 class BadFileException : public std::runtime_error {
22  public:
23  //! construct with an error message
24  explicit BadFileException(const char *msg)
25  : std::runtime_error("BadFileException"), _msg(msg){};
26  //! construct with an error message
27  explicit BadFileException(const std::string &msg)
28  : std::runtime_error("BadFileException"), _msg(msg){};
29  //! get the error message
30  const char *message() const { return _msg.c_str(); };
31  ~BadFileException() throw(){};
32 
33  private:
34  std::string _msg;
35 };
36 }
37 
38 #endif
const char * message() const
get the error message
used by various file parsing classes to indicate a bad file
STL namespace.
BadFileException(const std::string &msg)
construct with an error message
Std stuff.
Definition: Atom.h:30
BadFileException(const char *msg)
construct with an error message