Created
December 21, 2015 22:32
-
-
Save luistelmocosta/b16dd9dbcc8b56b2758c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Campeonato::readFileBilhetes(string filename) { | |
ifstream ficheiro_leitura(filename.c_str()); | |
if(!ficheiro_leitura) | |
throw ErroNoFicheiro(filename); | |
else{ | |
string dono, data, provas; | |
unsigned int duracao; | |
while (!ficheiro_leitura.eof()){ | |
getline(ficheiro_leitura, dono); | |
getline(ficheiro_leitura, data); | |
getline(ficheiro_leitura, provas); | |
//duracao=atoi(durtmp.c_str()); | |
stringstream dataSs; | |
date d; | |
dataSs << data; | |
int dia, mes, ano; | |
char tmp; | |
dataSs >> dia >> tmp >> mes >> tmp >> ano; | |
if(dia < 1 || dia > 31|| mes < 1 || mes > 12 || ano < 1 || (dia > 28 && mes == 2) || (dia > 30 && mes == 4) || (dia > 30 && mes == 6) || (dia > 30 && mes == 9) || (dia > 30 && mes == 11)){ | |
cout << "Data invalida!"; | |
} | |
else{ | |
d.dia = dia; | |
d.mes = mes; | |
d.ano = ano; | |
} | |
} | |
string s; | |
stringstream provasS; | |
vector<Prova*> provaBilhete; | |
istringstream ss(s); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment