libzypp 17.37.12
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
19
20namespace zyppng {
21
22 class ZckHelper {
23 public:
24
26
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
36 std::vector<Block> _blocks;
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
Store and operate with byte count.
Definition ByteCount.h:32
RangeDesc Block
Definition zckhelper.h:25
static bool validateZckFile(const zypp::Pathname &file, std::string &error)
Definition zckhelper.cc:169
static bool isZchunkFile(const zypp::Pathname &file)
Definition zckhelper.cc:21
static PrepareResult prepareZck(const zypp::Pathname &delta, const zypp::Pathname &target, const zypp::ByteCount &expectedFileSize)
Definition zckhelper.cc:34
std::vector< Block > _blocks
Definition zckhelper.h:36