]> cygwin.com Git - cygwin-apps/setup.git/blame - package_db.h
2003-03-16 Robert Collins <rbtcollins@hotmail.com>
[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
ad646f43
RC
33
34class packagedb;
35typedef std::vector <packagemeta *>::iterator PackageDBConnectedIterator;
36
7939f6d1
RC
37/*TODO: add mutexs */
38class packagedb
39{
40public:
41 packagedb ();
7c7034e8
RC
42 /* 0 on success */
43 int flush ();
3c196821
RC
44 packagemeta * findBinary (PackageSpecification const &) const;
45 packagemeta * findSource (PackageSpecification const &) const;
ad646f43
RC
46 PackageDBConnectedIterator connectedBegin();
47 PackageDBConnectedIterator connectedEnd();
08cd08c3 48 /* all seen binary packages */
666bf37d 49 static std::vector < packagemeta *> packages;
08cd08c3 50 /* all seen source packages */
666bf37d 51 static std::vector <packagemeta *> sourcePackages;
7b606ae5 52 /* all seen categories */
666bf37d 53 typedef std::map <String, std::vector <packagemeta *>, String::caseless > categoriesType;
0cf68afd 54 static categoriesType categories;
cbfc4215 55 static PackageDBActions task;
7939f6d1 56private:
7939f6d1 57 static int installeddbread; /* do we have to reread this */
ad646f43
RC
58 friend class ConnectedLoopFinder;
59 static std::vector <packagemeta *> dependencyOrderedPackages;
7939f6d1
RC
60};
61
62#endif /* _PACKAGE_DB_H_ */
This page took 0.038532 seconds and 5 git commands to generate.