apt: apt-pkg/dirstream.h Source File

apt 3.1.16 commandline package manager

dirstream.h
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
3/* ######################################################################
4
5 Directory Stream
6
7 When unpacking the contents of the archive are passed into a directory
8 stream class for analysis and processing. The class controls all aspects
9 of actually writing the directory stream from disk. The low level
10 archive handlers are only responsible for decoding the archive format
11 and sending events (via method calls) to the specified directory
12 stream.
13
14 When unpacking a real file the archive handler is passed back a file
15 handle to write the data to, this is to support strange
16 archives+unpacking methods. If that fd is -1 then the file data is
17 simply ignored.
18
19 The provided defaults do the 'Right Thing' for a normal unpacking
20 process (ie 'tar')
21
22 ##################################################################### */
23 /*}}}*/
24#ifndef PKGLIB_DIRSTREAM_H
25#define PKGLIB_DIRSTREAM_H
26
27#include <apt-pkg/macros.h>
28
29 class APT_PUBLIC pkgDirStream
30{
31 public:
32
33 // All possible information about a component
34 struct Item
35 {
36 enum Type_t {File, HardLink, SymbolicLink, CharDevice, BlockDevice,
37 Directory, FIFO} Type;
38 char *Name;
39 char *LinkTarget;
40 unsigned long Mode;
41 unsigned long UID;
42 unsigned long GID;
43 unsigned long long Size;
44 unsigned long MTime;
45 unsigned long Major;
46 unsigned long Minor;
47 };
48
49 virtual bool DoItem(Item &Itm,int &Fd);
50 virtual bool Fail(Item &Itm,int Fd);
51 virtual bool FinishedFile(Item &Itm,int Fd);
52 virtual bool Process(Item &/*Itm*/,const unsigned char * /*Data*/,
53 unsigned long long /*Size*/,unsigned long long /*Pos*/) {return true;};
54 virtual ~pkgDirStream() {};
55};
56
57#endif
pkgDirStream
Definition dirstream.h:30
pkgDirStream::Item
Definition dirstream.h:35