vips-cpp  8.11
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 
31 #ifndef VIPS_VERROR_H
32 #define VIPS_VERROR_H
33 
34 #include <cstring>
35 #include <ostream>
36 #include <exception>
37 
38 #include <vips/vips.h>
39 
40 VIPS_NAMESPACE_START
41 
46 class VIPS_CPLUSPLUS_API VError : public std::exception {
47  std::string _what;
48 
49 public:
53  VError( const std::string &what ) : _what( what ) {}
54 
59  VError() : _what( vips_error_buffer() ) {}
60 
61  virtual ~VError() throw() {}
62 
66  virtual const char *what() const throw() { return _what.c_str(); }
67 
71  void ostream_print( std::ostream & ) const;
72 };
73 
74 VIPS_NAMESPACE_END
75 
76 #endif /*VIPS_VERROR_H*/
Definition: VError8.h:46
VError(const std::string &what)
Definition: VError8.h:53
VError()
Definition: VError8.h:59
virtual const char * what() const
Definition: VError8.h:66