Read the next line of input from stdin, if anything is available.
| 207 | |
| 208 | // Read the next line of input from stdin, if anything is available. |
| 209 | bool LocalUserInput_GetNext( std::string &result ) |
| 210 | { |
| 211 | bool got_input = false; |
| 212 | mutexUserInputQueue.lock(); |
| 213 | while ( !queueUserInput.empty() && !got_input ) |
| 214 | { |
| 215 | result = queueUserInput.front(); |
| 216 | queueUserInput.pop(); |
| 217 | ltrim(result); |
| 218 | rtrim(result); |
| 219 | got_input = !result.empty(); // ignore blank lines |
| 220 | } |
| 221 | mutexUserInputQueue.unlock(); |
| 222 | return got_input; |
| 223 | } |
| 224 | |
| 225 | ///////////////////////////////////////////////////////////////////////////// |
| 226 | // |