]>
git.saurik.com Git - apt.git/blob - ftparchive/writer.h
cc63758752a379bd381bf7152d408dd4861e2b2e
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: writer.h,v 1.3 2001/05/29 04:08:09 jgg Exp $
4 /* ######################################################################
8 The file writer classes. These write various types of output, sources,
11 ##################################################################### */
17 #pragma interface "writer.h"
26 #include "apt-ftparchive.h"
38 const char *OriginalPath
;
42 // Stuff for the delinker
45 static FTWScanner
*Owner
;
46 static int Scanner(const char *File
,const struct stat
*sb
,int Flag
);
48 bool Delink(string
&FileName
,const char *OriginalPath
,
49 unsigned long &Bytes
,struct stat
&St
);
51 inline void NewLine(unsigned Priority
)
53 if (ErrorPrinted
== false && Quiet
<= Priority
)
62 unsigned long DeLinkLimit
;
63 string InternalPrefix
;
65 virtual bool DoPackage(string FileName
) = 0;
66 bool RecursiveScan(string Dir
);
67 bool LoadFileList(string BaseDir
,string File
);
68 bool SetExts(string Vals
);
71 virtual ~FTWScanner() {delete [] RealPath
; delete [] TmpExt
;};
74 class PackagesWriter
: public FTWScanner
90 struct CacheDB::Stats
&Stats
;
92 inline bool ReadOverride(string File
) {return Over
.ReadOverride(File
);};
93 virtual bool DoPackage(string FileName
);
95 PackagesWriter(string DB
,string Overrides
);
96 virtual ~PackagesWriter() {};
99 class ContentsWriter
: public FTWScanner
109 struct CacheDB::Stats
&Stats
;
112 bool DoPackage(string FileName
,string Package
);
113 virtual bool DoPackage(string FileName
)
114 {return DoPackage(FileName
,string());};
115 bool ReadFromPkgs(string PkgFile
,string PkgCompress
);
117 void Finish() {Gen
.Print(Output
);};
118 inline bool ReadyDB(string DB
) {return Db
.ReadyDB(DB
);};
120 ContentsWriter(string DB
);
121 virtual ~ContentsWriter() {};
124 class SourcesWriter
: public FTWScanner
129 unsigned long BufSize
;
139 struct CacheDB::Stats Stats
;
141 /* inline bool ReadBinOverride(string File) {return BOver.ReadOverride(File);};
142 bool ReadSrcOverride(string File); // {return BOver.ReadOverride(File);};*/
143 virtual bool DoPackage(string FileName
);
145 SourcesWriter(string BOverrides
,string SOverrides
);
146 virtual ~SourcesWriter() {free(Buffer
);};