karazeh
A cross-platform software updating library.
kzh::patcher Class Reference

#include <patcher.hpp>

+ Inheritance diagram for kzh::patcher:
+ Collaboration diagram for kzh::patcher:

Public Member Functions

 patcher (config_t const &)
 
virtual ~patcher ()
 
STAGE_RC apply_update (release_manifest const &)
 

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

Constructor & Destructor Documentation

kzh::patcher::patcher ( config_t const &  config)
explicit

Given resource manager must have the paths resolved, see downloader::resolve_paths()

kzh::patcher::~patcher ( )
virtual

Member Function Documentation

STAGE_RC kzh::patcher::apply_update ( release_manifest const &  release)
Exceptions
invalid_stateif no new releases are pending
invalid_resourceif the release manifest couldn't be DLed
missing_nodeif <release> isn't defined
missing_childrenif <release> has no operations/empty
invalid_manifestif:
  1. the release manifest is empty
  2. the release manifest has no <release> node
  3. the release manifest's <release> node has no children (operations)
missing_childif:
  1. <create> has no <source> or <target> children
  2. <delete> has no <target> child
missing_attributeif:
  1. <create>/<source> has no "checksum" or "size" attributes

Returns true if the patch was successfully applied, false otherwise.

References kzh::KARAZEH_EXPORT::cache_path, kzh::file_manager::create_directory(), kzh::logger::debug(), kzh::logger::error(), kzh::KARAZEH_EXPORT::file_manager, kzh::release_manifest::id, kzh::logger::info(), kzh::release_manifest::operations, kzh::file_manager::remove_directory(), kzh::STAGE_OK, and kzh::release_manifest::tag.

Referenced by TEST_CASE().


The documentation for this class was generated from the following files: