apt  2.2.4
About: Apt (Advanced Package Tool) is a management system for software packages (Debian/Ubuntu). Release series 2.2.
  Fossies Dox: apt-2.2.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

versionmatch.h
Go to the documentation of this file.
1 // -*- mode: cpp; mode: fold -*-
2 // Description /*{{{*/
3 /* ######################################################################
4 
5  Version Matching
6 
7  This module takes a matching string and a type and locates the version
8  record that satisfies the constraint described by the matching string.
9 
10  Version: 1.2*
11  Release: o=Debian,v=2.1*,c=main
12  Release: v=2.1*
13  Release: a=testing
14  Release: n=squeeze
15  Release: *
16  Origin: ftp.debian.org
17 
18  Release may be a complex type that can specify matches for any of:
19  Version (v= with prefix)
20  Origin (o=)
21  Archive (a=) eg, unstable, testing, stable
22  Codename (n=) e.g. etch, lenny, squeeze, sid
23  Label (l=)
24  Component (c=)
25  Binary Architecture (b=)
26  If there are no equals signs in the string then it is scanned in short
27  form - if it starts with a number it is Version otherwise it is an
28  Archive or a Codename.
29 
30  Release may be a '*' to match all releases.
31 
32  ##################################################################### */
33  /*}}}*/
34 #ifndef PKGLIB_VERSIONMATCH_H
35 #define PKGLIB_VERSIONMATCH_H
36 
37 #include <apt-pkg/pkgcache.h>
38 
39 #include <string>
40 
41 
43 {
44  // Version Matching
45  std::string VerStr;
47 
48  // Release Matching
49  std::string RelVerStr;
51  std::string RelOrigin;
52  std::string RelRelease;
53  std::string RelCodename;
54  std::string RelArchive;
55  std::string RelLabel;
56  std::string RelComponent;
57  std::string RelArchitecture;
58  bool MatchAll;
59 
60  // Origin Matching
61  std::string OrSite;
62 
63  public:
64 
65  enum MatchType {None = 0,Version,Release,Origin} Type;
66 
67  bool MatchVer(const char *A,std::string B,bool Prefix) APT_PURE;
68  static bool ExpressionMatches(const char *pattern, const char *string);
69  static bool ExpressionMatches(const std::string& pattern, const char *string);
70  bool FileMatch(pkgCache::PkgFileIterator File);
72  bool VersionMatches(pkgCache::VerIterator Ver);
73 
74  pkgVersionMatch(std::string Data,MatchType Type);
75 };
76 
77 #endif
std::string RelLabel
Definition: versionmatch.h:55
std::string VerStr
Definition: versionmatch.h:45
std::string OrSite
Definition: versionmatch.h:61
std::string RelArchitecture
Definition: versionmatch.h:57
std::string RelArchive
Definition: versionmatch.h:54
std::string RelOrigin
Definition: versionmatch.h:51
std::string RelCodename
Definition: versionmatch.h:53
bool RelVerPrefixMatch
Definition: versionmatch.h:50
std::string RelComponent
Definition: versionmatch.h:56
std::string RelRelease
Definition: versionmatch.h:52
std::string RelVerStr
Definition: versionmatch.h:49
#define APT_PURE
Definition: macros.h:56
#define APT_PUBLIC
Definition: macros.h:77
pkgCache - Structure definitions for the cache file