Pogger/src/ProtocolListener.h

42 lines
797 B
C
Raw Normal View History

2020-12-30 22:07:54 -06:00
/*
* Copyright 2020, Jaidyn Levesque <jadedctrl@teknik.io>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef PROTOCOL_LISTENER_H
#define PROTOCOL_LISTENER_H
#include <boost/uuid/detail/sha1.hpp>
2020-12-30 22:07:54 -06:00
#include <UrlProtocolListener.h>
2021-02-15 18:31:09 -06:00
#ifndef LIBNETAPI_DEPRECATED
using namespace BPrivate::Network;
#endif
class ProtocolListener : public BUrlProtocolListener
{
public:
2020-12-30 22:07:54 -06:00
ProtocolListener(bool);
virtual ~ProtocolListener();
2020-12-30 22:07:54 -06:00
virtual void DataReceived(BUrlRequest*, const char*, off_t, ssize_t);
2020-12-30 22:07:54 -06:00
void SetDownloadIO(BDataIO*);
BDataIO* GetDownloadIO();
2020-12-30 22:07:54 -06:00
void SetSha1(boost::uuids::detail::sha1*);
boost::uuids::detail::sha1* GetSha1();
BString GetHash();
private:
2020-12-30 22:07:54 -06:00
BDataIO* fDownloadIO;
boost::uuids::detail::sha1* fSha1;
2020-12-30 22:07:54 -06:00
bool fTraceLogging;
};
2020-12-30 22:07:54 -06:00
#endif
2020-12-30 22:07:54 -06:00