Skip to main content

api::ProgressCallback

Types

callback_t#

typedef bool(* api::ProgressCallback::callback_t) (void *, int, int) )(void *, int, int)

Type: bool(*

Details#

Defines the callback function prototype.The function has three arguments. The first is the context() member of this object. The first integer is the current progress value and the second is the total progress value.If the total (third argument) is zero, the operation is either complete or aborted. If total is set to -1, the progress should be shown as indeterminate.

Functions

ProgressCallback()#

api::ProgressCallback::ProgressCallback ()

update(int value, int total) const#

bool api::ProgressCallback::update (int value, int total) const

Type: bool

Parameters:

  • int value
  • int total

Details#

Executes the callback if it is valid.This method is called within operations in order to execute the provided callback.

Returns:

true to abort the operation or false to continue as normal

Static Functions

indeterminate_progress_total()#

inline

static int api::ProgressCallback::indeterminate_progress_total ()

Type: int

update_function(const void *context, int value, int total)#

static int api::ProgressCallback::update_function (const void *context, int value, int total)

Type: int

Parameters:

Details

The ProgressCallback class is used by various methods to allow the application to update the progress of an operation.

#include <sys.hpp>#include <inet.hpp>Printer p;
p.set_progress_key("downloading");HttpClient http_client;DataFile data_file(File::APPEND);
//download file to data_file and print the progress using #'shttp_client.get("http://some.url/file", data_file, p.progress_callback());