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 Type | type() const Type of returned file |
virtual BMXMessageAttachmentPtr | clone() 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_t | fileLength() const File length |
DownloadStatus | downloadStatus() const Attachment download state |
Protected Attributes
Name | |
---|---|
std::string | mPath |
std::string | mDisplayName |
std::string | mRatelUrl |
std::string | mUrl |
int64_t | mFileLength |
DownloadStatus | mDownloadStatus |
Friends
Name | |
---|---|
class | Encoder< BMXFileAttachment > |
class | Decoder< BMXFileAttachment > |
Additional inherited members
Public Types inherited from floo::BMXMessageAttachment
Name | |
---|---|
enum class | Type { Image, Voice, Video, File, Location, Command, Forward} Attachment type |
enum class | DownloadStatus { 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:
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:
function ~BMXFileAttachment
inline virtual ~BMXFileAttachment()
Destructor
Example:
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:
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:
function path
const std::string & path() const
Local path
Return: std::string
Example:
function displayName
const std::string & displayName() const
Display name
Return: std::string
Example:
function ratelUrl
const std::string & ratelUrl() const
URL for remote ratel
Return: std::string
Example:
function url
const std::string & url() const
URL for remote
Return: std::string
Example:
function fileLength
int64_t fileLength() const
File length
Return: std::string
Example:
function downloadStatus
DownloadStatus downloadStatus() const
Attachment download state
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:
Updated on 2022-01-26 at 17:20:40 +0800