Commit 17c5372c authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Add API to set/get a LinphoneContent data with a string type.

parent 3cb94ab1
No related merge requests found
Showing with 25 additions and 1 deletion
...@@ -115,6 +115,15 @@ void linphone_content_set_buffer(LinphoneContent *content, const void *buffer, s ...@@ -115,6 +115,15 @@ void linphone_content_set_buffer(LinphoneContent *content, const void *buffer, s
((char *)content->lcp.data)[size] = '\0'; ((char *)content->lcp.data)[size] = '\0';
} }
char * linphone_content_get_string_buffer(const LinphoneContent *content) {
return (char *)content->lcp.data;
}
void linphone_content_set_string_buffer(LinphoneContent *content, const char *buffer) {
content->lcp.size = strlen(buffer);
content->lcp.data = belle_sip_strdup(buffer);
}
size_t linphone_content_get_size(const LinphoneContent *content) { size_t linphone_content_get_size(const LinphoneContent *content) {
return content->lcp.size; return content->lcp.size;
} }
......
...@@ -155,10 +155,25 @@ LINPHONE_PUBLIC void * linphone_content_get_buffer(const LinphoneContent *conten ...@@ -155,10 +155,25 @@ LINPHONE_PUBLIC void * linphone_content_get_buffer(const LinphoneContent *conten
/** /**
* Set the content data buffer, usually a string. * Set the content data buffer, usually a string.
* @param[in] content LinphoneContent object. * @param[in] content LinphoneContent object.
* @param[in] data The content data buffer. * @param[in] buffer The content data buffer.
* @param[in] size The size of the content data buffer.
*/ */
LINPHONE_PUBLIC void linphone_content_set_buffer(LinphoneContent *content, const void *buffer, size_t size); LINPHONE_PUBLIC void linphone_content_set_buffer(LinphoneContent *content, const void *buffer, size_t size);
/**
* Get the string content data buffer.
* @param[in] content LinphoneContent object
* @return The string content data buffer.
*/
LINPHONE_PUBLIC char * linphone_content_get_string_buffer(const LinphoneContent *content);
/**
* Set the string content data buffer.
* @param[in] content LinphoneContent object.
* @param[in] buffer The string content data buffer.
*/
LINPHONE_PUBLIC void linphone_content_set_string_buffer(LinphoneContent *content, const char *buffer);
/** /**
* Get the content data buffer size, excluding null character despite null character is always set for convenience. * Get the content data buffer size, excluding null character despite null character is always set for convenience.
* @param[in] content LinphoneContent object. * @param[in] content LinphoneContent object.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment