| 14 | #endif |
| 15 | |
| 16 | int main(int argc, char* const argv[]) { |
| 17 | Exiv2::XmpParser::initialize(); |
| 18 | ::atexit(Exiv2::XmpParser::terminate); |
| 19 | |
| 20 | if (argc != 2) { |
| 21 | std::cout << "Usage: " << argv[0] << " file\n"; |
| 22 | return EXIT_FAILURE; |
| 23 | } |
| 24 | std::ifstream file(argv[1]); |
| 25 | if (!file) { |
| 26 | std::cerr << *argv[1] << ": Failed to open file for reading\n"; |
| 27 | return EXIT_FAILURE; |
| 28 | } |
| 29 | std::string line; |
| 30 | while (std::getline(file, line)) { |
| 31 | std::string path, dir, base; |
| 32 | std::istringstream is(line); |
| 33 | is >> path >> dir >> base; |
| 34 | auto p = fs::path(path); |
| 35 | std::string d = p.parent_path().string(); |
| 36 | std::string b = p.filename().string(); |
| 37 | |
| 38 | if (d != dir || b != base) { |
| 39 | std::cout << path << "\t'" << d << "'\t '" << b << "'\t ==> Testcase failed\n"; |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | return EXIT_SUCCESS; |
| 44 | } |