MCPcopy Create free account
hub / github.com/Exiv2/exiv2 / main

Function main

samples/path-test.cpp:16–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14#endif
15
16int 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}

Callers

nothing calls this directly

Calls 1

pathFunction · 0.85

Tested by

no test coverage detected