diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index b3ec70e1e..76b3072cc 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2013,7 +2013,7 @@ LinphoneCore *_linphone_core_new_with_config(LinphoneCoreCbs *cbs, struct _LpCon } LinphoneCore *linphone_core_new_with_config(const LinphoneCoreVTable *vtable, struct _LpConfig *config, void *userdata) { - LinphoneCoreCbs *cbs = linphone_factory_create_core_cbs(linphone_factory_get());; + LinphoneCoreCbs *cbs = linphone_factory_create_core_cbs(linphone_factory_get()); LinphoneCoreVTable *local_vtable = linphone_core_v_table_new(); LinphoneCore *core = NULL; if (vtable != NULL) *local_vtable = *vtable; diff --git a/coreapi/vcard.cc b/coreapi/vcard.cc index 4d1c8586d..010b61f68 100644 --- a/coreapi/vcard.cc +++ b/coreapi/vcard.cc @@ -178,6 +178,10 @@ const char * linphone_vcard_as_vcard4_string(LinphoneVcard *vCard) { return vCard->belCard->toFoldedString().c_str(); } +void *linphone_vcard_get_belcard(LinphoneVcard *vcard) { + return &vcard->belCard; +} + void linphone_vcard_set_full_name(LinphoneVcard *vCard, const char *name) { if (!vCard || !name) return; diff --git a/include/linphone/wrapper_utils.h b/include/linphone/wrapper_utils.h index dd1acbafe..fd76034b9 100644 --- a/include/linphone/wrapper_utils.h +++ b/include/linphone/wrapper_utils.h @@ -50,6 +50,11 @@ extern "C" { */ LINPHONE_PUBLIC void linphone_chat_room_send_chat_message_2(LinphoneChatRoom *cr, LinphoneChatMessage *msg); +/** + * Accessor for the shared_ptr<BelCard> stored by a #LinphoneVcard + */ +LINPHONE_PUBLIC void *linphone_vcard_get_belcard(LinphoneVcard *vcard); + /** * @} */ diff --git a/wrappers/cpp/abstractapi.py b/wrappers/cpp/abstractapi.py index b2403b1ce..5b6a5cd23 100644 --- a/wrappers/cpp/abstractapi.py +++ b/wrappers/cpp/abstractapi.py @@ -423,7 +423,8 @@ class CParser(object): 'linphone_buffer_get_content', 'linphone_chat_room_send_chat_message', 'linphone_config_read_relative_file', - 'linphone_core_new_with_config'] + 'linphone_core_new_with_config', + 'linphone_vcard_get_belcard'] self.classBl = ['LinphoneImEncryptionEngine', 'LinphoneImEncryptionEngineCbs', 'LinphoneImNotifPolicy', diff --git a/wrappers/cpp/class_header.mustache b/wrappers/cpp/class_header.mustache index 2efad6547..5f63341f8 100644 --- a/wrappers/cpp/class_header.mustache +++ b/wrappers/cpp/class_header.mustache @@ -10,6 +10,9 @@ {{/internal}} {{/includes}} +{{#_class}}{{#isVcard}} +#include +{{/isVcard}}{{/_class}} {{#_class}}{{#isfactory}} #include "config.hh" {{/isfactory}}{{/_class}} @@ -50,6 +53,9 @@ namespace linphone { std::shared_ptr createCore(const std::shared_ptr & cbs, const std::string & configPath, const std::string & factoryConfigPath) const; std::shared_ptr createCoreWithConfig(const std::shared_ptr & cbs, const std::shared_ptr & config) const; {{/isfactory}} + {{#isVcard}} + std::shared_ptr &getVcard(); + {{/isVcard}} {{#methods}} {{{prototype}}} diff --git a/wrappers/cpp/class_impl.mustache b/wrappers/cpp/class_impl.mustache index ef3fcaaf2..b993397c3 100644 --- a/wrappers/cpp/class_impl.mustache +++ b/wrappers/cpp/class_impl.mustache @@ -80,6 +80,12 @@ std::shared_ptr Factory::createCoreWithConfig(const std::shared_ptr &Vcard::getVcard() { + return *(shared_ptr *)linphone_vcard_get_belcard((LinphoneVcard *)mPrivPtr); +} +{{/isVcard}} + {{#methods}} {{{implPrototype}}} { {{{sourceCode}}} diff --git a/wrappers/cpp/genheaders.py b/wrappers/cpp/genheaders.py index c40d8cddf..d00b3e5f2 100755 --- a/wrappers/cpp/genheaders.py +++ b/wrappers/cpp/genheaders.py @@ -53,6 +53,7 @@ class CppTranslator(object): classDict['ismultilistenable'] = ismultilistenable classDict['isNotListener'] = True classDict['isfactory'] = (_class.name.to_c() == 'LinphoneFactory') + classDict['isVcard'] = (_class.name.to_c() == 'LinphoneVcard') classDict['parentClassName'] = None classDict['className'] = CppTranslator.translate_class_name(_class.name) classDict['cClassName'] = '::' + _class.name.to_c()