Need help/advice on system
Heres what I need to do:
I need to implement a system for storing strings, and I need to be able to easily add and remove strings from it as fast and efficently as posssible. Also each string will have an associated id (unsigned long), and I need to be able to find a string by its id aswell. I can't use databases, so it all has to be done with files. I hope Im explaining this well. Basically the interface would consist of 4 functions: Code:
void AddString(string) |
Are you aware of UNIX db api ? Try man db, just to see
It can works with flat-file format |
If you are using C++ and want to stay standard and portable, I'd suggest std::map and std::string, then make a wrapper class for the map:
Code:
//Off the top of my head; compiled, but not linked or run http://www.sgi.com/tech/stl/table_of_contents.html ta0kira PS I just realized you might be talking about a file, therefore you could use the above plus an interface class to read/write the file. That I'm not sure about though. |
thanks, ta0kira, I'll look into that route
|
All times are GMT -5. The time now is 01:50 AM. |