Собственно вопрос, есть ли аналог функции feof в Qt? Нужно считывать строки со стандартного ввода, пока пользователь не нажмет Ctrl+D. В С это было
while(!feof(stdin)) { .... }
bool QIODevice::atEnd () const [virtual]
Returns true if the current read and write position is at the end of the device (i.e. there is no more data available for reading on the device); otherwise returns false.
For some devices, atEnd() can return true even though there is more data to read. This special case only applies to devices that generate data in direct response to you calling read() (e.g., /dev or /proc files on Unix and Mac OS X, or console input / stdin on all platforms).
Спасибо, оно и есть. Просто не знал, что atEnd() работает и для stdin.
Да, забыл дописать, ctrl+D - это комбинация клавиш, означающих конец ввода, в *.nix
Форум Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)