summaryrefslogtreecommitdiffstats
path: root/logic/net/S3ListBucket.h
blob: f054532d0294576c974610e47f04f57270ce91d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
#include "NetAction.h"

struct S3Object
{
	QString Key;
	QString ETag;
	qlonglong size;
};

typedef std::shared_ptr<class S3ListBucket> S3ListBucketPtr;
class S3ListBucket : public NetAction
{
	Q_OBJECT
public:
	S3ListBucket(QUrl url);
	static S3ListBucketPtr make(QUrl url)
	{
		return S3ListBucketPtr(new S3ListBucket(url));
	}

public:
	QList<S3Object> objects;

public
slots:
	virtual void start() override;

protected
slots:
	virtual void downloadProgress(qint64 bytesReceived, qint64 bytesTotal) override;
	virtual void downloadError(QNetworkReply::NetworkError error) override;
	virtual void downloadFinished() override;
	virtual void downloadReadyRead() override;

private:
	void processValidReply();

private:
	qint64 bytesSoFar = 0;
	QString current_marker;
};