]>
Commit | Line | Data |
---|---|---|
143abaeb AL |
1 | // -*- mode: cpp; mode: fold -*- |
2 | // Description /*{{{*/ | |
076d01b0 | 3 | // $Id: indexcopy.h,v 1.3 2001/05/27 04:46:54 jgg Exp $ |
143abaeb AL |
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> | |
b2e465d6 | 15 | #include <stdio.h> |
143abaeb | 16 | |
076d01b0 AL |
17 | using std::string; |
18 | using std::vector; | |
19 | ||
143abaeb AL |
20 | class pkgTagSection; |
21 | class FileFd; | |
a75c6a6e MZ |
22 | class indexRecords; |
23 | class pkgCdromStatus; | |
143abaeb | 24 | |
92fcbfc1 | 25 | class IndexCopy /*{{{*/ |
143abaeb AL |
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); | |
143abaeb | 37 | virtual bool GetFile(string &Filename,unsigned long &Size) = 0; |
b2e465d6 | 38 | virtual bool RewriteEntry(FILE *Target,string File) = 0; |
143abaeb AL |
39 | virtual const char *GetFileName() = 0; |
40 | virtual const char *Type() = 0; | |
b2e465d6 | 41 | |
143abaeb AL |
42 | public: |
43 | ||
a75c6a6e MZ |
44 | bool CopyPackages(string CDROM,string Name,vector<string> &List, |
45 | pkgCdromStatus *log); | |
0432d731 | 46 | virtual ~IndexCopy() {}; |
143abaeb | 47 | }; |
92fcbfc1 DK |
48 | /*}}}*/ |
49 | class PackageCopy : public IndexCopy /*{{{*/ | |
143abaeb AL |
50 | { |
51 | protected: | |
52 | ||
53 | virtual bool GetFile(string &Filename,unsigned long &Size); | |
b2e465d6 | 54 | virtual bool RewriteEntry(FILE *Target,string File); |
143abaeb AL |
55 | virtual const char *GetFileName() {return "Packages";}; |
56 | virtual const char *Type() {return "Package";}; | |
57 | ||
58 | public: | |
59 | }; | |
92fcbfc1 DK |
60 | /*}}}*/ |
61 | class SourceCopy : public IndexCopy /*{{{*/ | |
143abaeb AL |
62 | { |
63 | protected: | |
64 | ||
65 | virtual bool GetFile(string &Filename,unsigned long &Size); | |
b2e465d6 | 66 | virtual bool RewriteEntry(FILE *Target,string File); |
143abaeb AL |
67 | virtual const char *GetFileName() {return "Sources";}; |
68 | virtual const char *Type() {return "Source";}; | |
69 | ||
70 | public: | |
71 | }; | |
92fcbfc1 DK |
72 | /*}}}*/ |
73 | class TranslationsCopy /*{{{*/ | |
22f8568d MV |
74 | { |
75 | protected: | |
76 | pkgTagSection *Section; | |
77 | ||
78 | public: | |
79 | bool CopyTranslations(string CDROM,string Name,vector<string> &List, | |
80 | pkgCdromStatus *log); | |
81 | }; | |
92fcbfc1 DK |
82 | /*}}}*/ |
83 | class SigVerify /*{{{*/ | |
a75c6a6e MZ |
84 | { |
85 | bool Verify(string prefix,string file, indexRecords *records); | |
86 | bool CopyMetaIndex(string CDROM, string CDName, | |
87 | string prefix, string file); | |
88 | ||
89 | public: | |
90 | bool CopyAndVerify(string CDROM,string Name,vector<string> &SigList, | |
91 | vector<string> PkgList,vector<string> SrcList); | |
92 | }; | |
92fcbfc1 | 93 | /*}}}*/ |
22f8568d | 94 | |
143abaeb | 95 | #endif |