apt: apt-pkg/indexcopy.h Source File

apt 2.7.10 commandline package manager

indexcopy.h
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
3/* ######################################################################
4
5 Index Copying - Aid for copying and verifying the index files
6
7 ##################################################################### */
8 /*}}}*/
9#ifndef INDEXCOPY_H
10#define INDEXCOPY_H
11
12#include <vector>
13#ifndef APT_11_CLEAN_HEADERS
14#include <string>
15#include <stdio.h>
16#endif
17
18#include <apt-pkg/macros.h>
19
20
21class pkgTagSection;
22class pkgCdromStatus;
23class FileFd;
24class metaIndex;
25
26 class APT_PUBLIC IndexCopy /*{{{*/
27{
29 void * const d;
30
31 protected:
32
33 pkgTagSection *Section;
34
35 std::string ChopDirs(std::string Path,unsigned int Depth);
36 bool ReconstructPrefix(std::string &Prefix,std::string OrigPath,std::string CD,
37 std::string File);
38 bool ReconstructChop(unsigned long &Chop,std::string Dir,std::string File);
39 void ConvertToSourceList(std::string CD,std::string &Path);
40 bool GrabFirst(std::string Path,std::string &To,unsigned int Depth);
41 virtual bool GetFile(std::string &Filename,unsigned long long &Size) = 0;
42 virtual bool RewriteEntry(FileFd &Target, std::string const &File) = 0;
43 virtual const char *GetFileName() = 0;
44 virtual const char *Type() = 0;
45
46 public:
47
48 bool CopyPackages(std::string CDROM,std::string Name,std::vector<std::string> &List,
49 pkgCdromStatus *log);
50 IndexCopy();
51 virtual ~IndexCopy();
52};
53 /*}}}*/
54 class APT_PUBLIC PackageCopy : public IndexCopy /*{{{*/
55{
56 void * const d;
57 protected:
58
59 virtual bool GetFile(std::string &Filename,unsigned long long &Size) APT_OVERRIDE;
60 virtual bool RewriteEntry(FileFd &Target, std::string const &File) APT_OVERRIDE;
61 virtual const char *GetFileName() APT_OVERRIDE {return "Packages";};
62 virtual const char *Type() APT_OVERRIDE {return "Package";};
63
64 public:
65 PackageCopy();
66 virtual ~PackageCopy();
67};
68 /*}}}*/
69 class APT_PUBLIC SourceCopy : public IndexCopy /*{{{*/
70{
71 void * const d;
72 protected:
73
74 virtual bool GetFile(std::string &Filename,unsigned long long &Size) APT_OVERRIDE;
75 virtual bool RewriteEntry(FileFd &Target, std::string const &File) APT_OVERRIDE;
76 virtual const char *GetFileName() APT_OVERRIDE {return "Sources";};
77 virtual const char *Type() APT_OVERRIDE {return "Source";};
78
79 public:
80 SourceCopy();
81 virtual ~SourceCopy();
82};
83 /*}}}*/
84 class APT_PUBLIC TranslationsCopy /*{{{*/
85{
86 void * const d;
87 protected:
88 pkgTagSection *Section;
89
90 public:
91 bool CopyTranslations(std::string CDROM,std::string Name,std::vector<std::string> &List,
92 pkgCdromStatus *log);
93
94 TranslationsCopy();
95 virtual ~TranslationsCopy();
96};
97 /*}}}*/
98 class APT_PUBLIC SigVerify /*{{{*/
99{
101 void * const d;
102
103 APT_HIDDEN bool Verify(std::string prefix,std::string file, metaIndex *records);
104 APT_HIDDEN bool CopyMetaIndex(std::string CDROM, std::string CDName,
105 std::string prefix, std::string file);
106
107 public:
108 bool CopyAndVerify(std::string CDROM,std::string Name,std::vector<std::string> &SigList,
109 std::vector<std::string> PkgList,std::vector<std::string> SrcList);
110
111 SigVerify();
112 virtual ~SigVerify();
113};
114 /*}}}*/
115
116#endif
FileFd
Definition fileutl.h:41
IndexCopy
Definition indexcopy.h:27
PackageCopy
Definition indexcopy.h:55
SigVerify
Definition indexcopy.h:99
SourceCopy
Definition indexcopy.h:70
TranslationsCopy
Definition indexcopy.h:85
metaIndex
Definition metaindex.h:21
pkgCdromStatus
Definition cdrom.h:16
pkgTagSection
Definition tagfile.h:45