File: apt-extracttemplates.h

package info (click to toggle)
apt 3.1.13
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 22,764 kB
  • sloc: cpp: 71,085; sh: 31,750; xml: 5,553; perl: 217; python: 197; ansic: 191; makefile: 41
file content (49 lines) | stat: -rw-r--r-- 1,126 bytes parent folder | download | duplicates (3)
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
// -*- mode: cpp; mode: fold -*-
// Description								/*{{{*/
/* ######################################################################

   apt-extracttemplate - tool to extract template and config data
   
   ##################################################################### */
									/*}}}*/
#ifndef _APTEXTRACTTEMPLATE_H_
#define _APTEXTRACTTEMPLATE_H_

#include <apt-pkg/dirstream.h>
#include <apt-pkg/fileutl.h>

#include <string>

class pkgCache;

class DebFile : public pkgDirStream
{
	FileFd File;
	char *Control;
	unsigned long ControlLen;
	
public:
	explicit DebFile(const char *FileName);
	~DebFile() override;
	bool DoItem(Item &I, int &fd) override;
	bool Process(pkgDirStream::Item &I, const unsigned char *data,
		unsigned long long size, unsigned long long pos) override;

	bool Go();
	bool ParseInfo();

	static std::string GetInstalledVer(const std::string &package);

	std::string Package;
	std::string Version;
	std::string DepVer, PreDepVer;
	unsigned int DepOp, PreDepOp;

	char *Config;
	char *Template;

	static pkgCache *Cache;
	enum { None, IsControl, IsConfig, IsTemplate } Which;
};

#endif