]> cygwin.com Git - cygwin-apps/setup.git/blame - package_db.h
2002-11-04 Max Bowsher <maxb@ukf.net>
[cygwin-apps/setup.git] / package_db.h
CommitLineData
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>
0cf68afd 23#include "category.h"
7939f6d1 24class packagemeta;
7b606ae5 25class io_stream;
3c196821 26class PackageSpecification;
7939f6d1 27
cbfc4215
RC
28typedef enum {
29 PackageDB_Install,
30 PackageDB_Download
31} PackageDBActions;
32
7939f6d1
RC
33/*TODO: add mutexs */
34class packagedb
35{
36public:
37 packagedb ();
7c7034e8
RC
38 /* 0 on success */
39 int flush ();
3c196821
RC
40 packagemeta * findBinary (PackageSpecification const &) const;
41 packagemeta * findSource (PackageSpecification const &) const;
08cd08c3 42 /* all seen binary packages */
666bf37d 43 static std::vector < packagemeta *> packages;
08cd08c3 44 /* all seen source packages */
666bf37d 45 static std::vector <packagemeta *> sourcePackages;
7b606ae5 46 /* all seen categories */
666bf37d 47 typedef std::map <String, std::vector <packagemeta *>, String::caseless > categoriesType;
0cf68afd 48 static categoriesType categories;
cbfc4215 49 static PackageDBActions task;
7939f6d1 50private:
7939f6d1
RC
51 static int installeddbread; /* do we have to reread this */
52};
53
54#endif /* _PACKAGE_DB_H_ */
This page took 0.032764 seconds and 5 git commands to generate.