Horizon
Classes | Typedefs | Functions
libzip Namespace Reference

The libzip namespace. More...

Classes

class  archive
 Safe wrapper on the struct zip structure. More...
 
class  file
 File for reading. More...
 
class  stat_ptr
 Wrapper for stat as pointer. More...
 

Typedefs

typedef struct zip_stat stat
 zip_stat typedef.
 
using source_cmd = enum zip_source_cmd
 zip_source_cmd typedef.
 
using source_callback = zip_source_callback
 zip_source_cmd typedef.
 
using flags_t = zip_flags_t
 zip_flags_t typedef.
 
using int8_t = zip_int8_t
 zip_int8_t typedef.
 
using uint8_t = zip_uint8_t
 zip_uint8_t typedef.
 
using int16_t = zip_int16_t
 zip_int16_t typedef.
 
using uint16_t = zip_uint16_t
 zip_uint16_t typedef.
 
using int32_t = zip_int32_t
 zip_int32_t typedef.
 
using uint32_t = zip_uint32_t
 zip_uint32_t typedef.
 
using int64_t = zip_int64_t
 zip_int64_t typedef.
 
using uint64_t = zip_uint64_t
 zip_uint64_t_t typedef.
 
using source = std::function< struct zip_source *(struct zip *)>
 Source creation for adding files. More...
 

Functions

source source_buffer (std::string data) noexcept
 Add a file to the archive using a binary buffer. More...
 
source source_file (std::string path, uint64_t start=0, int64_t length=-1) noexcept
 Add a file to the archive from the disk. More...
 

Detailed Description

The libzip namespace.

Typedef Documentation

◆ source

typedef std::function< struct zip_source *(struct zip *)> libzip::source

Source creation for adding files.

This function must be passed through archive::add, it will be called to create the appropriate zip_source * inside the function.

The user should not call the function itself as it's the responsability of libzip to destroy the zip_source structure.

See also
source::buffer
source::file

Function Documentation

◆ source_buffer()

source libzip::source_buffer ( std::string  data)
inlinenoexcept

Add a file to the archive using a binary buffer.

Parameters
datathe buffer
Returns
the source to add

◆ source_file()

source libzip::source_file ( std::string  path,
uint64_t  start = 0,
int64_t  length = -1 
)
inlinenoexcept

Add a file to the archive from the disk.

Parameters
paththe path to the file
startthe position where to start
lengththe number of bytes to copy
Returns
the source to add