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
| bool ListeRep::verifExt(string ext)
{
int i, nb;
nb=(int)(sizeof(ListeRep::extensions)/sizeof(ListeRep::extensions[0]));
cout << "'"+ext+"'" << nb << endl;
i=0;
while( i<nb )
{
if ( ext==ListeRep::extensions[i] )
return true;
i++;
}
return false;
}
bool ListeRep::formatOK(string ff)
{
int l=ff.size(), i;
i=l-1;
while(i>=0 && ff[i]!='.')
i--;
i++;
string ext(ff.substr(i));
if ( ext.size() == ff.size() && verifExt("") ) // pas d'extension
return true;
if ( verifExt(ext) )
return true;
return false;
} |