]>
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/dirstream.h>
31 void *operator new(size_t Amount
,GenContents
*Owner
);
32 void operator delete(void *) {};
34 Node() : BTreeLeft(0), BTreeRight(0), DirDown(0), Dups(0),
35 Path(0), Package(0) {};
47 // Big block allocation pools
50 unsigned long StrLeft
;
52 unsigned long NodeLeft
;
54 Node
*Grab(Node
*Top
,const char *Name
,const char *Package
);
55 void WriteSpace(FILE *Out
,unsigned int Current
,unsigned int Target
);
56 void DoPrint(FILE *Out
,Node
*Top
, char *Buf
);
60 char *Mystrdup(const char *From
);
61 void Add(const char *Dir
,const char *Package
);
62 void Print(FILE *Out
);
64 GenContents() : BlockList(0), StrPool(0), StrLeft(0),
65 NodePool(0), NodeLeft(0) {};
69 class ContentsExtract
: public pkgDirStream
75 unsigned long long MaxSize
;
76 unsigned long long CurSize
;
77 void AddData(const char *Text
);
79 bool Read(debDebFile
&Deb
);
81 virtual bool DoItem(Item
&Itm
,int &Fd
);
82 void Reset() {CurSize
= 0;};
83 bool TakeContents(const void *Data
,unsigned long long Length
);
84 void Add(GenContents
&Contents
,std::string
const &Package
);
86 ContentsExtract() : Data(0), MaxSize(0), CurSize(0) {};
87 virtual ~ContentsExtract() {delete [] Data
;};