examples/example_chat.cpp
// Read the next line of input from stdin, if anything is available.
Read the next line of input from stdin, if anything is available.
Read the next line of input from stdin if anything is available .
bool LocalUserInput_GetNext( std::string &result )
{
	bool got_input = false;
	mutexUserInputQueue.lock();
	while ( !queueUserInput.empty() && !got_input )
	{
		result = queueUserInput.front();
		queueUserInput.pop();
		ltrim(result);
		rtrim(result);
		got_input = !result.empty(); 
	}
	mutexUserInputQueue.unlock();
	return got_input;
}
bool LocalUserInput_GetNext ( std :: string & result ) { bool got_input = false ; mutexUserInputQueue . lock ( ) ; while ( ! queueUserInput . empty ( ) && ! got_input ) { result = queueUserInput . front ( ) ; queueUserInput . pop ( ) ; ltrim ( result ) ; rtrim ( result ) ; got_input = ! result . empty ( ) ; } mutexUserInputQueue . unlock ( ) ; return got_input ; }
Read the next line of input from stdin, if anything is available.
Read the next line of input from stdin if anything is available .
// ignore blank lines