]>
git.saurik.com Git - apt.git/blob - apt-pkg/srcrecords.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: srcrecords.h,v 1.8.2.1 2003/12/26 16:27:34 mdz Exp $
4 /* ######################################################################
6 Source Package Records - Allows access to source package records
8 Parses and allows access to the list of source records and searching by
9 source name on that list.
11 ##################################################################### */
13 #ifndef PKGLIB_SRCRECORDS_H
14 #define PKGLIB_SRCRECORDS_H
29 // Describes a single file
38 // Abstract parser for each source record
43 const pkgIndexFile
*iIndex
;
47 enum BuildDep
{BuildDepend
=0x0,BuildDependIndep
=0x1,
48 BuildConflict
=0x2,BuildConflictIndep
=0x3};
58 inline const pkgIndexFile
&Index() const {return *iIndex
;};
60 virtual bool Restart() = 0;
61 virtual bool Step() = 0;
62 virtual bool Jump(unsigned long Off
) = 0;
63 virtual unsigned long Offset() = 0;
64 virtual string
AsStr() = 0;
66 virtual string
Package() const = 0;
67 virtual string
Version() const = 0;
68 virtual string
Maintainer() const = 0;
69 virtual string
Section() const = 0;
70 virtual const char **Binaries() = 0; // Ownership does not transfer
72 virtual bool BuildDepends(vector
<BuildDepRec
> &BuildDeps
, bool ArchOnly
) = 0;
73 static const char *BuildDepType(unsigned char Type
);
75 virtual bool Files(vector
<pkgSrcRecords::File
> &F
) = 0;
77 Parser(const pkgIndexFile
*Index
) : iIndex(Index
) {};
83 // The list of files and the current parser pointer
84 vector
<Parser
*> Files
;
85 vector
<Parser
*>::iterator Current
;
92 // Locate a package by name
93 Parser
*Find(const char *Package
,bool SrcOnly
= false);
95 pkgSrcRecords(pkgSourceList
&List
);