~ubuntu-branches/debian/experimental/apt/experimental

« back to all changes in this revision

Viewing changes to ftparchive/writer.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2010-02-18 22:07:23 UTC
  • mfrom: (9.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100218220723-zb7zdh6fmsmp30tr
Tags: 0.7.26~exp2
fix crash when LANGUAGE is not set

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
{
35
35
   protected:
36
36
   vector<string> Patterns;
 
37
   string Arch;
37
38
   const char *OriginalPath;
38
 
   char *RealPath;
39
39
   bool ErrorPrinted;
40
40
   
41
41
   // Stuff for the delinker
43
43
   
44
44
   static FTWScanner *Owner;
45
45
   static int ScannerFTW(const char *File,const struct stat *sb,int Flag);
46
 
   static int ScannerFile(const char *File, bool ReadLink);
 
46
   static int ScannerFile(const char *File, bool const &ReadLink);
47
47
 
48
48
   bool Delink(string &FileName,const char *OriginalPath,
49
 
               unsigned long &Bytes,off_t FileSize);
 
49
               unsigned long &Bytes,off_t const &FileSize);
50
50
 
51
 
   inline void NewLine(unsigned Priority)
 
51
   inline void NewLine(unsigned const &Priority)
52
52
   {
53
53
      if (ErrorPrinted == false && Quiet <= Priority)
54
54
      {
55
 
         cout << endl;
 
55
         c1out << endl;
56
56
         ErrorPrinted = true;
57
57
      }  
58
58
   }
63
63
   string InternalPrefix;
64
64
 
65
65
   virtual bool DoPackage(string FileName) = 0;
66
 
   bool RecursiveScan(string Dir);
67
 
   bool LoadFileList(string BaseDir,string File);
 
66
   bool RecursiveScan(string const &Dir);
 
67
   bool LoadFileList(string const &BaseDir,string const &File);
68
68
   void ClearPatterns() { Patterns.clear(); };
69
 
   void AddPattern(string Pattern) { Patterns.push_back(Pattern); };
70
 
   bool SetExts(string Vals);
 
69
   void AddPattern(string const &Pattern) { Patterns.push_back(Pattern); };
 
70
   bool SetExts(string const &Vals);
71
71
      
72
 
   FTWScanner();
73
 
   virtual ~FTWScanner() {delete [] RealPath;};
 
72
   FTWScanner(string const &Arch = string());
74
73
};
75
74
 
76
75
class PackagesWriter : public FTWScanner
84
83
   bool DoMD5;
85
84
   bool DoSHA1;
86
85
   bool DoSHA256;
 
86
   bool DoAlwaysStat;
87
87
   bool NoOverride;
88
88
   bool DoContents;
 
89
   bool LongDescription;
89
90
 
90
91
   // General options
91
92
   string PathPrefix;
92
93
   string DirStrip;
93
94
   FILE *Output;
94
95
   struct CacheDB::Stats &Stats;
95
 
   string Arch;
96
96
 
97
 
   inline bool ReadOverride(string File) {return Over.ReadOverride(File);};
98
 
   inline bool ReadExtraOverride(string File) 
 
97
   inline bool ReadOverride(string const &File) {return Over.ReadOverride(File);};
 
98
   inline bool ReadExtraOverride(string const &File) 
99
99
      {return Over.ReadExtraOverride(File);};
100
100
   virtual bool DoPackage(string FileName);
101
101
 
102
 
   PackagesWriter(string DB,string Overrides,string ExtOverrides=string(),
103
 
                  string Arch=string());
 
102
   PackagesWriter(string const &DB,string const &Overrides,string const &ExtOverrides=string(),
 
103
                  string const &Arch=string());
104
104
   virtual ~PackagesWriter() {};
105
105
};
106
106
 
120
120
   bool DoPackage(string FileName,string Package);
121
121
   virtual bool DoPackage(string FileName) 
122
122
             {return DoPackage(FileName,string());};
123
 
   bool ReadFromPkgs(string PkgFile,string PkgCompress);
 
123
   bool ReadFromPkgs(string const &PkgFile,string const &PkgCompress);
124
124
 
125
125
   void Finish() {Gen.Print(Output);};
126
 
   inline bool ReadyDB(string DB) {return Db.ReadyDB(DB);};
 
126
   inline bool ReadyDB(string const &DB) {return Db.ReadyDB(DB);};
127
127
   
128
 
   ContentsWriter(string DB);
 
128
   ContentsWriter(string const &DB, string const &Arch = string());
129
129
   virtual ~ContentsWriter() {};
130
130
};
131
131
 
148
148
 
149
149
   virtual bool DoPackage(string FileName);
150
150
 
151
 
   SourcesWriter(string BOverrides,string SOverrides,
152
 
                 string ExtOverrides=string());
 
151
   SourcesWriter(string const &BOverrides,string const &SOverrides,
 
152
                 string const &ExtOverrides=string());
153
153
   virtual ~SourcesWriter() {free(Buffer);};
154
154
};
155
155
 
156
156
class ReleaseWriter : public FTWScanner
157
157
{
158
158
public:
159
 
   ReleaseWriter(string DB);
 
159
   ReleaseWriter(string const &DB);
160
160
   virtual bool DoPackage(string FileName);
161
161
   void Finish();
162
162