libzypp 17.31.23
detectmeta_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_DETECTMETA_P_H_INCLUDED
15#define ZYPP_CURL_NG_NETWORK_PRIVATE_DOWNLOADERSTATES_DETECTMETA_P_H_INCLUDED
16
17#include "base_p.h"
18#include <zypp-core/zyppng/base/statemachine.h>
19
20namespace zyppng {
21
22 struct DlMetaLinkInfoState;
23#if ENABLE_ZCHUNK_COMPRESSION
24 struct DLZckHeadState;
25#endif
26
37 struct DetectMetalinkState : public zyppng::SimpleState< DownloadPrivate, Download::DetectMetaLink, false > {
38
40
42
43 void enter ();
44 void exit ();
45
47 void onRequestProgress ( NetworkRequest &, off_t, off_t dlnow, off_t, off_t );
48 void onRequestFinished ( NetworkRequest &req , const NetworkRequestError &err );
49
50
51 const NetworkRequestError &error () const {
52 return _error;
53 }
54
55 SignalProxy< void () > sigFinished() {
56 return _sigFinished;
57 }
58
59 bool toMetalinkGuard () const {
60 return _gotMetalink;
61 }
62 std::shared_ptr<DlMetaLinkInfoState> toDlMetaLinkInfoState();
63
64 bool toSimpleDownloadGuard () const;
65
66#if ENABLE_ZCHUNK_COMPRESSION
67 bool toZckHeadDownloadGuard () const;
68 std::shared_ptr<DLZckHeadState> toDLZckHeadState();
69#endif
70
71 std::shared_ptr<Request> _request;
72
73 private:
75 bool _gotMetalink = false;
76 Signal< void () > _sigFinished;
77 };
78
79}
80
81#endif
The NetworkRequestError class Represents a error that occured in.
void onRequestFinished(NetworkRequest &req, const NetworkRequestError &err)
Definition: detectmeta_p.cc:62
void onRequestProgress(NetworkRequest &, off_t, off_t dlnow, off_t, off_t)
Definition: detectmeta_p.cc:57
NetworkRequestError _error
Definition: detectmeta_p.h:74
std::shared_ptr< Request > _request
Definition: detectmeta_p.h:71
void onRequestStarted(NetworkRequest &)
Definition: detectmeta_p.cc:52
Signal< void() > _sigFinished
Definition: detectmeta_p.h:76
bool toSimpleDownloadGuard() const
Definition: detectmeta_p.cc:89
SignalProxy< void() > sigFinished()
Definition: detectmeta_p.h:55
std::shared_ptr< DlMetaLinkInfoState > toDlMetaLinkInfoState()
Definition: detectmeta_p.cc:81
const NetworkRequestError & error() const
Definition: detectmeta_p.h:51