giga::core::FileUploader Class Referencefinal
#include <FileUploader.h>
Inheritance diagram for giga::core::FileUploader:
Public Member Functions | |
FileUploader (const boost::filesystem::path &filename, const utility::string_t &nodeName, const std::string &parentId, const std::string &sha1, const std::string &fid, const std::string &fkey, const Application &app, pplx::cancellation_token_source cts=pplx::cancellation_token_source{}) | |
FileUploader (FileUploader &&)=delete | |
FileUploader & | operator= (const FileUploader &)=delete |
FileUploader (const FileUploader &)=delete | |
const pplx::task < std::shared_ptr< Node > > & | task () const |
Gets the task managing the upload process. Make sure you have started the upload before calling this method. More... | |
FileTransferer::Progress | progress () const override |
Gets this upload progress. | |
const utility::string_t & | nodeName () const |
const boost::filesystem::path & | filename () const override |
uint64_t | fileSize () const |
Public Member Functions inherited from giga::core::FileTransferer | |
FileTransferer (pplx::cancellation_token_source cts) | |
FileTransferer (FileTransferer &&other) | |
FileTransferer (const FileTransferer &)=delete | |
FileTransferer & | operator= (const FileTransferer &)=delete |
FileTransferer & | operator= (FileTransferer &&)=delete |
void | start () |
Start a transfer. | |
void | pause () |
Pause the current transfer (see resume() ) | |
void | resume () |
Resume the current transfer (see pause() ) | |
void | cancel () |
Cancel a started upload. The task managing the transfer will most probably throw an exception. | |
void | setError (const std::string &error) |
State | state () const |
void | limitRate (uint64_t rate) |
Limit the rate of the transfer. More... | |
Protected Member Functions | |
void | doStart () override |
Additional Inherited Members | |
Public Types inherited from giga::core::FileTransferer | |
enum | State { pending, started, paused, canceled, error } |
Protected Attributes inherited from giga::core::FileTransferer | |
State | _state |
std::unique_ptr < details::CurlProgress > | _progress |
std::mutex | _mut |
pplx::cancellation_token_source | _cts |
utility::string_t | _error |
Detailed Description
Upload a file.
REMEMBER: Before uploading a file, we need to calculate its sha1. It is a long running process, that we call the preparing phase.
After the preparing phase, we test to see if the file already exists in GiGa.GG. If it does, the uploading process is skipped (we use the one already in GiGa.GG)
Member Function Documentation
const pplx::task< std::shared_ptr< Node > > & giga::core::FileUploader::task | ( | ) | const |
Gets the task managing the upload process. Make sure you have started the upload before calling this method.
The documentation for this class was generated from the following files:
- /home/thomas/code/GiGaSdk/src/giga/core/FileUploader.h
- /home/thomas/code/GiGaSdk/src/giga/core/FileUploader.cpp