File: werror-test.cpp

package info (click to toggle)
exiv2 0.24-4.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 19,904 kB
  • ctags: 7,389
  • sloc: cpp: 65,740; sh: 10,246; ansic: 1,622; makefile: 654; python: 210; awk: 92; sed: 16; perl: 5
file content (29 lines) | stat: -rw-r--r-- 722 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// ***************************************************************** -*- C++ -*-
// werror-test.cpp, $Rev: 3090 $
// 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;
}