Mercurial > minori
annotate include/core/torrent.h @ 198:bc1ae1810855
dep/animia: switch from using classes to global functions
the old idea was ok, but sort of hackish; this method doesn't use classes
at all, and this way (especially important!) we can do wayland stuff AND x11
at the same time, which wasn't really possible without stupid workarounds in
the other method
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 24 Dec 2023 02:59:42 -0500 |
parents | 39521c47c7a3 |
children | 4d461ef7d424 |
rev | line source |
---|---|
114 | 1 #ifndef __core__torrent_h |
2 #define __core__torrent_h | |
3 | |
4 #include <string> | |
5 #include <QDateTime> | |
6 | |
118
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
7 /* this is really just a fancy struct... |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
8 |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
9 this will be moved into its own namespace if |
114 | 10 it's deemed necessary */ |
11 class Torrent { | |
12 public: | |
13 std::string GetTitle() const { return _title; }; | |
118
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
14 std::string GetCategory() const { return _category; }; |
114 | 15 std::string GetEpisode() const { return _episode; }; |
16 std::string GetGroup() const { return _group; }; | |
17 size_t GetSize() const { return _size; }; | |
18 std::string GetResolution() const { return _resolution; }; | |
19 int GetSeeders() const { return _seeders; }; | |
20 int GetLeechers() const { return _leechers; }; | |
21 int GetDownloaders() const { return _downloaders; }; | |
22 std::string GetDescription() const { return _description; }; | |
23 std::string GetFilename() const { return _filename; }; | |
24 std::string GetLink() const { return _link; }; | |
25 std::string GetGuid() const { return _guid; }; | |
26 QDateTime GetDate() const { return _date; }; | |
27 | |
28 void SetTitle(const std::string& title) { _title = title; }; | |
118
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
29 void SetCategory(const std::string& category) { _category = category; }; |
114 | 30 void SetEpisode(const std::string& episode) { _episode = episode; }; |
31 void SetGroup(const std::string& group) { _group = group; }; | |
32 void SetSize(const size_t size) { _size = size; }; | |
33 void SetResolution(const std::string& resolution) { _resolution = resolution; }; | |
34 void SetSeeders(const int seeders) { _seeders = seeders; }; | |
35 void SetLeechers(const int leechers) { _leechers = leechers; }; | |
36 void SetDownloaders(const int downloaders) { _downloaders = downloaders; }; | |
37 void SetDescription(const std::string& description) { _description = description; }; | |
38 void SetFilename(const std::string& filename) { _filename = filename; }; | |
39 void SetLink(const std::string& link) { _link = link; }; | |
40 void SetGuid(const std::string& guid) { _guid = guid; }; | |
41 void SetDate(const QDateTime& date) { _date = date; }; | |
42 | |
43 private: | |
44 std::string _title; | |
118
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
45 std::string _category; |
114 | 46 std::string _episode; |
47 std::string _group; | |
48 size_t _size = 0; | |
49 std::string _resolution; /* technically should be an int, | |
50 but std::string is more useful */ | |
51 int _seeders = 0; | |
52 int _leechers = 0; | |
53 int _downloaders = 0; | |
54 std::string _description; | |
55 std::string _filename; | |
56 std::string _link; | |
57 std::string _guid; | |
58 QDateTime _date; | |
59 }; | |
60 | |
61 #endif // __core__torrent_h |