LINUX.ORG.RU

История изменений

Исправление bad_master, (текущая версия) :

теперь читаю так

QFile *f = new QFile("C:\\su.dbf");
    if(f->open(QIODevice::ReadOnly))
    {
        qDebug()<< "File is open";

        QByteArray block = f->read(32);
        qDebug()<<block;

        unsigned int count_rec = block[7]<<24|block[6]<<16|block[5]<<8|block[4];
        //qDebug()<< res;
        unsigned short len = block[9]<<8|block[8];//вот тут косяк
        //qDebug()<< len;

        unsigned int lenrec = block[11]<<8|block[10];
        qDebug()<< lenrec;
        if(block[28])
            qDebug() <<"mdx";
        else
            qDebug()<<"not mdx";
        std::vector<unsigned char> field_len;
        for(int i=0;i<36;i++)
        {
            block = f->read(32);
            field_len.push_back((unsigned char)block[16]);
            qDebug()<<field_len[field_len.size()-1]<<" "<<field_len.size();
        }
        block = f->read(1);

        for(int i=0;i<count_rec;i++)
        {
            block = f->read(1);
            for(int j=0;j<field_len.size();j++)
            {
                block = f->read(field_len[j]);
                qDebug()<<block<<"-||-";
            }
        }
        f->close();
    }
    else
        qDebug() << "File isn't open";

Исходная версия bad_master, :

теперь читаю так

QFile *f = new QFile("C:\\su.dbf");
    if(f->open(QIODevice::ReadOnly))
    {
        qDebug()<< "File is open";

        QByteArray block = f->read(32);
        qDebug()<<block;

        unsigned int count_rec = block[7]<<24|block[6]<<16|block[5]<<8|block[4];
        //qDebug()<< res;
        unsigned short len = block[9]<<8|block[8];//вот тут косяк
        //qDebug()<< len;

        unsigned int lenrec = block[11]<<8|block[10];
        qDebug()<< lenrec;
        if(block[28])
            qDebug() <<"mdx";
        else
            qDebug()<<"not mdx";
        std::vector<unsigned int> field_len;
        for(int i=0;i<36;i++)
        {
            block = f->read(32);
            field_len.push_back((unsigned int)block[16]);
            qDebug()<<field_len[field_len.size()-1]<<" "<<field_len.size();
        }
        block = f->read(1);

        for(int i=0;i<count_rec;i++)
        {
            block = f->read(1);
            for(int j=0;j<field_len.size();j++)
            {
                block = f->read(field_len[j]);
                qDebug()<<block<<"-||-";
            }
        }
        f->close();
    }
    else
        qDebug() << "File isn't open";