]>
git.saurik.com Git - apt.git/blob - ftparchive/contents.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: contents.h,v 1.2 2001/02/20 07:03:18 jgg Exp $
4 /* ######################################################################
6 contents - Contents of archive things.
8 ##################################################################### */
13 #include <apt-pkg/dirstream.h>
34 void *operator new(size_t Amount
,GenContents
*Owner
);
35 void operator delete(void *) {};
37 Node() : BTreeLeft(0), BTreeRight(0), DirDown(0), Dups(0),
38 Path(0), Package(0) {};
50 // Big block allocation pools
53 unsigned long StrLeft
;
55 unsigned long NodeLeft
;
57 Node
*Grab(Node
*Top
,const char *Name
,const char *Package
);
58 void WriteSpace(std::string
&out
, size_t Current
, size_t Target
);
59 void DoPrint(FileFd
&Out
,Node
*Top
, char *Buf
);
63 char *Mystrdup(const char *From
);
64 void Add(const char *Dir
,const char *Package
);
65 void Print(FileFd
&Out
);
67 GenContents() : BlockList(0), StrPool(0), StrLeft(0),
68 NodePool(0), NodeLeft(0) {};
72 class ContentsExtract
: public pkgDirStream
78 unsigned long long MaxSize
;
79 unsigned long long CurSize
;
80 void AddData(const char *Text
);
82 bool Read(debDebFile
&Deb
);
84 virtual bool DoItem(Item
&Itm
,int &Fd
);
85 void Reset() {CurSize
= 0;};
86 bool TakeContents(const void *Data
,unsigned long long Length
);
87 void Add(GenContents
&Contents
,std::string
const &Package
);
90 virtual ~ContentsExtract();