LibPkg
|
A class for updating the package database. More...
#include <update.h>
Classes | |
struct | progress |
A structure for monitoring the progress of one source. More... | |
Public Types | |
enum | state_type { state_srclist, state_download, state_build_sources, state_build_local, state_done, state_fail } |
An enumeration for describing the state of the update operation. More... | |
typedef unsigned long long | size_type |
A type for representing byte counts. More... | |
Public Member Functions | |
update (pkgbase &pb) | |
Construct update operation. More... | |
virtual | ~update () |
Destroy update operation. More... | |
state_type | state () const |
Get current state. More... | |
size_type | bytes_done () const |
Get number of bytes downloaded. More... | |
size_type | bytes_total () const |
Get total number of bytes to download. More... | |
string | message () const |
Get error message. More... | |
void | log_to (log *use_log) |
Set the log to add to. More... | |
void | download_options (const download::options &opts) |
Set extra options used for the downloading of the package lists. More... | |
![]() | |
thread () | |
Construct thread. More... | |
virtual | ~thread () |
Destroy thread. More... | |
Static Public Attributes | |
static const size_type | npos =static_cast<size_type>(-1) |
A null value for use in place of a byte count. More... | |
Protected Member Functions | |
void | poll () |
Poll this thread. More... | |
Additional Inherited Members | |
![]() | |
static void | poll_all () |
Poll all threads. More... | |
A class for updating the package database.
Control files from remote sources take precedence over local packages because they contain more information (such as the download URL).
typedef unsigned long long pkg::update::size_type |
A type for representing byte counts.
An enumeration for describing the state of the update operation.
pkg::update::update | ( | pkgbase & | pb | ) |
Construct update operation.
pb | the package database |
|
virtual |
Destroy update operation.
|
inline |
Get current state.
|
inline |
Get number of bytes downloaded.
|
inline |
Get total number of bytes to download.
|
inline |
Get error message.
When state()==state_fail, this function returns a human-readable description of what went wrong.
References download_options(), log_to(), and poll().
void pkg::update::log_to | ( | log * | use_log | ) |
void pkg::update::download_options | ( | const download::options & | opts | ) |
Set extra options used for the downloading of the package lists.
Referenced by message().
|
protectedvirtual |
Poll this thread.
This function will be called repeatedly until the thread ceases to exist. The amount of work done per invokation should be kept small, in order that multithreading (within the application) and multitasking (across RISC OS as a whole) operate smoothly.
Reimplemented from pkg::thread.
References pkg::pkgbase::available_pathname(), pkg::source_table::begin(), pkg::status_table::begin(), pkg::download::bytes_done(), pkg::update::progress::bytes_done, pkg::download::bytes_total(), pkg::update::progress::bytes_total, pkg::pkgbase::control(), pkg::pkgbase::curstat(), pkg::status_table::end(), pkg::source_table::end(), pkg::pkgbase::info_pathname(), pkg::pkgbase::list_pathname(), pkg::LOG_ERROR_SOURCE_DOWNLOAD_FAILED, pkg::LOG_ERROR_UPDATE_EXCEPTION, pkg::LOG_INFO_ADD_LOCAL, pkg::LOG_INFO_ADDING_AVAILABLE, pkg::LOG_INFO_AVAILABLE_ADDED, pkg::LOG_INFO_DOWNLOADED_SOURCE, pkg::LOG_INFO_DOWNLOADED_SOURCES, pkg::LOG_INFO_DOWNLOADING_SOURCE, pkg::LOG_INFO_DOWNLOADING_SOURCES, pkg::LOG_INFO_READ_SOURCES, pkg::LOG_INFO_UPDATE_DONE, pkg::LOG_INFO_UPDATING_DATABASE, pkg::download::message(), pkg::log::message(), npos, pkg::object_length(), pkg::object_type(), pkg::pkgbase::sources(), pkg::download::state(), state_build_local, state_build_sources, pkg::download::state_done, state_done, pkg::download::state_download, state_download, pkg::download::state_fail, state_fail, state_srclist, pkg::source_table::update(), pkg::binary_control_table::update(), and pkg::version::version().
Referenced by message().
A null value for use in place of a byte count.
Referenced by poll().
Reference Manual | LibPkg | Version 0.9.0 (4 Sep 2020) |