I have following code in QT in
// myEditor.h
class myEditor : QScintilla {
public:
readFile();
};
#include "myEditor.h"
// myEditor.cc
myEditor::readFile() {
FILE* fp = fopen("mynew.v","r"):
QTextStream ts(fp, QIODevice::ReadOnly);
/* reading the text stream buffer by buffer
bufferSize is calculated using following formula
2 to power(k) * n = 2 to power 31*
where n is size of each block in linux filesystem*/
int bufferSize =(1024* 1024)/2;
do {
QString s = ts.read(bufferSize);
append(s);
} while(!ts.atEnd());
}
I calculated the bufferSize as per comments .It will be helpful if someone can review the code and let me know if there are issues.
QScintilla? I'm sure it wasn't designed for this. As for gzip files,QFile, by itself, doesn't handle (de)compression, but neither doesfopen()\$\endgroup\$