]>
git.saurik.com Git - apt.git/blob - apt-pkg/deb/debsrcrecords.cc
bfbb9e202b60518655d55d44ae234e7907bd729a
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: debsrcrecords.cc,v 1.1 1999/04/04 01:17:29 jgg Exp $
4 /* ######################################################################
6 Debian Source Package Records - Parser implementation for Debian style
9 ##################################################################### */
11 // Include Files /*{{{*/
13 #pragma implementation "apt-pkg/debsrcrecords.h"
16 #include <apt-pkg/debsrcrecords.h>
17 #include <apt-pkg/error.h>
20 // SrcRecordParser::Binaries - Return the binaries field /*{{{*/
21 // ---------------------------------------------------------------------
22 /* This member parses the binaries field into a pair of class arrays and
23 returns a list of strings representing all of the components of the
24 binaries field. The returned array need not be freed and will be
25 reused by the next Binaries function call. */
26 const char **debSrcRecordParser::Binaries()
28 string Bins
= Sect
.FindS("Binary");
31 if (Bins
.empty() == true)
34 // Strip any leading spaces
35 string::const_iterator Start
= Bins
.begin();
36 for (; Start
!= Bins
.end() && isspace(*Start
) != 0; Start
++);
38 string::const_iterator Pos
= Start
;
39 while (Pos
!= Bins
.end())
41 // Skip to the next ','
42 for (; Pos
!= Bins
.end() && *Pos
!= ','; Pos
++);
45 string::const_iterator End
= Pos
;
46 for (; End
> Start
&& (End
[-1] == ',' || isspace(End
[-1]) != 0); End
--);
49 memcpy(Buf
,Start
,End
-Start
);
50 StaticBinList
[Bin
] = Buf
;
56 for (; Pos
!= Bins
.end() && (*Pos
== ',' || isspace(*Pos
) != 0); Pos
++);
60 StaticBinList
[Bin
] = 0;