LANYINGDevelopers
Web & Mini ProgramiOSAndroidC++Server API

floo::BMXFileAttachment#

Message file attachment

#include <bmx_file_attachment.h>

Inherits from floo::BMXMessageAttachment, BMXBaseObject

Inherited by floo::BMXImageAttachment, floo::BMXVideoAttachment, floo::BMXVoiceAttachment

Public Functions#

Name
BMXFileAttachment(const std::string & path, const std::string & displayName ="")
Constructor to build the message attachment of sent file
BMXFileAttachment(const std::string & ratelUrl, const std::string & displayName, int64_t fileLength)
Constructor to build the message attachment of received file
virtual~BMXFileAttachment()
Destructor
virtual Typetype() const
Type of returned file
virtual BMXMessageAttachmentPtrclone() const
Cloning function
const std::string &path() const
Local path
const std::string &displayName() const
Display name
const std::string &ratelUrl() const
URL for remote ratel
const std::string &url() const
URL for remote
int64_tfileLength() const
File length
DownloadStatusdownloadStatus() const
Attachment download state

Protected Attributes#

Name
std::stringmPath
std::stringmDisplayName
std::stringmRatelUrl
std::stringmUrl
int64_tmFileLength
DownloadStatusmDownloadStatus

Friends#

Additional inherited members#

Public Types inherited from floo::BMXMessageAttachment

Name
enum classType { Image, Voice, Video, File, Location, Command, Forward}
Attachment type
enum classDownloadStatus { Downloaing, Successed, Failed, NotStart, Canceled}
Attachment download state

Public Functions inherited from floo::BMXMessageAttachment

Name
BMXMessageAttachment()
Constructor
virtual~BMXMessageAttachment()
Destructor

Public Functions Documentation#

function BMXFileAttachment#

BMXFileAttachment(
    const std::string & path,
    const std::string & displayName =""
)

Constructor to build the message attachment of sent file

Parameters:

  • path Local path of file
  • displayName Display name of file

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXFileAttachment",function="BMXFileAttachment" %}{% endlanying_code_snippet %}

function BMXFileAttachment#

BMXFileAttachment(
    const std::string & ratelUrl,
    const std::string & displayName,
    int64_t fileLength
)

Constructor to build the message attachment of received file

Parameters:

  • ratelUrl Address of ratel file server
  • displayName Display name of file
  • fileLength File size

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXFileAttachment",function="BMXFileAttachment" %}{% endlanying_code_snippet %}

function ~BMXFileAttachment#

inline virtual ~BMXFileAttachment()

Destructor

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXFileAttachment",function="~BMXFileAttachment" %}{% endlanying_code_snippet %}

function type#

inline virtual Type type() const

Type of returned file

Return: Type

Reimplements: floo::BMXMessageAttachment::type

Reimplemented by: floo::BMXImageAttachment::type, floo::BMXVideoAttachment::type, floo::BMXVoiceAttachment::type

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXFileAttachment",function="type" %}{% endlanying_code_snippet %}

function clone#

virtual BMXMessageAttachmentPtr clone() const

Cloning function

Return: BMXMessageAttachmentPtr

Reimplements: floo::BMXMessageAttachment::clone

Reimplemented by: floo::BMXImageAttachment::clone, floo::BMXVideoAttachment::clone, floo::BMXVoiceAttachment::clone

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXFileAttachment",function="clone" %}{% endlanying_code_snippet %}

function path#

const std::string & path() const

Local path

Return: std::string

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXFileAttachment",function="path" %}{% endlanying_code_snippet %}

function displayName#

const std::string & displayName() const

Display name

Return: std::string

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXFileAttachment",function="displayName" %}{% endlanying_code_snippet %}

function ratelUrl#

const std::string & ratelUrl() const

URL for remote ratel

Return: std::string

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXFileAttachment",function="ratelUrl" %}{% endlanying_code_snippet %}

function url#

const std::string & url() const

URL for remote

Return: std::string

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXFileAttachment",function="url" %}{% endlanying_code_snippet %}

function fileLength#

int64_t fileLength() const

File length

Return: std::string

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXFileAttachment",function="fileLength" %}{% endlanying_code_snippet %}

function downloadStatus#

DownloadStatus downloadStatus() const

Attachment download status

Return: DownloadStatus

Protected Attributes Documentation#

variable mPath#

std::string mPath;

variable mDisplayName#

std::string mDisplayName;

variable mRatelUrl#

std::string mRatelUrl;

variable mUrl#

std::string mUrl;

variable mFileLength#

int64_t mFileLength;

variable mDownloadStatus#

DownloadStatus mDownloadStatus;

Friends#

friend Encoder< BMXFileAttachment >#

friend class Encoder< BMXFileAttachment >(
    Encoder< BMXFileAttachment > 
);

friend Decoder< BMXFileAttachment >#

friend class Decoder< BMXFileAttachment >(
    Decoder< BMXFileAttachment > 
);

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXFileAttachment",function="downloadStatus" %}{% endlanying_code_snippet %}

Updated on 2022-01-26 at 17:20:40 +0800

Generated API content with concise AI notes where context helps.