]> cygwin.com Git - cygwin-apps/setup.git/blob - package_db.h
Support xz and lzma decompression via liblzma
[cygwin-apps/setup.git] / package_db.h
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 SETUP_PACKAGE_DB_H
17 #define SETUP_PACKAGE_DB_H
18
19 /* required to parse this file */
20 #include <vector>
21 #include <map>
22 #include "String++.h"
23 class packagemeta;
24 class io_stream;
25 class PackageSpecification;
26
27 typedef enum {
28 PackageDB_Install,
29 PackageDB_Download
30 } PackageDBActions;
31
32 extern PackageDBActions chosen_db_task;
33
34 class packagedb;
35 typedef std::vector <packagemeta *>::iterator PackageDBConnectedIterator;
36
37 /*TODO: add mutexs */
38 class packagedb
39 {
40 public:
41 packagedb ();
42 /* 0 on success */
43 int flush ();
44 packagemeta * findBinary (PackageSpecification const &) const;
45 packagemeta * findSource (PackageSpecification const &) const;
46 PackageDBConnectedIterator connectedBegin();
47 PackageDBConnectedIterator connectedEnd();
48 void fillMissingCategory();
49 void markUnVisited();
50 void setExistence();
51 /* all seen binary packages */
52 static std::vector < packagemeta *> packages;
53 /* all seen source packages */
54 static std::vector <packagemeta *> sourcePackages;
55 /* all seen categories */
56 typedef std::map <std::string, std::vector <packagemeta *>, casecompare_lt_op > categoriesType;
57 static categoriesType categories;
58 static PackageDBActions task;
59 private:
60 static int installeddbread; /* do we have to reread this */
61 friend class ConnectedLoopFinder;
62 static std::vector <packagemeta *> dependencyOrderedPackages;
63 };
64
65 #endif /* SETUP_PACKAGE_DB_H */
This page took 0.039018 seconds and 5 git commands to generate.