FC++  v0.7.2-1128
FileCatalyst Fast File Transfers - C++ Library
example004.cpp File Reference

Use a 2nd thread combined with fc::Control::getMostRecentFileStats() to display a simple progress indicator while the original thread completes a download using fc::Control::prepareSingleFile() and fc::Control::download(). More...

#include "FileCatalyst.hpp"
#include <iostream>
#include <iomanip>
#include <thread>
Include dependency graph for example004.cpp:

Functions

void example004_progress_thread (void)
 
int example004 (void)
 
int main (int argc, char *argv[])
 

Variables

const std::string username = TEST_USER
 
const std::string password = TEST_PASS
 
const std::string serverIP = TEST_SERVER
 
const fc::TransferStatsstats = NULL
 
bool showProgress = true
 

Detailed Description

Use a 2nd thread combined with fc::Control::getMostRecentFileStats() to display a simple progress indicator while the original thread completes a download using fc::Control::prepareSingleFile() and fc::Control::download().

Function Documentation

◆ example004_progress_thread()

void example004_progress_thread ( void  )

References fc::formatTimeDuration(), fc::TransferStats::payloadBytesExpected, fc::TransferStats::payloadBytesTransferred, showProgress, and fc::TransferStats::timeRemaining.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ example004()

◆ main()

int main ( int  argc,
char *  argv[] 
)

References example004().

Here is the call graph for this function:

Variable Documentation

◆ username

const std::string username = TEST_USER

◆ password

const std::string password = TEST_PASS

◆ serverIP

const std::string serverIP = TEST_SERVER

◆ stats

const fc::TransferStats* stats = NULL

◆ showProgress

bool showProgress = true