]>
cygwin.com Git - cygwin-apps/setup.git/blob - PackageSpecification.cc
012abb8a74b67561b3685178a9bc38a95a9cf48c
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>
17 static const char *cvsid
= "\n%%% $Id$\n";
20 #include "PackageSpecification.h"
21 #include "package_version.h"
23 PackageSpecification::PackageSpecification (String
const &packageName
)
24 : _packageName (packageName
) , _operator (0), _version ()
29 PackageSpecification::packageName () const
35 PackageSpecification::setOperator (_operators
const &anOperator
)
37 _operator
= &anOperator
;
41 PackageSpecification::setVersion (String
const &aVersion
)
47 PackageSpecification::satisfies (packageversion
const &aPackage
) const
53 PackageSpecification::serialise () const
58 PackageSpecification
&
59 PackageSpecification::operator= (PackageSpecification
const &rhs
)
61 _packageName
= rhs
._packageName
;
66 operator << (std::ostream
&os
, PackageSpecification
const &spec
)
68 os
<< spec
._packageName
;
70 os
<< " " << spec
._operator
->caption() << " " << spec
._version
;
74 const PackageSpecification::_operators
PackageSpecification::Equals(0);
75 const PackageSpecification::_operators
PackageSpecification::LessThan(1);
76 const PackageSpecification::_operators
PackageSpecification::MoreThan(2);
77 const PackageSpecification::_operators
PackageSpecification::LessThanEquals(3);
78 const PackageSpecification::_operators
PackageSpecification::MoreThanEquals(4);
81 PackageSpecification::_operators::caption () const
96 // Pacify GCC: (all case options are checked above)
97 return "Unknown operator";
This page took 0.095566 seconds and 5 git commands to generate.