/** * If they are all set to 0 reproducios index * @brief Aleatorio::Todos * @return void */ void Aleatorio::Todos() { int TotalReproducidos=0; QFile file(Path + "/radit.txt"); file.open(QIODevice::WriteOnly| QIODevice::ReadOnly| QIODevice::Text); QTextStream out(&file); QString line; while (!out.atEnd()) { line = out.readLine(); ++TotalReproducidos; } // si el total de ficheros es menos o igual que el indice borra indice if(TotalFicheros<=TotalReproducidos) { file.remove(); Nuevo(line.toInt()); // marca el ultimo en el indice evita repetir el ultimo } }
void Insert(char Palabra[],Nodo *raiz){ int posicion; Nodo *temp=raiz; char *aux=Palabra; while(*aux!='\0'){ if(*aux!='á'&&*aux!='é'&&*aux!='í'&&*aux!='ó'&&*aux!='ú'&& *aux!='ñ') posicion=tolower(*aux)-'a'; else { switch(*aux){ case 'ñ': posicion=26;break; case 'á': posicion=27;break; case 'é': posicion=28;break; case 'í': posicion=29;break; case 'ó': posicion=30;break; case 'ú': posicion=30;break; } } if(posicion<0 || posicion>32) return; if(temp->array[posicion]==NULL){ temp->array[posicion]=Nuevo(*aux); } temp=temp->array[posicion]; aux++; } temp->End=true; }