Ring Daemon 16.0.0
|
#include <data_transfer.h>
Classes | |
class | Impl |
Public Member Functions | |
bool | cancel (const std::string &fileId) |
Refuse a transfer. | |
bool | info (const std::string &fileId, std::string &path, int64_t &total, int64_t &progress) const noexcept |
Get current transfer info. | |
bool | isWaiting (const std::string &fileId) const |
void | onIncomingFileTransfer (const std::string &fileId, const std::shared_ptr< dhtnet::ChannelSocket > &channel, size_t start) |
Handle incoming transfer. | |
void | onIncomingProfile (const std::shared_ptr< dhtnet::ChannelSocket > &channel, const std::string &sha3Sum="") |
std::filesystem::path | path (const std::string &fileId) const |
Retrieve path of a file. | |
std::filesystem::path | profilePath (const std::string &contactId) const |
void | transferFile (const std::shared_ptr< dhtnet::ChannelSocket > &channel, const std::string &fileId, const std::string &interactionId, const std::string &path, size_t start=0, size_t end=0, OnFinishedCb onFinished={}) |
Send a file to a channel. | |
TransferManager (const std::string &accountId, const std::string &accountUri, const std::string &to, const std::mt19937_64 &rand) | |
void | waitForTransfer (const std::string &fileId, const std::string &interactionId, const std::string &sha3sum, const std::string &path, std::size_t total) |
Inform the transfer manager that a transfer is waited (and will be automatically accepted) | |
std::vector< WaitingRequest > | waitingRequests () const |
Retrieve waiting files. | |
~TransferManager () | |
Definition at line 117 of file data_transfer.h.
jami::TransferManager::TransferManager | ( | const std::string & | accountId, |
const std::string & | accountUri, | ||
const std::string & | to, | ||
const std::mt19937_64 & | rand | ||
) |
Definition at line 326 of file data_transfer.cpp.
jami::TransferManager::~TransferManager | ( | ) |
Definition at line 333 of file data_transfer.cpp.
Refuse a transfer.
id | of the transfer |
Definition at line 375 of file data_transfer.cpp.
References JAMI_DBG.
|
noexcept |
Get current transfer info.
id | of the transfer |
total | size |
path | path of the file |
progress | current progress |
Definition at line 393 of file data_transfer.cpp.
Referenced by transferFile().
Definition at line 633 of file data_transfer.cpp.
void jami::TransferManager::onIncomingFileTransfer | ( | const std::string & | fileId, |
const std::shared_ptr< dhtnet::ChannelSocket > & | channel, | ||
size_t | start | ||
) |
Handle incoming transfer.
id | Related id |
channel | Related channel |
start | Offset in the file from which the transfer will start. |
Definition at line 446 of file data_transfer.cpp.
void jami::TransferManager::onIncomingProfile | ( | const std::shared_ptr< dhtnet::ChannelSocket > & | channel, |
const std::string & | sha3Sum = "" |
||
) |
Definition at line 521 of file data_transfer.cpp.
References jami::generateUID().
std::filesystem::path jami::TransferManager::path | ( | const std::string & | fileId | ) | const |
Retrieve path of a file.
id |
Definition at line 515 of file data_transfer.cpp.
Referenced by transferFile().
std::filesystem::path jami::TransferManager::profilePath | ( | const std::string & | contactId | ) | const |
contactId | contact's id |
Definition at line 614 of file data_transfer.cpp.
void jami::TransferManager::transferFile | ( | const std::shared_ptr< dhtnet::ChannelSocket > & | channel, |
const std::string & | fileId, | ||
const std::string & | interactionId, | ||
const std::string & | path, | ||
size_t | start = 0 , |
||
size_t | end = 0 , |
||
OnFinishedCb | onFinished = {} |
||
) |
Send a file to a channel.
channel | channel to use |
fileId | fileId of the transfer |
interactionId | interactionId of the transfer |
path | path of the file |
start | start offset |
end | end |
Definition at line 336 of file data_transfer.cpp.
References libjami::DataTransferInfo::accountId, jami::emitSignal(), info(), and path().
void jami::TransferManager::waitForTransfer | ( | const std::string & | fileId, |
const std::string & | interactionId, | ||
const std::string & | sha3sum, | ||
const std::string & | path, | ||
std::size_t | total | ||
) |
Inform the transfer manager that a transfer is waited (and will be automatically accepted)
id | of the transfer |
interactionId | linked interaction |
sha3sum | attended sha3sum |
path | where the file will be downloaded |
total | total size of the file |
Definition at line 431 of file data_transfer.cpp.
std::vector< WaitingRequest > jami::TransferManager::waitingRequests | ( | ) | const |