RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
FileParseException.h
Go to the documentation of this file.
1//
2// Copyright 2003-2006 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_FILEPARSEEXCEPTION_H
12#define RD_FILEPARSEEXCEPTION_H
13
14#include <string>
15#include <stdexcept>
16
17namespace RDKit {
18//! used by various file parsing classes to indicate a parse error
19class RDKIT_RDGENERAL_EXPORT FileParseException : public std::runtime_error {
20 public:
21 //! construct with an error message
22 explicit FileParseException(const char *msg)
23 : std::runtime_error("FileParseException"), _msg(msg) {}
24 //! construct with an error message
25 explicit FileParseException(const std::string msg)
26 : std::runtime_error("FileParseException"), _msg(msg) {}
27 //! get the error message
28 const char *what() const noexcept override { return _msg.c_str(); }
29 ~FileParseException() noexcept override = default;
30
31 private:
32 std::string _msg;
33};
34} // namespace RDKit
35
36#endif
used by various file parsing classes to indicate a parse error
~FileParseException() noexcept override=default
FileParseException(const std::string msg)
construct with an error message
const char * what() const noexcept override
get the error message
FileParseException(const char *msg)
construct with an error message
#define RDKIT_RDGENERAL_EXPORT
Definition export.h:409
Std stuff.