| 456 | } |
| 457 | |
| 458 | static void doExtract(int argc, const char* argv[]) |
| 459 | { |
| 460 | if (argc < 2) |
| 461 | syntax(); |
| 462 | |
| 463 | file.open(argv[1], std::ios::in | std::ios::binary); |
| 464 | if (!file.is_open()) |
| 465 | error("cannot open input file '{}'", argv[1]); |
| 466 | |
| 467 | readDirectory(); |
| 468 | readAllocationTable(); |
| 469 | checkConsistency(); |
| 470 | |
| 471 | if (argc == 2) |
| 472 | listDirectory(); |
| 473 | else |
| 474 | { |
| 475 | for (int i = 2; i < argc; i++) |
| 476 | extractFile(argv[i]); |
| 477 | } |
| 478 | |
| 479 | file.close(); |
| 480 | } |
| 481 | |
| 482 | int main(int argc, const char* argv[]) |
| 483 | { |
no test coverage detected