]>
git.saurik.com Git - apt.git/blob - apt-pkg/indexcopy.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: indexcopy.h,v 1.3 2001/05/27 04:46:54 jgg Exp $
4 /* ######################################################################
6 Index Copying - Aid for copying and verifying the index files
8 ##################################################################### */
29 pkgTagSection
*Section
;
31 string
ChopDirs(string Path
,unsigned int Depth
);
32 bool ReconstructPrefix(string
&Prefix
,string OrigPath
,string CD
,
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;
44 bool CopyPackages(string CDROM
,string Name
,vector
<string
> &List
,
48 class PackageCopy
: public IndexCopy
52 virtual bool GetFile(string
&Filename
,unsigned long &Size
);
53 virtual bool RewriteEntry(FILE *Target
,string File
);
54 virtual const char *GetFileName() {return "Packages";};
55 virtual const char *Type() {return "Package";};
60 class SourceCopy
: public IndexCopy
64 virtual bool GetFile(string
&Filename
,unsigned long &Size
);
65 virtual bool RewriteEntry(FILE *Target
,string File
);
66 virtual const char *GetFileName() {return "Sources";};
67 virtual const char *Type() {return "Source";};
74 bool Verify(string prefix
,string file
, indexRecords
*records
);
75 bool CopyMetaIndex(string CDROM
, string CDName
,
76 string prefix
, string file
);
79 bool CopyAndVerify(string CDROM
,string Name
,vector
<string
> &SigList
,
80 vector
<string
> PkgList
,vector
<string
> SrcList
);