]>
git.saurik.com Git - apt.git/blob - apt-inst/deb/debfile.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: debfile.h,v 1.2 2001/02/20 07:03:17 jgg Exp $
4 /* ######################################################################
6 Debian Archive File (.deb)
8 This Class handles all the operations performed directly on .deb
9 files. It makes use of the AR and TAR classes to give the necessary
12 There are only two things that can be done with a raw package,
13 extract it's control information and extract the contents itself.
15 This should probably subclass an as-yet unwritten super class to
16 produce a generic archive mechanism.
18 The memory control file extractor is useful to extract a single file
19 into memory from the control.tar.gz
21 ##################################################################### */
23 #ifndef PKGLIB_DEBFILE_H
24 #define PKGLIB_DEBFILE_H
27 #include <apt-pkg/arfile.h>
28 #include <apt-pkg/dirstream.h>
29 #include <apt-pkg/tagfile.h>
30 #include <apt-pkg/macros.h>
34 #ifndef APT_8_CLEANER_HEADERS
35 #include <apt-pkg/md5.h>
37 #ifndef APT_10_CLEANER_HEADERS
38 #include <apt-pkg/pkgcache.h>
50 bool CheckMember(const char *Name
);
54 class MemControlExtract
;
56 bool ExtractTarMember(pkgDirStream
&Stream
, const char *Name
);
57 bool ExtractArchive(pkgDirStream
&Stream
);
58 const ARArchive::Member
*GotoMember(const char *Name
);
59 inline FileFd
&GetFile() {return File
;};
61 debDebFile(FileFd
&File
);
64 class debDebFile::ControlExtract
: public pkgDirStream
68 virtual bool DoItem(Item
&Itm
,int &Fd
);
71 class debDebFile::MemControlExtract
: public pkgDirStream
78 pkgTagSection Section
;
82 // Members from DirStream
83 virtual bool DoItem(Item
&Itm
,int &Fd
);
84 virtual bool Process(Item
&Itm
,const unsigned char *Data
,
85 #if APT_PKG_ABI >= 413
86 unsigned long long Size
,unsigned long long Pos
);
88 unsigned long Size
,unsigned long Pos
);
92 bool Read(debDebFile
&Deb
);
93 #if APT_PKG_ABI >= 413
94 bool TakeControl(const void *Data
,unsigned long long Size
);
96 bool TakeControl(const void *Data
,unsigned long Size
);
99 MemControlExtract() : IsControl(false), Control(0), Length(0), Member("control") {};
100 MemControlExtract(std::string Member
) : IsControl(false), Control(0), Length(0), Member(Member
) {};
101 ~MemControlExtract() {delete [] Control
;};