api::ProgressCallback
Types
#
callback_ttypedef bool(* api::ProgressCallback::callback_t) (void *, int, int) )(void *, int, int)
Type: bool(*
#
DetailsDefines 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) constbool api::ProgressCallback::update (int value, int total) const
Type: bool
Parameters:
int
value
int
total
#
DetailsExecutes 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:
const void *
context
int
value
int
total
ProgressCallback Class.
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());