Hi,
Well, I did it the way below and it works fine for my purpose and for the specific files I am dealing with but I am not sure how general it is:
38 QFile in
(QString::fromStdString("datazip/temp/" + fileName
));
41 bufIn = in.readAll();
42 in.close();
43 if((int)bufIn.at(0) < 0)
44 {
45 for(int i(0); i<bufIn.size(); ++i)
46 if((int) bufIn.at(i) > 0)
47 bufOut.append(bufIn.at(i));
48 QFile out
(QString::fromStdString("datazip/temp/" + fileName
));
50 out.write(bufOut);
51 out.close();
52 }
38 QFile in(QString::fromStdString("datazip/temp/" + fileName));
39 in.open(QIODevice::ReadOnly);
40 QByteArray bufIn, bufOut;
41 bufIn = in.readAll();
42 in.close();
43 if((int)bufIn.at(0) < 0)
44 {
45 for(int i(0); i<bufIn.size(); ++i)
46 if((int) bufIn.at(i) > 0)
47 bufOut.append(bufIn.at(i));
48 QFile out(QString::fromStdString("datazip/temp/" + fileName));
49 out.open(QIODevice::WriteOnly);
50 out.write(bufOut);
51 out.close();
52 }
To copy to clipboard, switch view to plain text mode
Thanks!
Bookmarks