I am trying to wrap a C ++ library in Objective-C classes for import into MonoTouch using btouch. I am trying to understand how to translate the API for use in a managed environment. In particular, how to handle methods that accept pointers to local variables, such as the static method ULDatabaseManager :: OpenConnection in the following example:
class UL_CLS_SPEC ULError {
public:
ULError();
inline an_sql_code GetSQLCode() const {
return _info.sqlcode;
}
}
class UL_CLS_SPEC ULDatabaseManager {
public:
static bool Init();
static void Fini();
static ULConnection * OpenConnection(
const char * connParms,
ULError * error = UL_NULL);
}
From Objective-C, this C ++ API will be called as follows:
- (void)openConnection {
if (ULDatabaseManager::Init()) {
const char * connectionParms;
ULConnection * conn = nil;
ULError error;
connectionParms = [self getConnectionParms];
conn = ULDatabaseManager::OpenConnection(connectionParms, &error);
if (error.GetSQLCode() == SQLE_ULTRALITE_DATABASE_NOT_FOUND) {
}
}
}
API OpenConnection ULError . , , , , , , ULError. API Objective-C? ULError?
, , ++ Objective-C ( MonoTouch, ), , , !:) . , , ++ API.
PS: , ++ Objective-C, MonoTouch , -, btouch Objective-C, .