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 "addons/addoninfo/AddonExtensions.h"
59 * @brief virtual addon types
72 class CAddonInfoBuilder
;
73 class CAddonDatabaseSerializer
;
75 class CAddonType
: public CAddonExtensions
78 CAddonType(AddonType type
= AddonType::UNKNOWN
) : m_type(type
) {}
80 AddonType
Type() const { return m_type
; }
81 std::string
LibPath() const;
82 const std::string
& LibName() const { return m_libname
; }
84 bool ProvidesSubContent(const AddonType
& content
) const
86 return content
== AddonType::UNKNOWN
88 : m_type
== content
|| m_providedSubContent
.count(content
) > 0;
91 bool ProvidesSeveralSubContents() const
93 return m_providedSubContent
.size() > 1;
96 size_t ProvidedSubContents() const
98 return m_providedSubContent
.size();
102 * @brief Indicates whether a given type is a dependency type (e.g. addons which the main type is
105 * @param[in] type the provided type
106 * @return true if type is one of the dependency types
108 static bool IsDependencyType(AddonType type
);
111 friend class CAddonInfoBuilder
;
112 friend class CAddonInfoBuilderFromDB
;
113 friend class CAddonDatabaseSerializer
;
115 void SetProvides(const std::string
& content
);
119 std::string m_libname
;
120 std::set
<AddonType
> m_providedSubContent
;
123 } /* namespace ADDON */