]> git.saurik.com Git - apt.git/commitdiff
The fastest way to get field values is as a range.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 30 Nov 2016 08:39:04 +0000 (00:39 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 30 Nov 2016 08:39:04 +0000 (00:39 -0800)
apt-pkg/deb/debrecords.cc
apt-pkg/deb/debrecords.h
apt-pkg/pkgrecords.h

index 6d642c7b87d645b71fe449e76904fe2999ec9cf5..e7025d9111d280488be3079a4dbd475b15bdef1e 100644 (file)
@@ -210,6 +210,12 @@ void debRecordParserBase::GetRec(const char *&Start,const char *&Stop)
    Section.GetSection(Start,Stop);
 }
                                                                        /*}}}*/
+// RecordParserBase::Find - Locate a tag                       /*{{{*/
+bool debRecordParserBase::Find(const char *Tag,const char *&Start, const char *&End)
+{
+   return Section.Find(Tag,Start,End);
+}
+                                                                       /*}}}*/
 debRecordParserBase::~debRecordParserBase() {}
 
 bool debDebFileRecordParser::LoadContent()
index 8f443c9a33238c5098ec06a4405b80f8fb3d845e..b412dbaefca181ab49f652086ad921a0c2428c22 100644 (file)
@@ -51,6 +51,7 @@ class APT_HIDDEN debRecordParserBase : public pkgRecords::Parser
    virtual std::string RecordField(const char *fieldName) APT_OVERRIDE;
 
    virtual void GetRec(const char *&Start,const char *&Stop) APT_OVERRIDE;
+   virtual bool Find(const char *Tag,const char *&Start, const char *&End) APT_OVERRIDE;
 
    debRecordParserBase();
    virtual ~debRecordParserBase();
index a151fa12335f6827b18f9b3b1897f33afebd0285..b5eec305e388ba8f5d0c27647405e8de84de45ee 100644 (file)
@@ -101,6 +101,9 @@ class pkgRecords::Parser                                            /*{{{*/
    // The record in binary form
    virtual void GetRec(const char *&Start,const char *&Stop) {Start = Stop = 0;};
 
+   // Locate a tag
+   virtual bool Find(const char *Tag,const char *&Start, const char *&End) {Start = End = 0; return false;};
+
    Parser();
    virtual ~Parser();