Liblinphone
5.3.0
|
This object holds data that can be embedded in a signaling message. More...
#include <content.hh>
Public Member Functions | |
LINPHONECXX_PUBLIC | Content (void *ptr, bool takeRef=true) |
LINPHONECXX_PUBLIC _LinphoneContent * | cPtr () |
LINPHONECXX_PUBLIC const uint8_t * | getBuffer () const |
Get the content data buffer, usually a string. More... | |
LINPHONECXX_PUBLIC std::string | getDisposition () const |
Get the disposition of the Content, for example "recipient-list". More... | |
LINPHONECXX_PUBLIC void | setDisposition (const std::string &disposition) |
Set the disposition of the Content, for example "recipient-list". More... | |
LINPHONECXX_PUBLIC std::string | getEncoding () const |
Get the encoding of the data buffer, for example "gzip". More... | |
LINPHONECXX_PUBLIC void | setEncoding (const std::string &encoding) |
Set the encoding of the data buffer, for example "gzip". More... | |
LINPHONECXX_PUBLIC int | getFileDuration () |
Gets the file duration in seconds, if information is available. | |
LINPHONECXX_PUBLIC std::string | getFilePath () const |
Get the file transfer filepath set for this content (replace linphone_chat_message_get_file_transfer_filepath). More... | |
LINPHONECXX_PUBLIC void | setFilePath (const std::string &filePath) |
Set the file transfer filepath for this content (replace linphone_chat_message_set_file_transfer_filepath). More... | |
LINPHONECXX_PUBLIC size_t | getFileSize () const |
Get the file size if content is either a FileContent or a FileTransferContent. More... | |
LINPHONECXX_PUBLIC bool | isFile () const |
Tells whether or not this content contains a file. More... | |
LINPHONECXX_PUBLIC bool | isFileEncrypted () const |
Tells whether or not this content contains an encrypted file. More... | |
LINPHONECXX_PUBLIC bool | isFileTransfer () const |
Tells whether or not this content is a file transfer. More... | |
LINPHONECXX_PUBLIC bool | isIcalendar () const |
Tells whether or not this content contains an icalendar by checking it's content type. More... | |
LINPHONECXX_PUBLIC bool | isMultipart () const |
Tell whether a content is a multipart content. More... | |
LINPHONECXX_PUBLIC bool | isText () const |
Tells whether or not this content contains text. More... | |
LINPHONECXX_PUBLIC bool | isVoiceRecording () const |
Tells whether or not this content contains a voice recording by checking it's content type. More... | |
LINPHONECXX_PUBLIC std::string | getKey () const |
Get the key associated with a RCS file transfer message if encrypted. More... | |
LINPHONECXX_PUBLIC size_t | getKeySize () const |
Get the size of key associated with a RCS file transfer message if encrypted. More... | |
LINPHONECXX_PUBLIC std::string | getName () const |
Get the name associated with a RCS file transfer message. More... | |
LINPHONECXX_PUBLIC void | setName (const std::string &name) |
Set the name associated with a RCS file transfer message. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::Content > > | getParts () const |
Get all the parts from a multipart content. More... | |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::string | getPlainFilePath () const |
Generates a temporary plain copy of the file and returns its paths The caller is responsible to then delete this temporary copy and the returned string. More... | |
LINPHONECXX_PUBLIC size_t | getSize () const |
Get the content data buffer size, excluding null character despite null character is always set for convenience. More... | |
LINPHONECXX_PUBLIC void | setSize (size_t size) |
Set the content data size, excluding null character despite null character is always set for convenience. More... | |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::string | getStringBuffer () const |
Get the string content data buffer. More... | |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED void | setStringBuffer (const std::string &buffer) |
Set the string content data buffer. More... | |
LINPHONECXX_PUBLIC std::string | getSubtype () const |
Get the mime subtype of the content data. More... | |
LINPHONECXX_PUBLIC void | setSubtype (const std::string &subtype) |
Set the mime subtype of the content data. More... | |
LINPHONECXX_PUBLIC std::string | getType () const |
Get the mime type of the content data. More... | |
LINPHONECXX_PUBLIC void | setType (const std::string &type) |
Set the mime type of the content data. More... | |
LINPHONECXX_PUBLIC std::string | getUtf8Text () const |
Get the string content data buffer. More... | |
LINPHONECXX_PUBLIC void | setUtf8Text (const std::string &buffer) |
Get the string content data buffer. More... | |
LINPHONECXX_PUBLIC void | addContentTypeParameter (const std::string &name, const std::string &value) |
Adds a parameter to the ContentType header. More... | |
LINPHONECXX_PUBLIC void | addCustomHeader (const std::string &headerName, const std::string &headerValue) |
Adds a custom header in a content. More... | |
LINPHONECXX_PUBLIC std::string | exportPlainFile () const |
Generates a temporary plain copy of the file and returns its paths The caller is responsible to then delete this temporary copy and the returned string. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Content > | findPartByHeader (const std::string &headerName, const std::string &headerValue) const |
Find a part from a multipart content looking for a part header with a specified value. More... | |
LINPHONECXX_PUBLIC std::string | getCustomHeader (const std::string &headerName) const |
Get a custom header value of a content. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Content > | getPart (int index) const |
Get a part from a multipart content according to its index. More... | |
LINPHONECXX_PUBLIC void | setBuffer (const uint8_t *buffer, size_t size) |
Set the content data buffer, usually a string. More... | |
LINPHONECXX_PUBLIC void | setKey (const std::string &key, const size_t keyLength) |
Set the key associated with a RCS file transfer message if encrypted. More... | |
This object holds data that can be embedded in a signaling message.
Use Core::createContent() to create it, and then you should set at least it's type and subtype and fill the buffer with your data. A Content can be multipart (contain other contents), have file information (name, path, size), be encrypted, have custom headers, etc... It is mainly used to send information through a ChatMessage.
LINPHONECXX_PUBLIC void linphone::Content::addContentTypeParameter | ( | const std::string & | name, |
const std::string & | value | ||
) |
Adds a parameter to the ContentType header.
name | the name of the parameter to add. |
value | the value of the parameter to add. |
LINPHONECXX_PUBLIC void linphone::Content::addCustomHeader | ( | const std::string & | headerName, |
const std::string & | headerValue | ||
) |
Adds a custom header in a content.
headerName | The name of the header to add. |
headerValue | The value of the header to add. |
LINPHONECXX_PUBLIC std::string linphone::Content::exportPlainFile | ( | ) | const |
Generates a temporary plain copy of the file and returns its paths The caller is responsible to then delete this temporary copy and the returned string.
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Content> linphone::Content::findPartByHeader | ( | const std::string & | headerName, |
const std::string & | headerValue | ||
) | const |
Find a part from a multipart content looking for a part header with a specified value.
headerName | The name of the header to look for. |
headerValue | The value of the header to look for. |
LINPHONECXX_PUBLIC const uint8_t* linphone::Content::getBuffer | ( | ) | const |
Get the content data buffer, usually a string.
LINPHONECXX_PUBLIC std::string linphone::Content::getCustomHeader | ( | const std::string & | headerName | ) | const |
Get a custom header value of a content.
headerName | The name of the header to get the value from. |
LINPHONECXX_PUBLIC std::string linphone::Content::getDisposition | ( | ) | const |
LINPHONECXX_PUBLIC std::string linphone::Content::getEncoding | ( | ) | const |
Get the encoding of the data buffer, for example "gzip".
LINPHONECXX_PUBLIC std::string linphone::Content::getFilePath | ( | ) | const |
Get the file transfer filepath set for this content (replace linphone_chat_message_get_file_transfer_filepath).
LINPHONECXX_PUBLIC size_t linphone::Content::getFileSize | ( | ) | const |
Get the file size if content is either a FileContent or a FileTransferContent.
LINPHONECXX_PUBLIC std::string linphone::Content::getKey | ( | ) | const |
Get the key associated with a RCS file transfer message if encrypted.
LINPHONECXX_PUBLIC size_t linphone::Content::getKeySize | ( | ) | const |
Get the size of key associated with a RCS file transfer message if encrypted.
LINPHONECXX_PUBLIC std::string linphone::Content::getName | ( | ) | const |
Get the name associated with a RCS file transfer message.
It is used to store the original filename of the file to be downloaded from server.
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Content> linphone::Content::getPart | ( | int | index | ) | const |
Get a part from a multipart content according to its index.
index | The index of the part to get. |
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::Content> > linphone::Content::getParts | ( | ) | const |
Get all the parts from a multipart content.
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::string linphone::Content::getPlainFilePath | ( | ) | const |
Generates a temporary plain copy of the file and returns its paths The caller is responsible to then delete this temporary copy and the returned string.
LINPHONECXX_PUBLIC size_t linphone::Content::getSize | ( | ) | const |
Get the content data buffer size, excluding null character despite null character is always set for convenience.
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::string linphone::Content::getStringBuffer | ( | ) | const |
Get the string content data buffer.
LINPHONECXX_PUBLIC std::string linphone::Content::getSubtype | ( | ) | const |
Get the mime subtype of the content data.
LINPHONECXX_PUBLIC std::string linphone::Content::getType | ( | ) | const |
Get the mime type of the content data.
LINPHONECXX_PUBLIC std::string linphone::Content::getUtf8Text | ( | ) | const |
Get the string content data buffer.
Introduced in 01/07/2020
LINPHONECXX_PUBLIC bool linphone::Content::isFile | ( | ) | const |
Tells whether or not this content contains a file.
LINPHONECXX_PUBLIC bool linphone::Content::isFileEncrypted | ( | ) | const |
Tells whether or not this content contains an encrypted file.
LINPHONECXX_PUBLIC bool linphone::Content::isFileTransfer | ( | ) | const |
Tells whether or not this content is a file transfer.
LINPHONECXX_PUBLIC bool linphone::Content::isIcalendar | ( | ) | const |
Tells whether or not this content contains an icalendar by checking it's content type.
LINPHONECXX_PUBLIC bool linphone::Content::isMultipart | ( | ) | const |
Tell whether a content is a multipart content.
LINPHONECXX_PUBLIC bool linphone::Content::isText | ( | ) | const |
Tells whether or not this content contains text.
LINPHONECXX_PUBLIC bool linphone::Content::isVoiceRecording | ( | ) | const |
Tells whether or not this content contains a voice recording by checking it's content type.
LINPHONECXX_PUBLIC void linphone::Content::setBuffer | ( | const uint8_t * | buffer, |
size_t | size | ||
) |
Set the content data buffer, usually a string.
buffer | The content data buffer. |
size | The size of the content data buffer. |
LINPHONECXX_PUBLIC void linphone::Content::setDisposition | ( | const std::string & | disposition | ) |
LINPHONECXX_PUBLIC void linphone::Content::setEncoding | ( | const std::string & | encoding | ) |
Set the encoding of the data buffer, for example "gzip".
encoding | The encoding of the data buffer. |
LINPHONECXX_PUBLIC void linphone::Content::setFilePath | ( | const std::string & | filePath | ) |
Set the file transfer filepath for this content (replace linphone_chat_message_set_file_transfer_filepath).
filePath | the file transfer filepath. |
LINPHONECXX_PUBLIC void linphone::Content::setKey | ( | const std::string & | key, |
const size_t | keyLength | ||
) |
Set the key associated with a RCS file transfer message if encrypted.
key | The key to be used to encrypt/decrypt file associated to this content. |
keyLength | The lengh of the key. |
LINPHONECXX_PUBLIC void linphone::Content::setName | ( | const std::string & | name | ) |
Set the name associated with a RCS file transfer message.
It is used to store the original filename of the file to be downloaded from server.
name | The name of the content. |
LINPHONECXX_PUBLIC void linphone::Content::setSize | ( | size_t | size | ) |
Set the content data size, excluding null character despite null character is always set for convenience.
size | The content data buffer size. |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED void linphone::Content::setStringBuffer | ( | const std::string & | buffer | ) |
Set the string content data buffer.
buffer | The string content data buffer in UTF8. |
LINPHONECXX_PUBLIC void linphone::Content::setSubtype | ( | const std::string & | subtype | ) |
Set the mime subtype of the content data.
subtype | The mime subtype of the content data, for example "html". |
LINPHONECXX_PUBLIC void linphone::Content::setType | ( | const std::string & | type | ) |
Set the mime type of the content data.
type | The mime type of the content data, for example "application". |
LINPHONECXX_PUBLIC void linphone::Content::setUtf8Text | ( | const std::string & | buffer | ) |
Get the string content data buffer.
Introduced in 01/07/2020
buffer | The string content data buffer in UTF8. |