2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "IDirectory.h"
19 typedef std::shared_ptr
<CFileItem
> CFileItemPtr
;
24 using VECADDONS
= std::vector
<std::shared_ptr
<IAddon
>>;
32 \brief Get access to shares and it's directories.
34 class CAddonsDirectory
: public IDirectory
37 CAddonsDirectory(void);
38 ~CAddonsDirectory(void) override
;
39 bool GetDirectory(const CURL
& url
, CFileItemList
&items
) override
;
40 bool Create(const CURL
& url
) override
{ return true; }
41 bool Exists(const CURL
& url
) override
{ return true; }
42 bool AllowAll() const override
{ return true; }
44 /*! \brief Fetch script and plugin addons of a given content type
45 \param content the content type to fetch
46 \param addons the list of addons to fill with scripts and plugin content
47 \return true if content is valid, false if it's invalid.
49 static bool GetScriptsAndPlugins(const std::string
&content
, ADDON::VECADDONS
&addons
);
51 /*! \brief Fetch scripts and plugins of a given content type
52 \param content the content type to fetch
53 \param items the list to fill with scripts and content
54 \return true if more than one item is found, false otherwise.
56 static bool GetScriptsAndPlugins(const std::string
&content
, CFileItemList
&items
);
58 static void GenerateAddonListing(const CURL
& path
,
59 const ADDON::VECADDONS
& addons
,
61 const std::string
& label
);
62 static CFileItemPtr
FileItemFromAddon(const std::shared_ptr
<ADDON::IAddon
>& addon
,
63 const std::string
& path
,
66 /*! \brief Returns true if `path` is a path or subpath of the repository directory, otherwise false */
67 static bool IsRepoDirectory(const CURL
& path
);
70 bool GetSearchResults(const CURL
& path
, CFileItemList
&items
);