File: expiration.h

package info (click to toggle)
apt-cacher-ng 0.7.27-1~bpo70+1
  • links: PTS
  • area: main
  • in suites: wheezy-backports
  • size: 1,740 kB
  • sloc: cpp: 13,987; sh: 519; perl: 442; ansic: 414; makefile: 77
file content (57 lines) | stat: -rw-r--r-- 1,142 bytes parent folder | download
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef EXPIRATION_H_
#define EXPIRATION_H_

#include "cacheman.h"

class expiration : public tCacheMan, ifileprocessor
{
public:

	enum workType
	{
		expire,
		list,
		purge,
		listDamaged,
		purgeDamaged,
		truncDamaged
	};
	expiration(int fd, workType type);
	virtual ~expiration();

protected:

	workType m_mode;

	tS2DAT m_trashCandSet;
	set<tFileNdir> m_trashCandHeadSet; // just collect the list of seen head files

	void RemoveAndStoreStatus(bool bPurgeNow);
	void LoadPreviousData(bool bForceInsert);

	// callback implementations
	virtual void Action(const mstring &);
	// for FileHandler
	virtual bool ProcessRegular(const mstring &sPath, const struct stat &);

	// for ifileprocessor
	virtual void HandlePkgEntry(const tRemoteFileInfo &entry, bool bUnpackForCsumming);

	virtual void UpdateFingerprint(const mstring &sPathRel, off_t nOverrideSize,
				uint8_t *pOverrideSha1, uint8_t *pOverrideMd5);

	void LoadHints();

	void PurgeMaintLogs();

	void DropExceptionalVersions();

	std::ofstream m_damageList;
	bool m_bIncompleteIsDamaged;

private:
	int m_nPrevFailCount;
	bool CheckAndReportError();
};

#endif /*EXPIRATION_H_*/