Esempio n. 1
0
bool QIODevice::atEnd() const
{
    if ( isSequentialAccess() || isTranslated() ) {
	QIODevice* that = (QIODevice*)this;
	int c = that->getch();
	bool result = c < 0;
	that->ungetch(c);
	return result;
    } else {
	return at() == (int)size();
    }
}
Esempio n. 2
0
void KeytabReader::getCc()
{
    if(cc == '\n')
    {
        linno += 1;
        colno = 0;
    }
    if(cc < 0)
        return;
    cc = buf->getch();
    colno += 1;
}
Esempio n. 3
0
bool QIODevice::atEnd() const
{
    if ( isSequentialAccess() || isTranslated() ) {
	QIODevice* that = (QIODevice*)this;
        const int oldStatus = ioSt;
	int c = that->getch();
	bool result = c < 0;
	that->ungetch(c);
        if (ioSt != oldStatus)
            that->ioSt = oldStatus;
	return result;
    } else {
	return at() == size();
    }
}
Esempio n. 4
0
void test_getch(const QString &fileName)
{
    QIODevice *dev = KFilterDev::deviceForFile(fileName);
    if(!dev)
    {
        kdWarning() << "dev=0" << endl;
        return;
    }
    if(!dev->open(IO_ReadOnly))
    {
        kdWarning() << "open failed " << endl;
        return;
    }
    int ch;
    while((ch = dev->getch()) != -1)
        printf("%c", ch);
    dev->close();
    delete dev;
}