]>
Commit | Line | Data |
---|---|---|
7939f6d1 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 | #ifndef _PACKAGE_DB_H_ | |
17 | #define _PACKAGE_DB_H_ | |
18 | ||
4fe323f9 | 19 | /* required to parse this file */ |
3c054baf | 20 | #include <String++.h> |
0cf68afd RC |
21 | #include <vector> |
22 | #include <map> | |
23 | #include "list.h" | |
24 | #include "category.h" | |
7939f6d1 | 25 | class packagemeta; |
7b606ae5 | 26 | class io_stream; |
3c196821 | 27 | class PackageSpecification; |
7939f6d1 | 28 | |
cbfc4215 RC |
29 | typedef enum { |
30 | PackageDB_Install, | |
31 | PackageDB_Download | |
32 | } PackageDBActions; | |
33 | ||
7939f6d1 RC |
34 | /*TODO: add mutexs */ |
35 | class packagedb | |
36 | { | |
37 | public: | |
38 | packagedb (); | |
7c7034e8 RC |
39 | /* 0 on success */ |
40 | int flush (); | |
3c196821 RC |
41 | packagemeta * findBinary (PackageSpecification const &) const; |
42 | packagemeta * findSource (PackageSpecification const &) const; | |
08cd08c3 | 43 | /* all seen binary packages */ |
3c054baf | 44 | static list < packagemeta, String, String::casecompare > packages; |
08cd08c3 RC |
45 | /* all seen source packages */ |
46 | static vector <packagemeta *> sourcePackages; | |
7b606ae5 | 47 | /* all seen categories */ |
0cf68afd RC |
48 | typedef map <String, vector <packagemeta *>, String::caseless > categoriesType; |
49 | static categoriesType categories; | |
cbfc4215 | 50 | static PackageDBActions task; |
7939f6d1 | 51 | private: |
7939f6d1 RC |
52 | static int installeddbread; /* do we have to reread this */ |
53 | }; | |
54 | ||
55 | #endif /* _PACKAGE_DB_H_ */ |