]> git.saurik.com Git - apt.git/blob - cmdline/indexcopy.h
More tests
[apt.git] / cmdline / indexcopy.h
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
17 using std::string;
18 using std::vector;
19
20 class pkgTagSection;
21 class FileFd;
22
23 class IndexCopy
24 {
25 protected:
26
27 pkgTagSection *Section;
28
29 string ChopDirs(string Path,unsigned int Depth);
30 bool ReconstructPrefix(string &Prefix,string OrigPath,string CD,
31 string File);
32 bool ReconstructChop(unsigned long &Chop,string Dir,string File);
33 void ConvertToSourceList(string CD,string &Path);
34 bool GrabFirst(string Path,string &To,unsigned int Depth);
35 virtual bool GetFile(string &Filename,unsigned long &Size) = 0;
36 virtual bool RewriteEntry(FILE *Target,string File) = 0;
37 virtual const char *GetFileName() = 0;
38 virtual const char *Type() = 0;
39
40 public:
41
42 bool CopyPackages(string CDROM,string Name,vector<string> &List);
43 };
44
45 class PackageCopy : public IndexCopy
46 {
47 protected:
48
49 virtual bool GetFile(string &Filename,unsigned long &Size);
50 virtual bool RewriteEntry(FILE *Target,string File);
51 virtual const char *GetFileName() {return "Packages";};
52 virtual const char *Type() {return "Package";};
53
54 public:
55 };
56
57 class SourceCopy : public IndexCopy
58 {
59 protected:
60
61 virtual bool GetFile(string &Filename,unsigned long &Size);
62 virtual bool RewriteEntry(FILE *Target,string File);
63 virtual const char *GetFileName() {return "Sources";};
64 virtual const char *Type() {return "Source";};
65
66 public:
67 };
68
69 #endif