I have an object of QFile, I hope to search some special markers from this file. But I did not find any functions to do it without reading the file.
Are there some ways to do it?
Thanks
I have an object of QFile, I hope to search some special markers from this file. But I did not find any functions to do it without reading the file.
Are there some ways to do it?
Thanks
define "special markers". If you mean a specific sequence of bytes in the file, then yes, you need to read the file to find them.
Thanks!
If there are some better and faster ways to do it? I don't want to read the file one byte after one byte.
How should that work? You can't find anything without looking!
If you need this for performance reasons, you could create a separate 'index-file' upon writing the file or on first read, where you store the byteoffsets of your markers or sections. Then you can use QFile::seek(..) to get there fast.
HIH
Johannes
Bookmarks