forked from markus/S_New4
v2.8.3: list new serien wehean update at s -u
This commit is contained in:
parent
5803775ff7
commit
1eed669a8f
@ -47,7 +47,7 @@ struct Settings {
|
||||
proxy_ip = "127.0.0.1",
|
||||
languages = "GerDub,GerSub,Eng",
|
||||
genaueHoster = "",
|
||||
version = "2.8.2",
|
||||
version = "2.8.3",
|
||||
defaultFileVersion="1.3",
|
||||
outputFilePath = "",
|
||||
default_checkPath = "",
|
||||
|
@ -748,6 +748,16 @@ int ProgramManager::searchModus_update(Settings *settings)
|
||||
for(countBef = 0; std::getline(myFileBef,line); ++countBef);
|
||||
myFileBef.close();
|
||||
|
||||
//Speicher für Vergleich Alte liste:
|
||||
std::ifstream t(settings->serienListPath);
|
||||
if(!t.is_open()) {
|
||||
perror("Konnte SerienListe-Datei nicht öffnen");
|
||||
return 110;
|
||||
}
|
||||
std::string alte_list((std::istreambuf_iterator<char>(t)),
|
||||
std::istreambuf_iterator<char>());
|
||||
t.close();
|
||||
|
||||
//Schreibe die Liste in das TextFile
|
||||
std::ofstream ofs(settings->serienListPath, std::ios::trunc);
|
||||
if(!ofs.is_open()) {
|
||||
@ -764,6 +774,16 @@ int ProgramManager::searchModus_update(Settings *settings)
|
||||
for(countAf = 0; std::getline(myFileAf,line); ++countAf);
|
||||
myFileAf.close();
|
||||
|
||||
|
||||
//Vergleiche alte/Neue Liste:
|
||||
|
||||
std::stringstream newStrStr(serienListe.c_str());
|
||||
while (std::getline(newStrStr, line).good()) {
|
||||
if(line != "" && alte_list.find(line) == std::string::npos) {
|
||||
std::cout << "Neu: '" << line.substr(line.find_last_of("|") + 1) << "'" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "Serienunterschied: " << ( ((countAf - countBef) > 0) ? "+" : "") << countAf - countBef << " Serien." << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user