On Mon, 8 Oct 2001 19:39:41 -0700, Rob Hudson <[EMAIL PROTECTED]> wrote:
> When programming c/c++ apps, what do most open source folks use as > it's storage libraries (for example, an address book or CD list). I > can't imagine writing an app that requires mysql or postgres. Storing > data as XML seems like too much overhead. I saw a book on the > Berkeley database that is a library that you compile against. This > seems like a good solution. Berkeley DB is widely used, so might be a good choice... > My intent is to write a stupid little app for myself to re-acquaint > myself with C or C++. I'd rather not output into a <x> delimited > file, but use something that is more commonly found in the 'real > world' and something I could learn from and probably use later. > And/or something that the majority of open source apps use. XML is commonly found in the real world, and the data files are portable. So, it's worth wrapping your hands around. The "GNOME" libxml is very nice, and overhead can be minimized by using the SAX interface (a little more complicated...). For speed, you probably can't beat a binary file. But it's more work to make it portable (endian issues, data type sizes, etc...). If your C or C++ is rusty, I'd strongly suggest just using simple text files so you can focus on what the program is supposed to do. Later you can muck with file storage formats to balance speed, size and portability. Abstract the file I/O from the rest of the program so it doesn't need to care if the file format changes. -- Eric G. Miller <egm2@jps.net>