On 3/29/10 23:10 , "Tim Romano" <tim.rom...@yahoo.com> wrote:
> On 3/29/2010 4:19 PM, Kevin M. wrote: >> I have a C/C++ application in which I want to store data from a struct into a >> table (using SQLite 3.6.23) and later retrieve data from the table and store >> it back in the struct. But, I need a general interface for this as there are >> many types of structs used. >> > > Couldn't you convert the structs to JSON format and store them in a TEXT > field? > There are a number of C++ JSON libraries listed here: http://www.json.org/ > Since it's C++, an another option (a good one IMHO) is to use the Boost serialization facility. See http://www.boost.org and more specifically: http://www.boost.org/doc/libs/1_42_0/libs/serialization/doc/index.html I quote: Here, we use the term "serialization" to mean the reversible deconstruction of an arbitrary set of C++ data structures to a sequence of bytes. Such a system can be used to reconstitute an equivalent structure in another program context. Depending on the context, this might used implement object persistence, remote parameter passing or other facility. In this system we use the term "archive" to refer to a specific rendering of this stream of bytes. This could be a file of binary data, text data, XML, or some other created by the user of this library. <\quote> "some other" could be a SQLite repository. FWIW, Boost is a widely established C++ general library with enough influence the next C++ standard library will borrow a lot from it. JD _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users