]>
git.saurik.com Git - apt-legacy.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
17 #pragma interface "apt-pkg/srcrecords.h"
32 // Describes a single file
41 // Abstract parser for each source record
46 const pkgIndexFile
*iIndex
;
50 enum BuildDep
{BuildDepend
=0x0,BuildDependIndep
=0x1,
51 BuildConflict
=0x2,BuildConflictIndep
=0x3};
61 inline const pkgIndexFile
&Index() const {return *iIndex
;};
63 virtual bool Restart() = 0;
64 virtual bool Step() = 0;
65 virtual bool Jump(unsigned long Off
) = 0;
66 virtual unsigned long Offset() = 0;
67 virtual string
AsStr() = 0;
69 virtual string
Package() const = 0;
70 virtual string
Version() const = 0;
71 virtual string
Maintainer() const = 0;
72 virtual string
Section() const = 0;
73 virtual const char **Binaries() = 0; // Ownership does not transfer
75 virtual bool BuildDepends(vector
<BuildDepRec
> &BuildDeps
, bool ArchOnly
) = 0;
76 static const char *BuildDepType(unsigned char Type
);
78 virtual bool Files(vector
<pkgSrcRecords::File
> &F
) = 0;
80 Parser(const pkgIndexFile
*Index
) : iIndex(Index
) {};
86 // The list of files and the current parser pointer
87 vector
<Parser
*> Files
;
88 vector
<Parser
*>::iterator Current
;
95 // Locate a package by name
96 Parser
*Find(const char *Package
,bool SrcOnly
= false);
98 pkgSrcRecords(pkgSourceList
&List
);