libzypp: zypp-curl/ng/network/zckhelper.h Source File

libzypp 17.36.6

zckhelper.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8----------------------------------------------------------------------/
9*
10* This file contains private API, this might break at any time between releases.
11* You have been warned!
12*
13*/
14#ifndef ZYPPNG_CURL_ZCKHELPER_H_INCLUDED
15#define ZYPPNG_CURL_ZCKHELPER_H_INCLUDED
16
17#include <zypp-curl/ng/network/curlmultiparthandler.h>
18#include <zypp-curl/ng/network/rangedesc.h>
19
20namespace zyppng {
21
22 class ZckHelper {
23 public:
24
25 using Block = RangeDesc;
26
27 struct PrepareResult {
28 enum Code {
29 Error, // we got an error
30 NothingToDo, // Target file is already complete
31 ExceedsMaxLen, // Zchunk header reports a different filesize than what was expected
32 Success // Returns a list of blocks to fetch
33 };
34
35 Code _code;
36 std::vector<Block> _blocks;
37 zypp::ByteCount _bytesReused;
38 std::string _message;
39 };
40
44 static bool isZchunkFile(const zypp::Pathname &file);
45
50 static PrepareResult prepareZck ( const zypp::Pathname &delta, const zypp::Pathname &target, const zypp::ByteCount &expectedFileSize );
51
55 static bool validateZckFile( const zypp::Pathname &file, std::string &error );
56 };
57}
58#endif
zypp::ByteCount
Store and operate with byte count.
Definition ByteCount.h:32
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:47
zyppng::ZckHelper
Definition zckhelper.h:22
zyppng::ZckHelper::Block
RangeDesc Block
Definition zckhelper.h:25
zyppng::ZckHelper::validateZckFile
static bool validateZckFile(const zypp::Pathname &file, std::string &error)
Definition zckhelper.cc:169
zyppng::ZckHelper::isZchunkFile
static bool isZchunkFile(const zypp::Pathname &file)
Definition zckhelper.cc:21
zyppng::ZckHelper::prepareZck
static PrepareResult prepareZck(const zypp::Pathname &delta, const zypp::Pathname &target, const zypp::ByteCount &expectedFileSize)
Definition zckhelper.cc:34
curlmultiparthandler.h
zypp::target
Definition KeyRing.h:325
zyppng
Definition MediaCurl2.h:22
rangedesc.h
zyppng::RangeDesc
Definition rangedesc.h:27
zyppng::ZckHelper::PrepareResult
Definition zckhelper.h:27
zyppng::ZckHelper::PrepareResult::_message
std::string _message
Definition zckhelper.h:38
zyppng::ZckHelper::PrepareResult::_blocks
std::vector< Block > _blocks
Definition zckhelper.h:36
zyppng::ZckHelper::PrepareResult::_code
Code _code
Definition zckhelper.h:35
zyppng::ZckHelper::PrepareResult::_bytesReused
zypp::ByteCount _bytesReused
Definition zckhelper.h:37
zyppng::ZckHelper::PrepareResult::Code
Code
Definition zckhelper.h:28
zyppng::ZckHelper::PrepareResult::NothingToDo
@ NothingToDo
Definition zckhelper.h:30
zyppng::ZckHelper::PrepareResult::Error
@ Error
Definition zckhelper.h:29
zyppng::ZckHelper::PrepareResult::Success
@ Success
Definition zckhelper.h:32
zyppng::ZckHelper::PrepareResult::ExceedsMaxLen
@ ExceedsMaxLen
Definition zckhelper.h:31