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
| const int Serie::afficher_dossier(std::wstring const& t)
{
#if Serie_afficher_ == true
B.Ok_T(L"const int Serie::afficher_dossier(" + t + L") :");
#endif
if (affichage_titre_actif == false)
{
#if Serie_afficher_dossier_ == true
B.Ok_W(L"{" + t + L'}');
#endif
int i = 0;
int tm_year = 0, tm_mon = 0, tm_mday = 0;
std::wstring date = L"";
std::wstring t2;
std::size_t idx, idx2 = 0;
idx = t.find(L".[", 0);
t2 = t.substr(0, idx);
i = ::afficher_Titre(t2, titre, affichage_titre_actif);
Titre__ = t2;
idx = t.find_last_of(L"[");
idx2 = t.find_last_of(L"]");
if (idx2 - idx - 1 == 0)
return -1;
idx2--;
if (!(t.at(idx2) == L' ' || t.at(idx2) == L'-' ||
t.at(idx2) == L'0' || t.at(idx2) == L'1' || t.at(idx2) == L'2' || t.at(idx2) == L'3' || t.at(idx2) == L'4' ||
t.at(idx2) == L'5' || t.at(idx2) == L'6' || t.at(idx2) == L'7' || t.at(idx2) == L'8' || t.at(idx2) == L'9'))
{ // Sur
std::size_t idx3;
idx3 = t.find_first_of(L" ", idx);
idx3++;
t2 = t.substr(idx3, idx2 - idx3 + 1);
afficher_Sur(t2);
if (sur == t2)
{
#if Serie_afficher_dossier_ == true
B.Ok_W(L"Pas de Sur={" + t2 + L"} !!!");
#endif
E.afficher_X(-1, L"Pas de Sur={" + t2 + L"} !!!", L"Erreur (" + t2 + L") !!!");
return EXIT_FAILURE;
}
else
{
sur = t2;
}
if (sur == L"Netflix")
netflix_ok_ou_non = true;
std::wcout << L"Sur={" << sur << L"}" << std::endl;
idx2 = idx3 - 2;
}
idx++;
if (t.at(idx2) == L' ' || t.at(idx2) == L'-' ||
t.at(idx2) == L'0' || t.at(idx2) == L'1' || t.at(idx2) == L'2' || t.at(idx2) == L'3' || t.at(idx2) == L'4' ||
t.at(idx2) == L'5' || t.at(idx2) == L'6' || t.at(idx2) == L'7' || t.at(idx2) == L'8' || t.at(idx2) == L'9')
{ // Date
t2 = t.substr(idx, idx2 - idx + 1);
i = afficher_Date(t2);
#if Serie_afficher_dossier_ == 1
B.Ok_W(L"afficher_Date={" + t2 + L'}');
#endif
}
idx = t.find(L"].");
if (idx != std::wstring::npos)
{ // Sous_Genre
idx += 2;
sous_genre = t.substr(idx);
//wstring sous_genre = L"";
i = afficher_Sous_Genre(sous_genre);
affichage_sous_genre_actif = true;
}
D_I = 0;
#if Serie_afficher_dossier_ == true
//wcout << L" " << L"t={" << t << L"}" << endl;
B.Ok_W(L"t={" + t + L"}");
#endif
}
else
{
std::size_t pos;
pos = t.length();
pos--;
std::wstring t2 = t.substr(0, pos);
pos = t2.find_last_of(L"\\");
t2 = t2.substr(++pos);
D[D_I] = t;
//
if (
(t2[4] == L'-' && t2[7] == L'-' /*&& pos == 11*/ /* && t[11] == wstring::npos*/)
||
(t2[4] == std::wstring::npos)
||
t2 == L"Nouveau dossier"
)
// XXXX-XX-XX ou xxxx ou "Nouveau dossier"
{
int i = afficher_Diffusee(D_I, t2);
if (Date_Diffusee_a_partir_de_[D_I] == true)
{
#if Serie_afficher_dossier_ == 1
//wcout << L" " << L"Date_Diffusee_a_partir_de_[" << Date_Diffusee_a_partir_de_[D_I] << L"] = ok !" << endl;
B.Ok_W(L"Date_Diffusee_a_partir_de_={" + to_wstring(Date_Diffusee_a_partir_de_[D_I]) + L"} = ok !");
#endif
//return 0;
}
}
else
{
#if Serie_afficher_dossier_ == 1
//wcout << L" " << L"Date_Diffusee_a_partir_de_[" << Date_Diffusee_a_partir_de_[D_I] << L"] = érreur !!!" << endl;
B.Ok_W(L"Date_Diffusee_a_partir_de_[" + to_wstring(Date_Diffusee_a_partir_de_[D_I]) + L"} = erreur !!!");
#endif
E.afficher_X(-1, t2, t + L" erreur !!!");
return EXIT_FAILURE;
}
//D_J[_X2_]
//wcout << L"*****" << endl;
#if Serie_afficher_dossier_ == 1
//wcout << L"-----> D[" << D[D_I] << L"]=" << t << endl;
B.Ok_W(L"-----> D[" + D[D_I] + L"]=" + t2);
#endif
D_J[D_I] = 0;
D_I++;
}
#if Serie_afficher_dossier_ == true
//wcout << B_T << L"const int Serie::afficher(" << t << L") : Ok !" << B_t << endl;
B.Ok_T(L"const int Serie::afficher_dossier() : Ok !");
#endif
return EXIT_SUCCESS;
} |