nadiap <[EMAIL PROTECTED]> wrote:
Hello to all!
I really need some help here. I know that using the
sqlie3_create_function we can call c function through sqlite.
But here is my problem:

sqlite3_create_function(mpDB,"DEPLOY",3,SQLITE_UTF8,NULL,&deploy_func,NULL,NULL);



void MyClass::deploy_func(sqlite3_context* context,int
argc,sqlite3_value**argv){
fprintf(stdout,"____________________________________\n");
getApp()->deploy(argv[0],argv[1],argv[2]);
}

where getApp() is a public function of the class MyClass.

i want the deploy_func to be a function member of a class. Is it
possible to be done?

class MyClass {
   static void deploy_func(sqlite3_context*,int,sqlite3_value**);
};

MyClass* pMyClass = new MyClass;
sqlite3_create_function(mpDB,"DEPLOY",3,SQLITE_UTF8,pMyClass,MyClass::deploy_func,NULL,NULL);

void MyClass::deploy_func(sqlite3_context* context,int,sqlite3_value** argv) {
   MyClass* pThis = static_cast<MyClass*>(sqlite3_user_data(context));
   pThis->getApp()->deploy(argv[0], argv[1], argv[2]);
}

Igor Tandetnik

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to