]> git.saurik.com Git - apt.git/blob - apt-inst/contrib/arfile.h
po/es.po: Updated, plus fixes encoding issues and fixes two fuzzy
[apt.git] / apt-inst / contrib / arfile.h
1 // -*- mode: cpp; mode: fold -*-
2 // Description /*{{{*/
3 // $Id: arfile.h,v 1.2 2001/02/20 07:03:16 jgg Exp $
4 /* ######################################################################
5
6 AR File - Handle an 'AR' archive
7
8 This is a reader for the usual 4.4 BSD AR format. It allows raw
9 stream access to a single member at a time. Basically all this class
10 provides is header parsing and verification. It is up to the client
11 to correctly make use of the stream start/stop points.
12
13 ##################################################################### */
14 /*}}}*/
15 #ifndef PKGLIB_ARFILE_H
16 #define PKGLIB_ARFILE_H
17
18
19 #include <string>
20 #include <apt-pkg/fileutl.h>
21
22 class ARArchive
23 {
24 struct MemberHeader;
25 public:
26 struct Member;
27
28 protected:
29
30 // Linked list of members
31 Member *List;
32
33 bool LoadHeaders();
34
35 public:
36
37 // The stream file
38 FileFd &File;
39
40 // Locate a member by name
41 const Member *FindMember(const char *Name) const;
42 inline Member *Members() { return List; }
43
44 ARArchive(FileFd &File);
45 ~ARArchive();
46 };
47
48 // A member of the archive
49 struct ARArchive::Member
50 {
51 // Fields from the header
52 string Name;
53 unsigned long MTime;
54 unsigned long UID;
55 unsigned long GID;
56 unsigned long Mode;
57 unsigned long Size;
58
59 // Location of the data.
60 unsigned long Start;
61 Member *Next;
62
63 Member() : Start(0), Next(0) {};
64 };
65
66 #endif