~mvo/apt/mvo

« back to all changes in this revision

Viewing changes to apt-pkg/versionmatch.h

  • Committer: Arch Librarian
  • Date: 2004-09-20 16:56:32 UTC
  • Revision ID: Arch-1:apt@arch.ubuntu.com%apt--MAIN--0--patch-614
Join with aliencode
Author: jgg
Date: 2001-02-20 07:03:16 GMT
Join with aliencode

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- mode: cpp; mode: fold -*-
 
2
// Description                                                          /*{{{*/
 
3
// $Id: versionmatch.h,v 1.2 2001/02/20 07:03:17 jgg Exp $
 
4
/* ######################################################################
 
5
 
 
6
   Version Matching 
 
7
   
 
8
   This module takes a matching string and a type and locates the version
 
9
   record that satisfies the constraint described by the matching string.
 
10
 
 
11
     Version: 1.2*
 
12
     Release: o=Debian,v=2.1*,c=main
 
13
     Release: v=2.1*
 
14
     Release: *
 
15
     Origin: ftp.debian.org
 
16
   
 
17
   Release may be a complex type that can specify matches for any of:
 
18
      Version (v= with prefix)
 
19
      Origin (o=)
 
20
      Archive (a=)
 
21
      Label (l=)
 
22
      Component (c=)
 
23
   If there are no equals signs in the string then it is scanned in short
 
24
   form - if it starts with a number it is Version otherwise it is an 
 
25
   Archive.
 
26
   
 
27
   Release may be a '*' to match all releases.
 
28
   
 
29
   ##################################################################### */
 
30
                                                                        /*}}}*/
 
31
#ifndef PKGLIB_VERSIONMATCH_H
 
32
#define PKGLIB_VERSIONMATCH_H
 
33
 
 
34
#ifdef __GNUG__
 
35
#pragma interface "apt-pkg/versionmatch.h"
 
36
#endif
 
37
 
 
38
#include <string>
 
39
#include <apt-pkg/pkgcache.h>
 
40
 
 
41
class pkgVersionMatch
 
42
{
 
43
   // Version Matching
 
44
   string VerStr;
 
45
   bool VerPrefixMatch;
 
46
 
 
47
   // Release Matching
 
48
   string RelVerStr;
 
49
   bool RelVerPrefixMatch;
 
50
   string RelOrigin;
 
51
   string RelArchive;
 
52
   string RelLabel;
 
53
   string RelComponent;
 
54
 
 
55
   // Origin Matching
 
56
   string OrSite;
 
57
   
 
58
   public:
 
59
   
 
60
   enum MatchType {None = 0,Version,Release,Origin} Type;
 
61
   
 
62
   bool MatchVer(const char *A,string B,bool Prefix);
 
63
   bool FileMatch(pkgCache::PkgFileIterator File);
 
64
   pkgCache::VerIterator Find(pkgCache::PkgIterator Pkg);
 
65
                               
 
66
   pkgVersionMatch(string Data,MatchType Type);
 
67
};
 
68
 
 
69
#endif