]> git.saurik.com Git - apt-legacy.git/blame - apt-pkg/indexcopy.h
Apparently apt-ftparchive uses Berkeley DB.
[apt-legacy.git] / apt-pkg / indexcopy.h
CommitLineData
da6ee469
JF
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
3// $Id: indexcopy.h,v 1.3 2001/05/27 04:46:54 jgg Exp $
4/* ######################################################################
5
6 Index Copying - Aid for copying and verifying the index files
7
8 ##################################################################### */
9 /*}}}*/
10#ifndef INDEXCOPY_H
11#define INDEXCOPY_H
12
13#include <vector>
14#include <string>
15#include <stdio.h>
16
17using std::string;
18using std::vector;
19
20class pkgTagSection;
21class FileFd;
22class indexRecords;
23class pkgCdromStatus;
24
25class IndexCopy
26{
27 protected:
28
29 pkgTagSection *Section;
30
31 string ChopDirs(string Path,unsigned int Depth);
32 bool ReconstructPrefix(string &Prefix,string OrigPath,string CD,
33 string File);
34 bool ReconstructChop(unsigned long &Chop,string Dir,string File);
35 void ConvertToSourceList(string CD,string &Path);
36 bool GrabFirst(string Path,string &To,unsigned int Depth);
37 virtual bool GetFile(string &Filename,unsigned long &Size) = 0;
38 virtual bool RewriteEntry(FILE *Target,string File) = 0;
39 virtual const char *GetFileName() = 0;
40 virtual const char *Type() = 0;
41
42 public:
43
44 bool CopyPackages(string CDROM,string Name,vector<string> &List,
45 pkgCdromStatus *log);
46 virtual ~IndexCopy() {};
47};
48
49class PackageCopy : public IndexCopy
50{
51 protected:
52
53 virtual bool GetFile(string &Filename,unsigned long &Size);
54 virtual bool RewriteEntry(FILE *Target,string File);
55 virtual const char *GetFileName() {return "Packages";};
56 virtual const char *Type() {return "Package";};
57
58 public:
59};
60
61class SourceCopy : public IndexCopy
62{
63 protected:
64
65 virtual bool GetFile(string &Filename,unsigned long &Size);
66 virtual bool RewriteEntry(FILE *Target,string File);
67 virtual const char *GetFileName() {return "Sources";};
68 virtual const char *Type() {return "Source";};
69
70 public:
71};
72
73class SigVerify
74{
75 bool Verify(string prefix,string file, indexRecords *records);
76 bool CopyMetaIndex(string CDROM, string CDName,
77 string prefix, string file);
78
79 public:
80 bool CopyAndVerify(string CDROM,string Name,vector<string> &SigList,
81 vector<string> PkgList,vector<string> SrcList);
82};
83
84#endif