874 std::vector<SelLine> only_in_SF1;
875 std::vector<SelLine> only_in_SF2;
876 std::vector<SelLine> in_both;
879 int SF1_discarded = 0, SF2_discarded = 0;
881 char str[maxLen + 1];
884 std::vector<SelLine>::iterator current = SF1.text_line.begin();
885 std::vector<SelLine>::iterator last = SF1.text_line.end();
886 std::vector<SelLine>::iterator last_SF = SF2.text_line.end();
887 std::vector<SelLine>::iterator found;
889 while (current != last)
905 found = SF2.find((*current).text);
906 if (found == last_SF)
907 only_in_SF1.push_back(*current);
910 only_in_SF1.push_back(*current);
912 in_both.push_back(*current);
917 current = SF2.text_line.begin();
918 last = SF2.text_line.end();
920 while (current != last)
936 found =
find(in_both, (*current).text);
937 if (found != in_both.end())
942 only_in_SF2.push_back(*current);
951 temp.text =
"# Statistics of comparison";
952 result.text_line.push_back(temp);
953 temp.text =
"# -------------------------------------------------------------";
954 result.text_line.push_back(temp);
955 snprintf(str, maxLen,
"%6d", SF1.no_imgs);
956 temp.text =
"# File 1: " + SF1.fn_sel +
"(VALID: " + str;
957 snprintf(str, maxLen,
"%6d", SF1_discarded);
958 temp.text += (std::string)
" DISCARDED: " + str +
")";
959 result.text_line.push_back(temp);
960 snprintf(str, maxLen,
"%6d", SF2.no_imgs);
961 temp.text =
"# File 2: " + SF2.fn_sel +
"(VALID: " + str;
962 snprintf(str, maxLen,
"%6d", SF2_discarded);
963 temp.text += (std::string)
" DISCARDED: " + str +
")";
964 result.text_line.push_back(temp);
966 result.text_line.push_back(temp);
967 snprintf(str, maxLen,
"%6lu", (
unsigned long int)in_both.size());
968 temp.text = (std::string)
"# Matching Files: " + str;
969 result.text_line.push_back(temp);
970 snprintf(str, maxLen,
"%6lu", (
unsigned long int)only_in_SF1.size());
971 temp.text = (std::string)
"# Only in file 1: " + str;
972 result.text_line.push_back(temp);
973 snprintf(str, maxLen,
"%6lu", (
unsigned long int)only_in_SF2.size());
974 temp.text = (std::string)
"# Only in file 2: " + str;
975 result.text_line.push_back(temp);
976 temp.text =
"# -------------------------------------------------------------";
977 result.text_line.push_back(temp);
981 result.text_line.push_back(temp);
982 temp.text =
"# Files in both .sel files";
983 result.text_line.push_back(temp);
987 current = in_both.begin();
988 last = in_both.end();
989 while (current != last)
990 result.text_line.push_back(*current++);
997 result.text_line.push_back(temp);
998 temp.text =
"# Files only in the first file";
999 result.text_line.push_back(temp);
1003 current = only_in_SF1.begin();
1004 last = only_in_SF1.end();
1005 while (current != last)
1006 result.text_line.push_back(*current++);
1013 result.text_line.push_back(temp);
1014 temp.text =
"# Files only in the second file";
1015 result.text_line.push_back(temp);
1019 current = only_in_SF2.begin();
1020 last = only_in_SF2.end();
1021 while (current != last)
1022 result.text_line.push_back(*current++);
1026 result.no_imgs = in_both.size() + only_in_SF1.size() + only_in_SF2.size();
1028 result.no_imgs = in_both.size();
1030 result.no_imgs = only_in_SF1.size();
1032 result.no_imgs = only_in_SF2.size();
1033 result.current_line = result.text_line.begin();
friend std::vector< SelLine >::iterator find(std::vector< SelLine > &text, const std::string &img_name)