Provide default and copy constructor for AnyError

v0.27.3
Luis Díaz Más 7 years ago
parent 6e4404da81
commit 18690f4c54

@ -171,20 +171,15 @@ namespace Exiv2 {
easier for library users (they have the option of catching most
things via std::exception).
*/
class AnyError : public std::exception {
class EXIV2API AnyError : public std::exception {
public:
//! @name Creators
//@{
//! Virtual destructor.
virtual ~AnyError() throw();
//@}
AnyError();
AnyError(const AnyError& o);
//! @name Accessors
//@{
//! Return the error code.
virtual ~AnyError() throw();
///@brief Return the error code.
virtual int code() const throw() =0;
//@}
}; // AnyError
};
//! %AnyError output operator
inline std::ostream& operator<<(std::ostream& os, const AnyError& error)
@ -309,7 +304,7 @@ namespace Exiv2 {
//! @name Manipulators
//@{
//! Assemble the error message from the arguments
void setMsg();
EXIV2API void setMsg();
//@}
// DATA

@ -144,7 +144,7 @@ int main(int argc,const char** argv)
httpcon(url, useHttp1_0);
isOk = true;
}
} catch (Exiv2::AnyError& e) {
} catch (const Exiv2::AnyError& e) {
std::cout << "Error: '" << e << "'" << std::endl;
return -1;
}

@ -210,6 +210,16 @@ namespace Exiv2 {
std::cerr << s;
}
AnyError::AnyError(): std::exception()
{
}
AnyError::AnyError(const AnyError &o): std::exception(o)
{
}
AnyError::~AnyError() throw()
{
}

Loading…
Cancel
Save