* Method to show the results in the console */
| 693 | * Method to show the results in the console |
| 694 | */ |
| 695 | void CamulecmdApp::ShowResults(CResultMap results_map) |
| 696 | { |
| 697 | unsigned int name_max = 80; |
| 698 | unsigned int mb_max = 5; |
| 699 | unsigned int nr_max = 5; |
| 700 | wxString output, name, sources, mb , kb; |
| 701 | |
| 702 | printf("Nr. Filename: Size(MB): Sources: \n"); |
| 703 | printf("-----------------------------------------------------------------------------------------------------------\n"); |
| 704 | |
| 705 | for( std::map<unsigned long int,SearchFile*>::iterator iter = results_map.begin(); iter != results_map.end(); ++iter ) { |
| 706 | unsigned long int id = 0; |
| 707 | id = (*iter).first; |
| 708 | SearchFile* file = (*iter).second; |
| 709 | |
| 710 | output.Printf("%lu. ", id); |
| 711 | output = output.SubString(0, nr_max).Append(file->sFileName).Append(' ', name_max); |
| 712 | mb.Printf(" %ld", file->lFileSize/1024/1024); |
| 713 | kb.Printf(".%03ld", file->lFileSize/1024%1024); |
| 714 | output = output.SubString(0, nr_max + name_max + mb_max - mb.Length() ).Append(mb).Append(kb); |
| 715 | printf("%s %ld\n",(const char*)unicode2char(output), file->lSourceCount ); |
| 716 | } |
| 717 | } |
| 718 | |
| 719 | |
| 720 | // Formats a statistics (sub)tree to text |