Murat Şeker
Murat Şeker

Reputation: 1711

How to search in binary files

I'm working on an application which saves its project files in binary format using QDataStream. They asked me to come with a design that enables a search mechanism in those project files.

For example, it should be possible to find the projects which contain a specific parameter that is placed deep down in the serialization order.

I'm able to come with 2 unfeasible approaches :

This involves lots of file IO and it would probably be very slow.

Since the project file is quite complicated, it seems really hard to design the database tables.

What would be your way to go ? I'm open for any kind of method, technology, framework, library...

Upvotes: 0

Views: 92

Answers (1)

Blindy
Blindy

Reputation: 67380

You are right in that it's a very difficult problem to solve. And instead of writing your own potentially buggy and/or crippled implementation, why not use LuceneIndex which already does it all for you?

There are many popular implementations of the library, including in Java, C# and C++ (which I assume you're interested in).

Upvotes: 1

Related Questions