-
Notifications
You must be signed in to change notification settings - Fork 4
/
par2outinfo.h
43 lines (33 loc) · 979 Bytes
/
par2outinfo.h
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
43
#ifndef PAR2OUTINFO_H
#define PAR2OUTINFO_H
class MainWindow;
#include <QtGlobal>
#include <QVector>
class Par2RecoveryFile {
public:
int offset;
int count;
quint64 size;
};
class Par2OutInfo
{
private:
MainWindow* win;
public:
// ugly strong coupling, but who really cares?
Par2OutInfo(MainWindow* mainWin) : win(mainWin) {
}
void updateCritPacketSizes();
QList<Par2RecoveryFile> getOutputList(int sliceCount, int distMode, int sliceLimit, int sliceOffset);
static QString fileExt(int numSlices, int sliceOffset, int totalSlices);
static QString nameSafeLen(QString name);
private:
// state variables because stateless went out of fashion
QVector<quint64> critPacketSizes;
quint64 totalCritSize;
static int pktSizeFileDesc(const QString& filename);
int pktSizeComment() const;
static int pktSizeCreator();
Par2RecoveryFile makeRecFile(int sliceCount, int sliceOffset);
};
#endif // PAR2OUTINFO_H