]>
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
26 // Describes a single file
35 // Abstract parser for each source record
40 const pkgIndexFile
*iIndex
;
44 enum BuildDep
{BuildDepend
=0x0,BuildDependIndep
=0x1,
45 BuildConflict
=0x2,BuildConflictIndep
=0x3};
55 inline const pkgIndexFile
&Index() const {return *iIndex
;};
57 virtual bool Restart() = 0;
58 virtual bool Step() = 0;
59 virtual bool Jump(unsigned long const &Off
) = 0;
60 virtual unsigned long Offset() = 0;
61 virtual std::string
AsStr() = 0;
63 virtual std::string
Package() const = 0;
64 virtual std::string
Version() const = 0;
65 virtual std::string
Maintainer() const = 0;
66 virtual std::string
Section() const = 0;
67 virtual const char **Binaries() = 0; // Ownership does not transfer
69 virtual bool BuildDepends(std::vector
<BuildDepRec
> &BuildDeps
, bool const &ArchOnly
, bool const &StripMultiArch
= true) = 0;
70 static const char *BuildDepType(unsigned char const &Type
);
72 virtual bool Files(std::vector
<pkgSrcRecords::File
> &F
) = 0;
74 Parser(const pkgIndexFile
*Index
) : iIndex(Index
) {};
79 /** \brief dpointer placeholder (for later in case we need it) */
82 // The list of files and the current parser pointer
83 std::vector
<Parser
*> Files
;
84 std::vector
<Parser
*>::iterator Current
;
91 // Locate a package by name
92 Parser
*Find(const char *Package
,bool const &SrcOnly
= false);
94 pkgSrcRecords(pkgSourceList
&List
);
95 virtual ~pkgSrcRecords();