]> git.mxchange.org Git - simgear.git/blob - simgear/package/Install.hxx
92e2c4fc8b77ddd9be284311b864913371e78a5c
[simgear.git] / simgear / package / Install.hxx
1 #ifndef SG_PACKAGE_INSTALL_HXX
2 #define SG_PACKAGE_INSTALL_HXX
3
4 #include <vector>
5
6 #include <simgear/misc/sg_path.hxx>
7
8 namespace simgear
9 {
10     
11 namespace pkg
12 {
13
14 // forward decls
15 class Package;
16 class Catalog;
17     
18 /**
19  *
20  */
21 class Install
22 {
23 public:
24     /**
25      * create from a directory on disk, or fail.
26      */
27     static Install* createFromPath(const SGPath& aPath, Catalog* aCat);
28     
29     unsigned int revsion() const
30         { return m_revision; }
31     
32     Package* package() const
33         { return m_package; } 
34     
35     SGPath path() const
36         { return m_path; }
37     
38     bool hasUpdate() const;
39     
40     void startUpdate();
41     
42     void uninstall();
43     
44 // boost signals time?
45     // failure
46     // progress
47     // completed
48     
49 private:
50     friend class Package;
51     
52     class PackageArchiveDownloader;
53     friend class PackageArchiveDownloader;
54     
55     Install(Package* aPkg, const SGPath& aPath);
56     
57     void parseRevision();
58     void writeRevisionFile();
59     
60     Package* m_package;
61     unsigned int m_revision; ///< revision on disk
62     SGPath m_path; ///< installation point on disk
63     
64     PackageArchiveDownloader* m_download;
65 };
66     
67     
68 } // of namespace pkg
69
70 } // of namespace simgear
71
72 #endif // of SG_PACKAGE_CATALOG_HXX