]>
git.saurik.com Git - apt.git/blob - ftparchive/writer.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: writer.h,v 1.2 2001/02/20 07:03:18 jgg Exp $
4 /* ######################################################################
8 The file writer classes. These write various types of output, sources,
11 ##################################################################### */
17 #pragma interface "writer.h"
25 #include "apt-ftparchive.h"
33 const char *OriginalPath
;
37 // Stuff for the delinker
40 static FTWScanner
*Owner
;
41 static int Scanner(const char *File
,const struct stat
*sb
,int Flag
);
43 bool Delink(string
&FileName
,const char *OriginalPath
,
44 unsigned long &Bytes
,struct stat
&St
);
46 inline void NewLine(unsigned Priority
)
48 if (ErrorPrinted
== false && Quiet
<= Priority
)
57 unsigned long DeLinkLimit
;
58 string InternalPrefix
;
60 virtual bool DoPackage(string FileName
) = 0;
61 bool RecursiveScan(string Dir
);
62 bool LoadFileList(string BaseDir
,string File
);
63 bool SetExts(string Vals
);
66 virtual ~FTWScanner() {delete [] RealPath
; delete [] TmpExt
;};
69 class PackagesWriter
: public FTWScanner
85 struct CacheDB::Stats
&Stats
;
87 inline bool ReadOverride(string File
) {return Over
.ReadOverride(File
);};
88 virtual bool DoPackage(string FileName
);
90 PackagesWriter(string DB
,string Overrides
);
91 virtual ~PackagesWriter() {};
94 class ContentsWriter
: public FTWScanner
104 struct CacheDB::Stats
&Stats
;
107 bool DoPackage(string FileName
,string Package
);
108 virtual bool DoPackage(string FileName
)
109 {return DoPackage(FileName
,string());};
110 bool ReadFromPkgs(string PkgFile
,string PkgCompress
);
112 void Finish() {Gen
.Print(Output
);};
113 inline bool ReadyDB(string DB
) {return Db
.ReadyDB(DB
);};
115 ContentsWriter(string DB
);
116 virtual ~ContentsWriter() {};
119 class SourcesWriter
: public FTWScanner
124 unsigned long BufSize
;
134 struct CacheDB::Stats Stats
;
136 /* inline bool ReadBinOverride(string File) {return BOver.ReadOverride(File);};
137 bool ReadSrcOverride(string File); // {return BOver.ReadOverride(File);};*/
138 virtual bool DoPackage(string FileName
);
140 SourcesWriter(string BOverrides
,string SOverrides
);
141 virtual ~SourcesWriter() {free(Buffer
);};