lundi 1 février 2016

How To Get SQLite Records in Single Class Method in C++

In this example...

http://ift.tt/1cWE14v

...I see how to use sqlite3_exec() with a callback class method or function in order to get a recordset and iterate through it.

Well, what if I want to create a class DB and have a static class method

static void * getRS(void *hDB,std::string sSQL) ?

I'm kind of new with C++ but getting the hang of it extremely rapidly. Is there a way in C++ to create like a Lambda function, get the results from that, and pass them back? Or, is there another technique to return a std::map, std::multimap, etc. that I can iterate through each row?

(Note, I'm using XCode and calling C++ from a db.static.mm file in my Objective C project, if that matters.)

Aucun commentaire:

Enregistrer un commentaire