2 * Copyright (c) 2002, Robert Collins.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * A copy of the GNU General Public License can be found at
12 * Written by Robert Collins <rbtcollins@hotmail.com>
16 #ifndef SETUP_PACKAGESPECIFICATION_H
17 #define SETUP_PACKAGESPECIFICATION_H
22 class SolvableVersion
;
23 typedef SolvableVersion packageversion
;
25 /* Describe a package - i.e. we need version 5 of apt */
27 class PackageSpecification
30 PackageSpecification () : _packageName (), _operator(Equals
) {}
31 PackageSpecification (const std::string
& packageName
);
32 PackageSpecification (const std::string
& packageName
,
33 const std::string
&packageVersion
);
34 ~PackageSpecification () {}
45 const std::string
& packageName() const;
46 const _operators
op() const;
47 const std::string
& version() const;
49 void setOperator (_operators
);
50 void setVersion (const std::string
& );
52 bool satisfies (packageversion
const &) const;
54 friend std::ostream
&operator << (std::ostream
&, PackageSpecification
const &);
57 static char const * caption (_operators _value
);
59 std::string _packageName
; /* foobar */
60 _operators _operator
; /* >= */
61 std::string _version
; /* 1.20 */
65 operator << (std::ostream
&os
, PackageSpecification
const &);
67 #endif /* SETUP_PACKAGESPECIFICATION_H */