00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef PKGLIB_VERSIONMATCH_H
00036 #define PKGLIB_VERSIONMATCH_H
00037
00038
00039 #include <string>
00040 #include <apt-pkg/pkgcache.h>
00041
00042 using std::string;
00043
00044 class pkgVersionMatch
00045 {
00046
00047 string VerStr;
00048 bool VerPrefixMatch;
00049
00050
00051 string RelVerStr;
00052 bool RelVerPrefixMatch;
00053 string RelOrigin;
00054 string RelRelease;
00055 string RelCodename;
00056 string RelArchive;
00057 string RelLabel;
00058 string RelComponent;
00059 string RelArchitecture;
00060 bool MatchAll;
00061
00062
00063 string OrSite;
00064
00065 public:
00066
00067 enum MatchType {None = 0,Version,Release,Origin} Type;
00068
00069 bool MatchVer(const char *A,string B,bool Prefix);
00070 bool ExpressionMatches(const char *pattern, const char *string);
00071 bool ExpressionMatches(const std::string& pattern, const char *string);
00072 bool FileMatch(pkgCache::PkgFileIterator File);
00073 pkgCache::VerIterator Find(pkgCache::PkgIterator Pkg);
00074
00075 pkgVersionMatch(string Data,MatchType Type);
00076 };
00077
00078 #endif