karazeh
A cross-platform software updating library.
kzh Namespace Reference

Classes

class  create_operation
 
class  delete_operation
 
class  delta_encoder
 librsync implementation of delta encoding, used in rdiff. More...
 
struct  download_t
 
class  downloader
 
class  file_manager
 
class  hasher
 
class  invalid_manifest
 
class  invalid_resource
 
class  invalid_state
 
struct  KARAZEH_EXPORT
 
class  logger
 
struct  logstream
 
class  manifest_error
 
class  md5_hasher
 
class  operation
 
class  patcher
 
class  path_resolver
 
struct  release_manifest
 
class  update_operation
 
class  version_manifest
 

Typedefs

typedef struct kzh::KARAZEH_EXPORT config_t
 
typedef file_manager file_manager_t
 
typedef hasher hasher_t
 
typedef string_t identity_t
 
typedef json11::Json JSON
 
typedef boost::filesystem::path path_t
 
typedef std::string string_t
 
typedef unsigned long uint64_t
 

Enumerations

enum  STAGE_RC {
  STAGE_OK = 0, STAGE_UNAUTHORIZED, STAGE_OUT_OF_SPACE, STAGE_FILE_EXISTS,
  STAGE_FILE_MISSING, STAGE_FILE_INTEGRITY_MISMATCH, STAGE_INTERNAL_ERROR
}
 

Functions

static path_t locate_bin_directory (const logger *, bool verbose)
 
static path_t locate_root_directory (const path_t &)
 
static size_t on_curl_data (char *buffer, size_t size, size_t nmemb, void *userdata)
 

Variables

static size_t block_len = RS_DEFAULT_BLOCK_LEN
 
static char levels [] = { 'D','I','N','W','E','A','C' }
 
static const JSON::shape SCHEMA_CREATE_OPERATION
 
static const JSON::shape SCHEMA_CREATE_OPERATION_SOURCE
 
static const JSON::shape SCHEMA_DELETE_OPERATION
 
static const JSON::shape SCHEMA_IDENTITY_LIST
 
static const JSON::shape SCHEMA_RELEASE
 
static const JSON::shape SCHEMA_UPDATE_OPERATION
 
static const JSON::shape SCHEMA_UPDATE_OPERATION_BASIS
 
static const JSON::shape SCHEMA_UPDATE_OPERATION_DELTA
 
static size_t strong_len = RS_MAX_STRONG_SUM_LENGTH
 
static char threshold = 'D'
 
static const auto validate_schema
 

Detailed Description

karazeh – the library for patching software

Copyright (C) 2011-2016 by Ahmad Amireh ahmad.nosp@m.@ami.nosp@m.reh.n.nosp@m.et

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Typedef Documentation

typedef json11::Json kzh::JSON
typedef boost::filesystem::path kzh::path_t
typedef std::string kzh::string_t
typedef unsigned long kzh::uint64_t

Enumeration Type Documentation

Enumerator
STAGE_OK 
STAGE_UNAUTHORIZED 

Running user lacks the required permission to read/write

STAGE_OUT_OF_SPACE 

Not enough free space to hold a file to be downloaded

STAGE_FILE_EXISTS 

Destination at which a file is to be created or moved is occupied

STAGE_FILE_MISSING 

A file to be updated, renamed, or deleted is missing

STAGE_FILE_INTEGRITY_MISMATCH 

Checksum of a file to be updated does not match the expected checksum

STAGE_INTERNAL_ERROR 

Probably a Karazeh bug

Function Documentation

path_t kzh::locate_bin_directory ( const logger log,
bool  verbose 
)
static
path_t kzh::locate_root_directory ( const path_t bin_path)
static
static size_t kzh::on_curl_data ( char *  buffer,
size_t  size,
size_t  nmemb,
void *  userdata 
)
static

Variable Documentation

size_t kzh::block_len = RS_DEFAULT_BLOCK_LEN
static
char kzh::levels[] = { 'D','I','N','W','E','A','C' }
static
const JSON::shape kzh::SCHEMA_CREATE_OPERATION
static
Initial value:
= {
{ "source", JSON::OBJECT },
{ "destination", JSON::STRING },
}
const JSON::shape kzh::SCHEMA_CREATE_OPERATION_SOURCE
static
Initial value:
= {
{ "url", JSON::STRING },
{ "checksum", JSON::STRING },
{ "size", JSON::NUMBER },
}
const JSON::shape kzh::SCHEMA_DELETE_OPERATION
static
Initial value:
= {
{ "target", JSON::STRING },
}
const JSON::shape kzh::SCHEMA_IDENTITY_LIST
static
Initial value:
= {
{ "name", JSON::STRING },
{ "files", JSON::ARRAY },
}
const JSON::shape kzh::SCHEMA_RELEASE
static
Initial value:
= {
{ "id", JSON::STRING },
{ "identity", JSON::STRING },
}
const JSON::shape kzh::SCHEMA_UPDATE_OPERATION
static
Initial value:
= {
{ "basis", JSON::OBJECT },
{ "delta", JSON::OBJECT },
}
const JSON::shape kzh::SCHEMA_UPDATE_OPERATION_BASIS
static
Initial value:
= {
{ "pre_checksum", JSON::STRING },
{ "post_checksum", JSON::STRING },
{ "filepath", JSON::STRING },
}
const JSON::shape kzh::SCHEMA_UPDATE_OPERATION_DELTA
static
Initial value:
= {
{ "checksum", JSON::STRING },
{ "size", JSON::NUMBER },
{ "url", JSON::STRING },
}
size_t kzh::strong_len = RS_MAX_STRONG_SUM_LENGTH
static
char kzh::threshold = 'D'
static
const auto kzh::validate_schema
static
Initial value:
= [](JSON const& node, JSON::shape const& schema) -> void {
string_t schema_error;
if (!node.has_shape(schema, schema_error)) {
throw invalid_manifest("Malformed entity: " + schema_error);
}
}
json11::Json JSON
Definition: version_manifest.hpp:40
std::string string_t
Definition: karazeh.hpp:55

Referenced by kzh::version_manifest::get_available_updates(), and kzh::version_manifest::parse().