| 587 | } |
| 588 | |
| 589 | bool FuzzyStringComparator::compareFiles(const std::string& filename_1, const std::string& filename_2) |
| 590 | { |
| 591 | input_1_name_ = filename_1; |
| 592 | input_2_name_ = filename_2; |
| 593 | |
| 594 | if (input_1_name_ == input_2_name_) |
| 595 | { |
| 596 | *log_dest_ << "Error: first and second input file have the same name. That's cheating!\n"; |
| 597 | return false; |
| 598 | } |
| 599 | |
| 600 | std::ifstream input_1_f; |
| 601 | if (!openInputFileStream_(input_1_name_, input_1_f)) |
| 602 | { |
| 603 | return false; |
| 604 | } |
| 605 | |
| 606 | std::ifstream input_2_f; |
| 607 | if (!openInputFileStream_(input_2_name_, input_2_f)) |
| 608 | { |
| 609 | return false; |
| 610 | } |
| 611 | |
| 612 | //------------------------------------------------------------ |
| 613 | // main loop |
| 614 | |
| 615 | compareStreams(input_1_f, input_2_f); |
| 616 | |
| 617 | return is_status_success_; |
| 618 | |
| 619 | } // compareFiles() |
| 620 | |
| 621 | bool FuzzyStringComparator::openInputFileStream_(const std::string& filename, std::ifstream& input_stream) const |
| 622 | { |
no outgoing calls