1 #ifndef FILEZILLA_INTERFACE_QUEUE_STORAGE_HEADER
2 #define FILEZILLA_INTERFACE_QUEUE_STORAGE_HEADER
3 
4 #include <vector>
5 
6 class CFileItem;
7 class CServerItem;
8 class Site;
9 
10 class CQueueStorage final
11 {
12 	class Impl;
13 
14 public:
15 	CQueueStorage();
16 	~CQueueStorage();
17 
18 	CQueueStorage(CQueueStorage const&) = delete;
19 	CQueueStorage& operator=(CQueueStorage const&) = delete;
20 
21 	// Call before loading
22 	bool BeginTransaction();
23 
24 	// Call after finishing loading
25 	bool EndTransaction(bool rollback = false);
26 
27 	bool Clear(); // Also clears caches
28 
29 	bool Vacuum();
30 
31 	bool SaveQueue(std::vector<CServerItem*> const& queue);
32 
33 	// > 0 = server id
34 	//   0 = No server
35 	// < 0 = failure.
36 	int64_t GetServer(Site& site, bool fromBeginning);
37 
38 	int64_t GetFile(CFileItem** pItem, int64_t server);
39 
40 	static std::wstring GetDatabaseFilename();
41 
42 private:
43 	Impl* d_;
44 };
45 
46 #endif
47