Fix build/install of Polish offline documentation
[ntk/apt.git] / cmdline / indexcopy.h
CommitLineData
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
17using std::string;
18using std::vector;
19
143abaeb
AL
20class pkgTagSection;
21class FileFd;
22
23class 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);
143abaeb 35 virtual bool GetFile(string &Filename,unsigned long &Size) = 0;
b2e465d6 36 virtual bool RewriteEntry(FILE *Target,string File) = 0;
143abaeb
AL
37 virtual const char *GetFileName() = 0;
38 virtual const char *Type() = 0;
b2e465d6 39
143abaeb
AL
40 public:
41
42 bool CopyPackages(string CDROM,string Name,vector<string> &List);
43};
44
45class PackageCopy : public IndexCopy
46{
47 protected:
48
49 virtual bool GetFile(string &Filename,unsigned long &Size);
b2e465d6 50 virtual bool RewriteEntry(FILE *Target,string File);
143abaeb
AL
51 virtual const char *GetFileName() {return "Packages";};
52 virtual const char *Type() {return "Package";};
53
54 public:
55};
56
57class SourceCopy : public IndexCopy
58{
59 protected:
60
61 virtual bool GetFile(string &Filename,unsigned long &Size);
b2e465d6 62 virtual bool RewriteEntry(FILE *Target,string File);
143abaeb
AL
63 virtual const char *GetFileName() {return "Sources";};
64 virtual const char *Type() {return "Source";};
65
66 public:
67};
68
69#endif