libzypp 17.31.23
zck_p.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 ZYPP_CURL_NG_NETWORK_PRIVATE_DOWNLOADERSTATES_ZCK_P_H_INCLUDED
15#define ZYPP_CURL_NG_NETWORK_PRIVATE_DOWNLOADERSTATES_ZCK_P_H_INCLUDED
16
17#include "base_p.h"
18#include "basicdownloader_p.h"
19#include "rangedownloader_p.h"
20#include <zypp-core/zyppng/base/statemachine.h>
21
22namespace zyppng {
23
24#if ENABLE_ZCHUNK_COMPRESSION
25
26 struct DLZckState;
27 struct FinishedState;
28
29 bool isZchunkFile ( const zypp::Pathname &file );
30
35 struct DLZckHeadState : public BasicDownloaderStateBase {
36 static constexpr auto stateId = Download::DlZChunkHead;
37
38 DLZckHeadState( std::vector<Url> &&mirrors, DownloadPrivate &parent );
39 DLZckHeadState( std::vector<Url> &&mirrors, std::shared_ptr<Request> &&oldReq, DownloadPrivate &parent );
40
41 virtual bool initializeRequest( std::shared_ptr<Request> &r ) override;
42 virtual void gotFinished () override;
43
44 std::shared_ptr<DLZckState> transitionToDlZckState ();
45
46 SignalProxy< void () > sigFinished() {
47 return _sigFinished;
48 }
49 SignalProxy< void () > sigFailed() {
50 return _sigFailed;
51 }
52 };
53
58 struct DLZckState : public RangeDownloaderBaseState {
59
60 static constexpr auto stateId = Download::DlZChunk;
61
62 DLZckState ( std::vector<Url> &&mirrors, DownloadPrivate &parent );
63
64 void enter ();
65 void exit ();
66
67 std::shared_ptr<FinishedState> transitionToFinished ();
68
69 SignalProxy< void () > sigFinished() {
70 return _sigFinished;
71 }
72
73 SignalProxy< void () > sigFallback() {
74 return _sigFailed;
75 }
76
77 void setFinished() override;
78
79 };
80
81#endif
82
83}
84
85#endif