]>
git.saurik.com Git - apt.git/blob - ftparchive/contents.h
f58e3278ec14f9cd521bc1aea0cf8e93d2e129e8
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>
33 void *operator new(size_t Amount
,GenContents
*Owner
);
34 void operator delete(void *) {};
36 Node() : BTreeLeft(0), BTreeRight(0), DirDown(0), Dups(0),
37 Path(0), Package(0) {};
49 // Big block allocation pools
52 unsigned long StrLeft
;
54 unsigned long NodeLeft
;
56 Node
*Grab(Node
*Top
,const char *Name
,const char *Package
);
57 void WriteSpace(FILE *Out
,unsigned int Current
,unsigned int Target
);
58 void DoPrint(FILE *Out
,Node
*Top
, char *Buf
);
62 char *Mystrdup(const char *From
);
63 void Add(const char *Dir
,const char *Package
);
64 void Print(FILE *Out
);
66 GenContents() : BlockList(0), StrPool(0), StrLeft(0),
67 NodePool(0), NodeLeft(0) {};
71 class ContentsExtract
: public pkgDirStream
77 unsigned long long MaxSize
;
78 unsigned long long CurSize
;
79 void AddData(const char *Text
);
81 bool Read(debDebFile
&Deb
);
83 virtual bool DoItem(Item
&Itm
,int &Fd
);
84 void Reset() {CurSize
= 0;};
85 bool TakeContents(const void *Data
,unsigned long long Length
);
86 void Add(GenContents
&Contents
,std::string
const &Package
);
89 virtual ~ContentsExtract();