2020-06-19 17:54:41 -05:00
|
|
|
#ifndef PROTOCOL_LISTENER_H
|
|
|
|
#define PROTOCOL_LISTENER_H
|
|
|
|
|
|
|
|
#include <UrlProtocolListener.h>
|
|
|
|
#include <Url.h>
|
2020-08-02 02:05:20 -05:00
|
|
|
#include <boost/uuid/detail/sha1.hpp>
|
2020-06-19 17:54:41 -05:00
|
|
|
|
|
|
|
class ProtocolListener : public BUrlProtocolListener
|
|
|
|
{
|
|
|
|
public:
|
2020-07-13 12:31:52 -05:00
|
|
|
ProtocolListener ( bool );
|
2020-06-19 17:54:41 -05:00
|
|
|
|
|
|
|
virtual ~ProtocolListener();
|
|
|
|
virtual void DataReceived(BUrlRequest*, const char*, off_t, ssize_t);
|
2020-08-02 02:05:20 -05:00
|
|
|
|
2020-06-19 17:54:41 -05:00
|
|
|
void SetDownloadIO ( BDataIO* );
|
|
|
|
BDataIO* GetDownloadIO ( );
|
|
|
|
|
2020-08-02 02:05:20 -05:00
|
|
|
void SetSha1 ( boost::uuids::detail::sha1* );
|
|
|
|
boost::uuids::detail::sha1* GetSha1 ( );
|
|
|
|
BString GetHash ( );
|
|
|
|
|
2020-06-19 17:54:41 -05:00
|
|
|
private:
|
|
|
|
BDataIO* fDownloadIO;
|
2020-08-02 02:05:20 -05:00
|
|
|
boost::uuids::detail::sha1* fSha1;
|
2020-06-19 17:54:41 -05:00
|
|
|
bool fTraceLogging;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|