]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/pkgcachegen.h
use references instead of copies in the Cache generation methods
[apt.git] / apt-pkg / pkgcachegen.h
index ff0941e0c88018f377fd5659d91201390ce503e5..8f7739165088e450fbb56a68958fe2c8dc18a154 100644 (file)
@@ -31,9 +31,13 @@ class pkgIndexFile;
 class pkgCacheGenerator                                                        /*{{{*/
 {
    private:
-   
+
    pkgCache::StringItem *UniqHash[26];
-   
+   unsigned long WriteStringInMap(std::string const &String) { return WriteStringInMap(String.c_str()); };
+   unsigned long WriteStringInMap(const char *String);
+   unsigned long WriteStringInMap(const char *String, const unsigned long &Len);
+   unsigned long AllocateInMap(const unsigned long &size);
+
    public:
    
    class ListParser;
@@ -103,12 +107,12 @@ class pkgCacheGenerator::ListParser
 
    inline unsigned long WriteUniqString(string S) {return Owner->WriteUniqString(S);};
    inline unsigned long WriteUniqString(const char *S,unsigned int Size) {return Owner->WriteUniqString(S,Size);};
-   inline unsigned long WriteString(const string &S) {return Owner->Map.WriteString(S);};
-   inline unsigned long WriteString(const char *S,unsigned int Size) {return Owner->Map.WriteString(S,Size);};
-   bool NewDepends(pkgCache::VerIterator Ver,const string &Package, const string &Arch,
+   inline unsigned long WriteString(const string &S) {return Owner->WriteStringInMap(S);};
+   inline unsigned long WriteString(const char *S,unsigned int Size) {return Owner->WriteStringInMap(S,Size);};
+   bool NewDepends(pkgCache::VerIterator &Ver,const string &Package, const string &Arch,
                   const string &Version,unsigned int Op,
                   unsigned int Type);
-   bool NewProvides(pkgCache::VerIterator Ver,const string &PkgName,
+   bool NewProvides(pkgCache::VerIterator &Ver,const string &PkgName,
                    const string &PkgArch, const string &Version);
    
    public:
@@ -118,13 +122,13 @@ class pkgCacheGenerator::ListParser
    virtual string Architecture() = 0;
    virtual bool ArchitectureAll() = 0;
    virtual string Version() = 0;
-   virtual bool NewVersion(pkgCache::VerIterator Ver) = 0;
+   virtual bool NewVersion(pkgCache::VerIterator &Ver) = 0;
    virtual string Description() = 0;
    virtual string DescriptionLanguage() = 0;
    virtual MD5SumValue Description_md5() = 0;
    virtual unsigned short VersionHash() = 0;
-   virtual bool UsePackage(pkgCache::PkgIterator Pkg,
-                          pkgCache::VerIterator Ver) = 0;
+   virtual bool UsePackage(pkgCache::PkgIterator &Pkg,
+                          pkgCache::VerIterator &Ver) = 0;
    virtual unsigned long Offset() = 0;
    virtual unsigned long Size() = 0;
    
@@ -132,7 +136,7 @@ class pkgCacheGenerator::ListParser
    
    inline bool HasFileDeps() {return FoundFileDeps;};
    virtual bool CollectFileProvides(pkgCache &Cache,
-                                   pkgCache::VerIterator Ver) {return true;};
+                                   pkgCache::VerIterator &Ver) {return true;};
 
    ListParser() : FoundFileDeps(false) {};
    virtual ~ListParser() {};