1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
| std::wstring t;
const wchar_t* p{ L".\\Exemple.txt" };
std::filesystem::path filePath(p);
try
{
t = lire_fichierTxt(filePath);
}
catch (runtime_error const& exception)
{
std::wcout << L"Erreur : " << exception.what() << std::endl;
}
AffichagePersonnalisation person = getCurrentAffichagePersonnalisation();//fonction à implémenter pour récupérer la configuration de personnalisation de l'utilisateur.
//std::list<std::wstring> racines{
const std::vector<std::wstring> racines{
L"L'Attaque des Titans.[2013- Crunchyroll].Manga",
L"Azertyuiop £££.[2024-].Mini-série",
L"Kaleidoscope.[2023 Netflix]",
L"Seven Deadly Sins- Four Knights of the Apocalypse.[2023-].Manga",
L"Dr. STONE.[2019- Crunchyroll].Manga",
L"Andor.[2022- Disney+]",
L"Star Wars Rebels.[2014-2017 Disney+].Animation",
L"Star Wars- The Clone wars.[2008-2020 Disney+].Animation",
L"Shogun.[2024- Disney+]",
L"Love, Death + Robots.[2019- Netflix].Animation",
L"1883.[2021 Paramount+]",
L"Avatar 2 - la voie de l'eau.(2022-12-14)",
L"Kingsglaive- Final Fantasy XV.(2016-08-30 VOD).Animation",
L"Prey.(2022-08-05 Disney+)",
L"Sous la Seine.(2024-06-05 Netflix)",
L"Star Wars - Episode VII - Le réveil de la force.(2015-12-16)",
L"Star Wars- The Clone Wars.(2008-08-27).Animation",
L"Saison.txt",
L"you"
};
//auto racine = racines[0];
//auto racine = racines[1];
//auto racine = racines[2];
//auto racine = racines[3];
//auto racine = racines[4];
// auto racine = racines[6];
//auto racine = racines[9];
//auto racine = racines[10];
//auto racine = racines[11];
//auto racine = racines[16];
auto racine = racines.back();
std::wcout << L"racine=[" << racine << L']' << std::endl;
fs::path r;// = L"";
if (racine == racines.back())
{
//std::vector<wstring> argv_You = lire_fichierTxt(L"d:\\Users\\admin\\Documents\\You.txt", {L"\n"});
//std::flush;
//std::cin.ignore(255, '\n');
//std::cin.clear();
//std::cin.eof()
//std::cin.fail()
// Il existe des flux pour communiquer avec des fichiers(std::ifstream et std::ofstream), avec des chaînes de caractères(std::istringstream et std::ostringstream), avec l’entrée et la sortie standards(std::cin et std::cout).
/*std::vector<wstring> s;// = { demander_nom_dossier() };
std::wstring wstr;
bool found2 = false;
bool found_you = false;
bool found_t = false;
bool found_f_ou_s = false;
bool found_dossier = false;
std::wstring dossier = L"";
std::wcout << "You : " << std::endl;
while (!found2)
{
while (std::getline(wcin, wstr, L' '))
{
;
if (wstr.empty())
{
std::wcout << L"Nom de dossier vide !!!" << std::endl;
std::wcout << "You : " << std::endl;
continue;
}
if (!found_you && !found_t && !found_f_ou_s && !found_dossier && (wstr == L"you" || wstr == L"You" || wstr == L"YOU") )
{
found_you = true;
wstr = L"";
continue;
}
if (!found_t && !found_f_ou_s && !found_dossier && (wstr[0] == L'/' || wstr[0] == L'-') && wstr[1] == L't'/)
{
found_t = true;
wstr = L"";
continue;
}
if (!found_f_ou_s && !found_dossier && (wstr[0] == L'f' || wstr[0] == L's'))
{
found_f_ou_s = true;
wstr = L"";
continue;
}
if (!found_dossier)// && std::is_directory(wstr))
{
dossier = wstr;
wstr = L"";
found_dossier = true;
if (found_dossier)
break;
}
}
}
r = dossier + L" " + std::getline(wcin, wstr, L'\n');
*/
//std::wcin.clear();
std::wstring wstr;
std::vector<std::wstring> dossier;
std::vector<std::wstring> dos;
//while (getline(std::wcin, wstr))
//{
// dos.push_back(wstr);
//}
// Now try it with a whitespace delimiter
while (std::getline(std::wcin, wstr, L' '))
{
dossier.push_back(wstr);
}
dossier.erase(dossier.begin());
dossier.erase(dossier.begin());
dossier.erase(dossier.begin());
for (const auto& d : dossier)
{
std::wcout << d << std::endl;
}
}
else
{
r = t + racine;
}
auto nomDossier = r.filename().wstring();
assert(nomDossier.length() > 0 && L"Nom de dossier vide"); |
Partager