File: pkgimport.h

package info (click to toggle)
apt-cacher-ng 2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,032 kB
  • ctags: 1,705
  • sloc: cpp: 16,869; sh: 536; ansic: 404; perl: 377; makefile: 124
file content (54 lines) | stat: -rw-r--r-- 1,274 bytes parent folder | download | duplicates (7)
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
#ifndef PKGIMPORT_H_
#define PKGIMPORT_H_

//! Reuses lots of processing code
#include "expiration.h"

#include "fileio.h"
#include <cstring>
#include "csmapping.h"

namespace acng
{
class pkgimport : public cacheman
{

public:
	// XXX: c++11 using tCacheOperation::tCacheOperation;
	inline pkgimport(const tSpecialRequest::tRunParms& parms)
	: cacheman(parms) {};

	void Action() override;
	
protected:
	// FileHandler
	bool ProcessRegular(const mstring &sPath, const struct stat &) override;
	//bool ProcessOthers(const mstring &sPath, const struct stat &);
	void _LoadKeyCache();
	void HandlePkgEntry(const tRemoteFileInfo &entry);

private:

	/*!
	 *  Two maps mapping in different directions:
		-	fingerprints pointing to file info description vector,
	 		created by file scan+identification
	 	-	when reusing old fingerprints, a file info description is mapped
	 		to stored fingerprint (cacheMap from tCacheProcessor)
	*/
	std::map<tFingerprint, tImpFileInfo> m_importMap;
	std::deque<std::pair<tFingerprint, tImpFileInfo> > m_importRest;
	std::set<mstring> m_precachedList;
	/* tFprCacheMap m_cacheMap;*/
	

	bool m_bLookForIFiles = false;
	mstring m_sSrcPath;
		
	//void _ExtractLocationsFromVolFiles();
	void _GuessAndGetIfiles();
		
};

}
#endif /*PKGIMPORT_H_*/