]>
Commit | Line | Data |
---|---|---|
7b606ae5 RC |
1 | /* |
2 | * Copyright (c) 2001, Robert Collins. | |
3 | * | |
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. | |
8 | * | |
9 | * A copy of the GNU General Public License can be found at | |
10 | * http://www.gnu.org/ | |
11 | * | |
12 | * Written by Robert Collins <rbtcollins@hotmail.com> | |
13 | * | |
14 | */ | |
15 | ||
16 | /* categories for packages */ | |
17 | ||
18 | #ifndef _CATEGORY_H_ | |
19 | #define _CATEGORY_H_ | |
20 | ||
3c054baf | 21 | #include "String++.h" |
405d7186 | 22 | #include <vector> |
3c054baf | 23 | |
d343da15 | 24 | class Category; |
405d7186 | 25 | class packagemeta; |
7b606ae5 | 26 | |
d343da15 RC |
27 | int Categorycmp (Category const &, Category const &); |
28 | // Grrr template problem - couldn't get list to use int Ucmp (U const, U const), | |
29 | // and gcc wouldn't cast on the fly. | |
30 | int Categorycmp (Category &, Category &); | |
31 | ||
7b606ae5 RC |
32 | class Category |
33 | { | |
34 | public: | |
35 | Category (); | |
3c054baf | 36 | Category (String const &); |
d343da15 | 37 | bool operator== (Category const &rhs) const {return Categorycmp (*this, rhs) ? false : true;} |
405d7186 | 38 | bool operator < (Category const &rhs) const {return Categorycmp (*this, rhs) < 0;} |
7b606ae5 RC |
39 | |
40 | Category *next; /* the next category in the list */ | |
3c054baf RC |
41 | String const name; /* the category */ |
42 | String const key; /* always == name */ | |
405d7186 | 43 | vector <packagemeta *> packages; /* the packages in this category */ |
7b606ae5 RC |
44 | }; |
45 | ||
7b606ae5 | 46 | #endif /* _CATEGORY_H_ */ |