summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/Repository.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/addons/Repository.h')
-rw-r--r--xbmc/addons/Repository.h82
1 files changed, 0 insertions, 82 deletions
diff --git a/xbmc/addons/Repository.h b/xbmc/addons/Repository.h
deleted file mode 100644
index 5120c38..0000000
--- a/xbmc/addons/Repository.h
+++ /dev/null
@@ -1,82 +0,0 @@
1#pragma once
2/*
3 * Copyright (C) 2005-2013 Team XBMC
4 * http://xbmc.org
5 *
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#include "Addon.h"
23#include "utils/Job.h"
24
25namespace ADDON
26{
27 class CRepository;
28 typedef std::shared_ptr<CRepository> RepositoryPtr;
29 class CRepository : public CAddon
30 {
31 public:
32 virtual AddonPtr Clone() const;
33 CRepository(const AddonProps& props);
34 CRepository(const cp_extension_t *props);
35 virtual ~CRepository();
36
37 /*! \brief Get the md5 hash for an addon.
38 \param the addon in question.
39 \return the md5 hash for the given addon, empty if non exists.
40 */
41 std::string GetAddonHash(const AddonPtr& addon) const;
42
43 struct DirInfo
44 {
45 DirInfo() : version("0.0.0"), compressed(false), zipped(false), hashes(false) {}
46 AddonVersion version;
47 std::string info;
48 std::string checksum;
49 std::string datadir;
50 bool compressed;
51 bool zipped;
52 bool hashes;
53 };
54
55 typedef std::vector<DirInfo> DirList;
56 DirList m_dirs;
57
58 static bool Parse(const DirInfo& dir, VECADDONS& addons);
59 static std::string FetchChecksum(const std::string& url);
60
61 virtual void OnPostInstall(bool restart, bool update, bool modal);
62 virtual void OnPostUnInstall();
63
64 private:
65 CRepository(const CRepository &rhs);
66 };
67
68 class CRepositoryUpdateJob : public CJob
69 {
70 public:
71 CRepositoryUpdateJob(const VECADDONS& repos);
72 virtual ~CRepositoryUpdateJob() {}
73
74 virtual const char *GetType() const { return "repoupdate"; };
75 virtual bool DoWork();
76 private:
77 bool GrabAddons(const RepositoryPtr& repo, VECADDONS& addons);
78
79 VECADDONS m_repos;
80 };
81}
82