MCPcopy Create free account
hub / github.com/amule-project/amule / ShowResults

Method ShowResults

src/TextClient.cpp:695–717  ·  view source on GitHub ↗

* Method to show the results in the console */

Source from the content-addressed store, hash-verified

693 * Method to show the results in the console
694 */
695void 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

Callers 2

OnSearchClosingMethod · 0.45
CreateNewTabMethod · 0.45

Calls 6

PrintfMethod · 0.80
LengthMethod · 0.80
unicode2charFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected