What I want to do is make a simple database. For my program, I need to register every package into some database. The fields I need with every package are shown in these structs:
Code:
struct Dependency
{
char *name; // or if you want, char name[64];
int minVersion; // bottom range
int maxVersion; // higher range
};
struct Package
{
char *name; // or if you want, char name[64];
int version;
int importsNum;
Dependency *imports; // array
};
This is going to be a local database, probably in some file. I need to search and add items to the database real quickly. A sample query would be:
Name=”ImagePlugin”
Version Range=2 to 7
Then it would search the database and return the most recent version of the struct Package between versions 2 and 7 and with the name ImagePlugin. I could do a real database but I need this to be __cross-platform__ and be able to create, manipulate and search the data from C++ code, well, with no intervention from a person
My question is: How can I do this in the most efficient, fastest way? If I use files, how do I position the dependencies? In a separate file(s)? If I’m using a real database, which library would I choose?