vips-cpp  8.19
libvips C++ binding
VError8.h
1 // Header for error type
2 
3 /*
4 
5  This file is part of VIPS.
6 
7  VIPS is free software; you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20  02110-1301 USA
21 
22  */
23 
24 /*
25 
26  These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
27 
28  */
29 
30 #ifndef VIPS_VERROR_H
31 #define VIPS_VERROR_H
32 
33 #include <ostream>
34 #include <stdexcept>
35 
36 #include <vips/vips.h>
37 
38 VIPS_NAMESPACE_START
39 
44 class VIPS_CPLUSPLUS_API VError : public std::runtime_error {
45 public:
46  using std::runtime_error::runtime_error;
47 
52  VError();
53 
59  const char *
60  what() const noexcept override
61  {
62  return std::runtime_error::what();
63  }
64 
68  void ostream_print(std::ostream &) const;
69 
70 private:
74  // TODO: Migrate to [[maybe_unused]] once we require C++17.
75  char _abi_padding[sizeof(std::exception) + sizeof(std::string) -
76  sizeof(std::runtime_error)] G_GNUC_UNUSED = {};
77 };
78 
79 VIPS_NAMESPACE_END
80 
81 #endif /*VIPS_VERROR_H*/
const char * what() const noexcept override
Definition: VError8.h:60
Definition: VError8.h:44