library/src/network/email/BP-Email.cc
/** Print a menu on the standard output.
  *
  * @param choices menu choices
  */
Print a menu on the standard output.
@param choices menu choices
Print a menu on the standard output . @param choices menu choices
static size_t printMenu(const std::vector <std::string>& choices)
{
	std::cout << std::endl;
	for (size_t i = 0 ; i < choices.size() ; ++i)
		std::cout << "   " << (i + 1) << ". " << choices[i] << std::endl;
	std::cout << std::endl;
	std::cout << "   Your choice? [1-" << choices.size() << "] ";
	std::cout.flush();
	std::string line;
	std::getline(std::cin, line);
	std::istringstream iss(line);
	size_t choice = 0;
	iss >> choice;
	std::cout << std::endl;
	if (choice < 1 || choice > choices.size())
		return 0;
	else
		return choice;
}
static size_t printMenu ( const std :: vector < std :: string > & choices ) { std :: cout << std :: endl ; for ( size_t i = 0 ; i < choices . size ( ) ; ++ i ) std :: cout << " " << ( i + 1 ) << " " << choices [ i ] << std :: endl ; std :: cout << std :: endl ; std :: cout << " " << choices . size ( ) << " " ; std :: cout . flush ( ) ; std :: string line ; std :: getline ( std :: cin , line ) ; std :: istringstream iss ( line ) ; size_t choice = 0 ; iss >> choice ; std :: cout << std :: endl ; if ( choice < 1 || choice > choices . size ( ) ) return 0 ; else return choice ; }
Print a menu on the standard output.
Print a menu on the standard output .