3 * Copyright (C) 2005-2013 Team XBMC
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)
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.
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/>.
23 #include "utils/Job.h"
28 typedef boost::shared_ptr<CRepository> RepositoryPtr;
29 class CRepository : public CAddon
32 virtual AddonPtr Clone() const;
33 CRepository(const AddonProps& props);
34 CRepository(const cp_extension_t *props);
35 virtual ~CRepository();
37 std::string Checksum() const;
39 /*! \brief Get the md5 hash for an addon.
40 \param the addon in question.
41 \return the md5 hash for the given addon, empty if non exists.
43 std::string GetAddonHash(const AddonPtr& addon) const;
47 DirInfo() : version("0.0.0"), compressed(false), zipped(false), hashes(false) {}
57 typedef std::vector<DirInfo> DirList;
60 static VECADDONS Parse(const DirInfo& dir);
62 static std::string FetchChecksum(const std::string& url);
63 CRepository(const CRepository &rhs);
66 class CRepositoryUpdateJob : public CJob
69 CRepositoryUpdateJob(const VECADDONS& repos);
70 virtual ~CRepositoryUpdateJob() {}
72 virtual const char *GetType() const { return "repoupdate"; };
73 virtual bool DoWork();
75 VECADDONS GrabAddons(RepositoryPtr& repo);