]>
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 ##################################################################### */
15 #include <apt-pkg/debfile.h>
16 #include <apt-pkg/dirstream.h>
30 void *operator new(size_t Amount
,GenContents
*Owner
);
31 void operator delete(void *) {};
33 Node() : BTreeLeft(0), BTreeRight(0), DirDown(0), Dups(0),
34 Path(0), Package(0) {};
46 // Big block allocation pools
49 unsigned long StrLeft
;
51 unsigned long NodeLeft
;
53 Node
*Grab(Node
*Top
,const char *Name
,const char *Package
);
54 void WriteSpace(FILE *Out
,unsigned int Current
,unsigned int Target
);
55 void DoPrint(FILE *Out
,Node
*Top
, char *Buf
);
59 char *Mystrdup(const char *From
);
60 void Add(const char *Dir
,const char *Package
);
61 void Print(FILE *Out
);
63 GenContents() : BlockList(0), StrPool(0), StrLeft(0),
64 NodePool(0), NodeLeft(0) {};
68 class ContentsExtract
: public pkgDirStream
74 unsigned long MaxSize
;
75 unsigned long CurSize
;
76 void AddData(const char *Text
);
78 bool Read(debDebFile
&Deb
);
80 virtual bool DoItem(Item
&Itm
,int &Fd
);
81 void Reset() {CurSize
= 0;};
82 bool TakeContents(const void *Data
,unsigned long Length
);
83 void Add(GenContents
&Contents
,string Package
);
85 ContentsExtract() : Data(0), MaxSize(0), CurSize(0) {};
86 virtual ~ContentsExtract() {delete [] Data
;};