[Test] Added tests for CUtil::SplitParams
[xbmc.git] / xbmc / addons / PluginSource.h
blob722df8bb6717d4af6b115ad617ba0d72fee0962b
1 /*
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.
7 */
9 #pragma once
11 #include "addons/Addon.h"
13 #include <set>
15 namespace ADDON
18 typedef std::map<std::string, std::vector<std::string>> ContentPathMap;
20 class CPluginSource : public CAddon
22 public:
24 enum Content { UNKNOWN, AUDIO, IMAGE, EXECUTABLE, VIDEO, GAME };
26 explicit CPluginSource(const AddonInfoPtr& addonInfo, AddonType addonType);
28 bool HasType(AddonType type) const override;
29 bool Provides(const Content& content) const
31 return content == UNKNOWN ? false : m_providedContent.count(content) > 0;
34 bool ProvidesSeveral() const
36 return m_providedContent.size() > 1;
39 const ContentPathMap& MediaLibraryScanPaths() const
41 return m_mediaLibraryScanPaths;
44 static Content Translate(const std::string &content);
45 private:
46 /*! \brief Set the provided content for this plugin
47 If no valid content types are passed in, we set the EXECUTABLE type
48 \param content a space-separated list of content types
50 void SetProvides(const std::string &content);
51 std::set<Content> m_providedContent;
52 ContentPathMap m_mediaLibraryScanPaths;
55 } /*namespace ADDON*/