karazeh
A cross-platform software updating library.
|
#include <update.hpp>
Public Member Functions | |
update_operation (config_t const &, release_manifest const &) | |
virtual | ~update_operation () |
virtual void | commit () |
virtual STAGE_RC | deploy () |
virtual void | rollback () |
virtual STAGE_RC | stage () |
virtual string_t | tostring () |
Public Member Functions inherited from kzh::operation | |
operation (config_t const &config, release_manifest const &rm) | |
virtual | ~operation () |
Public Attributes | |
string_t | basis |
string_t | basis_checksum |
uint64_t | basis_length |
string_t | delta |
string_t | delta_checksum |
uint64_t | delta_length |
string_t | patched_checksum |
uint64_t | patched_length |
Additional Inherited Members | |
Protected Member Functions inherited from kzh::logger | |
void | rename_context (string_t const &) |
logger (string_t context) | |
virtual | ~logger () |
logstream | alert () const |
logstream | crit () const |
logstream | debug () const |
logstream | error () const |
logstream | info () const |
logstream | notice () const |
logstream | plain () const |
void | set_uuid_prefix (string_t const &) |
string_t const & | uuid_prefix () const |
logstream | warn () const |
Static Protected Member Functions inherited from kzh::logger | |
static void | deindent () |
static void | enable_timestamps (bool on_or_off) |
static void | indent () |
static void | mute () |
static void | set_app_name (string_t const &app_name) |
static void | set_stream (std::ostream *) |
static void | set_threshold (char level) |
static void | unmute () |
Protected Attributes inherited from kzh::operation | |
config_t const & | config_ |
release_manifest const & | rm_ |
kzh::update_operation::update_operation | ( | config_t const & | config, |
release_manifest const & | rm | ||
) |
|
virtual |
|
virtual |
Removes the delta patch file and the cached source.
Reimplemented from kzh::operation.
References kzh::operation::config_, kzh::file_manager::exists(), kzh::KARAZEH_EXPORT::file_manager, and kzh::file_manager::remove_file().
|
virtual |
Applies the delta patch on a clone of the source, then swaps the source into the cache with the patched version.
Implements kzh::operation.
References kzh::operation::config_, kzh::logger::debug(), kzh::hasher::digest_rc::digest, kzh::logger::error(), kzh::KARAZEH_EXPORT::file_manager, kzh::KARAZEH_EXPORT::hasher, kzh::hasher::hex_digest(), kzh::file_manager::move(), kzh::delta_encoder::patch(), patched_checksum, patched_length, kzh::STAGE_FILE_INTEGRITY_MISMATCH, kzh::STAGE_INTERNAL_ERROR, kzh::STAGE_OK, and kzh::file_manager::stat_filesize().
|
virtual |
Swaps the (now-cached) original source with the patched one.
Implements kzh::operation.
References kzh::operation::config_, kzh::file_manager::exists(), kzh::KARAZEH_EXPORT::file_manager, kzh::file_manager::move(), and kzh::file_manager::remove_file().
|
virtual |
Verifies the source's existence and its integrity, then computes the source's signature, and downloads the delta file.
Returns STAGE_OK on success, otherwise an error indicated by the return code, see karazeh/operation.hpp for a complete listing.
Implements kzh::operation.
References basis, basis_checksum, basis_length, kzh::KARAZEH_EXPORT::cache_path, kzh::operation::config_, kzh::file_manager::create_directory(), kzh::logger::debug(), delta, delta_checksum, delta_length, kzh::hasher::digest_rc::digest, kzh::KARAZEH_EXPORT::downloader, kzh::logger::error(), kzh::downloader::fetch(), kzh::KARAZEH_EXPORT::file_manager, kzh::KARAZEH_EXPORT::hasher, kzh::hasher::hex_digest(), kzh::release_manifest::id, kzh::file_manager::is_directory(), kzh::file_manager::is_readable(), kzh::operation::rm_, kzh::KARAZEH_EXPORT::root_path, kzh::delta_encoder::signature(), kzh::STAGE_FILE_INTEGRITY_MISMATCH, kzh::STAGE_FILE_MISSING, kzh::STAGE_INTERNAL_ERROR, kzh::STAGE_OK, kzh::STAGE_UNAUTHORIZED, and kzh::file_manager::stat_filesize().
|
virtual |
Used internally for exceptions and logging
Reimplemented from kzh::operation.
string_t kzh::update_operation::basis |
Referenced by stage(), and tostring().
string_t kzh::update_operation::delta |
Referenced by stage(), and tostring().