Results 1 to 4 of 4

Thread: how can we search the some special markers from QFile

  1. #1
    Join Date
    Sep 2008
    Posts
    93
    Thanks
    6
    Thanked 1 Time in 1 Post

    Default how can we search the some special markers from QFile

    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

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how can we search the some special markers from QFile

    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.

  3. #3
    Join Date
    Sep 2008
    Posts
    93
    Thanks
    6
    Thanked 1 Time in 1 Post

    Default Re: how can we search the some special markers from QFile

    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.

  4. #4
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how can we search the some special markers from QFile

    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

Similar Threads

  1. Replies: 28
    Last Post: 22nd February 2010, 10:27
  2. Help: How to draw markers on plot?
    By jwieland in forum Qwt
    Replies: 5
    Last Post: 24th November 2009, 11:22
  3. Replies: 2
    Last Post: 27th October 2009, 13:40
  4. qscintilla and markers
    By sawerset in forum Qt Programming
    Replies: 0
    Last Post: 17th February 2009, 21:39
  5. Replies: 1
    Last Post: 11th January 2008, 09:59

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.