FC++  v0.9.0-9e9b65
FileCatalyst Fast File Transfers - C++ Library
example004.cpp File Reference
#include "FileCatalyst.hpp"
#include <iostream>
#include <iomanip>
#include <thread>
Include dependency graph for example004.cpp:


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


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 ( )

References fc::formatTimeDuration(), fc::TransferStats::payloadBytesExpected, fc::TransferStats::payloadBytesTransferred, showProgress, stats, 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