exiv2/samples/werror-test.cpp
Andreas Huggel 06ce0d18b6 - Introduced exiv2.hpp as a wrapper to include all Exiv2 objects. (Renamed existing exiv2.hpp to exiv2app.hpp)
- Changed Sony/Minolta pretty-print function to print EV value
- Renamed rcsid.hpp to rcsid_int.hpp, do not publish it anymore
2010-06-27 10:04:39 +00:00

30 lines
715 B
C++

// ***************************************************************** -*- C++ -*-
// werror-test.cpp, $Rev$
// Simple tests for the wide-string error class WError
#include <iostream>
#include <exiv2/exiv2.hpp>
int main()
{
try {
throw Exiv2::Error(-1, "ARG1", "ARG2", "ARG3");
}
catch (const Exiv2::Error& e) {
std::cout << "Caught Error '" << e.what() << "'\n";
}
#ifdef EXV_UNICODE_PATH
try {
throw Exiv2::WError(-1, L"WARG1", L"WARG2", L"WARG3");
}
catch (const Exiv2::WError& e) {
std::wstring wmsg = e.wwhat();
std::string msg(wmsg.begin(), wmsg.end());
std::cout << "Caught WError '" << msg << "'\n";
}
#endif
return 0;
}