Examples/HttpAnalyzer/main.cpp
/**
 * Print the status code count table
 */
Print the status code count table
Print the status code count table
void printStatusCodes(HttpResponseStats& resStatscollector)
{
	std::vector<std::string> columnNames;
	columnNames.push_back("Status Code");
	columnNames.push_back("Count");
	std::vector<int> columnsWidths;
	columnsWidths.push_back(28);
	columnsWidths.push_back(5);
	pcpp::TablePrinter printer(columnNames, columnsWidths);
	for(std::map<std::string, int>::iterator iter = resStatscollector.statusCodeCount.begin();
			iter != resStatscollector.statusCodeCount.end();
			iter++)
	{
		std::stringstream values;
		values << iter->first << "|" << iter->second;
		printer.printRow(values.str(), '|');
	}
}
void printStatusCodes ( HttpResponseStats & resStatscollector ) { std :: vector < std :: string > columnNames ; columnNames . push_back ( " " ) ; columnNames . push_back ( " " ) ; std :: vector < int > columnsWidths ; columnsWidths . push_back ( 28 ) ; columnsWidths . push_back ( 5 ) ; pcpp :: TablePrinter printer ( columnNames , columnsWidths ) ; for ( std :: map < std :: string , int > :: iterator iter = resStatscollector . statusCodeCount . begin ( ) ; iter != resStatscollector . statusCodeCount . end ( ) ; iter ++ ) { std :: stringstream values ; values << iter -> first << " " << iter -> second ; printer . printRow ( values . str ( ) , ' ' ) ; } }
Print the status code count table
Print the status code count table
// create the table
 // go over the status code map and print each item
