]>
git.saurik.com Git - apt.git/blob - ftparchive/writer.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: writer.h,v 1.4 2001/06/26 02:50:27 jgg Exp $
4 /* ######################################################################
8 The file writer classes. These write various types of output, sources,
11 ##################################################################### */
17 #pragma interface "writer.h"
27 #include "apt-ftparchive.h"
39 const char *OriginalPath
;
43 // Stuff for the delinker
46 static FTWScanner
*Owner
;
47 static int Scanner(const char *File
,const struct stat
*sb
,int Flag
);
49 bool Delink(string
&FileName
,const char *OriginalPath
,
50 unsigned long &Bytes
,struct stat
&St
);
52 inline void NewLine(unsigned Priority
)
54 if (ErrorPrinted
== false && Quiet
<= Priority
)
63 unsigned long DeLinkLimit
;
64 string InternalPrefix
;
66 virtual bool DoPackage(string FileName
) = 0;
67 bool RecursiveScan(string Dir
);
68 bool LoadFileList(string BaseDir
,string File
);
69 bool SetExts(string Vals
);
72 virtual ~FTWScanner() {delete [] RealPath
; delete [] TmpExt
;};
75 class PackagesWriter
: public FTWScanner
91 struct CacheDB::Stats
&Stats
;
93 inline bool ReadOverride(string File
) {return Over
.ReadOverride(File
);};
94 inline bool ReadExtraOverride(string File
)
95 {return Over
.ReadExtraOverride(File
);};
96 virtual bool DoPackage(string FileName
);
98 PackagesWriter(string DB
,string Overrides
,string ExtOverrides
=string());
99 virtual ~PackagesWriter() {};
102 class ContentsWriter
: public FTWScanner
112 struct CacheDB::Stats
&Stats
;
115 bool DoPackage(string FileName
,string Package
);
116 virtual bool DoPackage(string FileName
)
117 {return DoPackage(FileName
,string());};
118 bool ReadFromPkgs(string PkgFile
,string PkgCompress
);
120 void Finish() {Gen
.Print(Output
);};
121 inline bool ReadyDB(string DB
) {return Db
.ReadyDB(DB
);};
123 ContentsWriter(string DB
);
124 virtual ~ContentsWriter() {};
127 class SourcesWriter
: public FTWScanner
132 unsigned long BufSize
;
142 struct CacheDB::Stats Stats
;
144 virtual bool DoPackage(string FileName
);
146 SourcesWriter(string BOverrides
,string SOverrides
,
147 string ExtOverrides
=string());
148 virtual ~SourcesWriter() {free(Buffer
);};