diff options
| author | manuel <manuel@mausz.at> | 2020-10-19 00:52:24 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2020-10-19 00:52:24 +0200 |
| commit | be933ef2241d79558f91796cc5b3a161f72ebf9c (patch) | |
| tree | fe3ab2f130e20c99001f2d7a81d610c78c96a3f4 /xbmc/utils/FileExtensionProvider.h | |
| parent | 5f8335c1e49ce108ef3481863833c98efa00411b (diff) | |
| download | kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.gz kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.bz2 kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.zip | |
sync with upstream
Diffstat (limited to 'xbmc/utils/FileExtensionProvider.h')
| -rw-r--r-- | xbmc/utils/FileExtensionProvider.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/xbmc/utils/FileExtensionProvider.h b/xbmc/utils/FileExtensionProvider.h new file mode 100644 index 0000000..fce384a --- /dev/null +++ b/xbmc/utils/FileExtensionProvider.h | |||
| @@ -0,0 +1,79 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2012-2018 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #include "addons/AddonEvents.h" | ||
| 12 | #include "addons/addoninfo/AddonInfo.h" | ||
| 13 | #include "settings/AdvancedSettings.h" | ||
| 14 | |||
| 15 | namespace ADDON | ||
| 16 | { | ||
| 17 | class CAddonMgr; | ||
| 18 | } | ||
| 19 | |||
| 20 | class CFileExtensionProvider | ||
| 21 | { | ||
| 22 | public: | ||
| 23 | CFileExtensionProvider(ADDON::CAddonMgr& addonManager); | ||
| 24 | ~CFileExtensionProvider(); | ||
| 25 | |||
| 26 | /*! | ||
| 27 | * @brief Returns a list of picture extensions | ||
| 28 | */ | ||
| 29 | std::string GetPictureExtensions() const; | ||
| 30 | |||
| 31 | /*! | ||
| 32 | * @brief Returns a list of music extensions | ||
| 33 | */ | ||
| 34 | std::string GetMusicExtensions() const; | ||
| 35 | |||
| 36 | /*! | ||
| 37 | * @brief Returns a list of video extensions | ||
| 38 | */ | ||
| 39 | std::string GetVideoExtensions() const; | ||
| 40 | |||
| 41 | /*! | ||
| 42 | * @brief Returns a list of subtitle extensions | ||
| 43 | */ | ||
| 44 | std::string GetSubtitleExtensions() const; | ||
| 45 | |||
| 46 | /*! | ||
| 47 | * @brief Returns a list of disc stub extensions | ||
| 48 | */ | ||
| 49 | std::string GetDiscStubExtensions() const; | ||
| 50 | |||
| 51 | /*! | ||
| 52 | * @brief Returns a file folder extensions | ||
| 53 | */ | ||
| 54 | std::string GetFileFolderExtensions() const; | ||
| 55 | |||
| 56 | /*! | ||
| 57 | * @brief Returns whether a url protocol from add-ons use encoded hostnames | ||
| 58 | */ | ||
| 59 | bool EncodedHostName(const std::string& protocol) const; | ||
| 60 | |||
| 61 | private: | ||
| 62 | std::string GetAddonExtensions(const ADDON::TYPE &type) const; | ||
| 63 | std::string GetAddonFileFolderExtensions(const ADDON::TYPE &type) const; | ||
| 64 | void SetAddonExtensions(); | ||
| 65 | void SetAddonExtensions(const ADDON::TYPE &type); | ||
| 66 | |||
| 67 | void OnAddonEvent(const ADDON::AddonEvent& event); | ||
| 68 | |||
| 69 | // Construction properties | ||
| 70 | std::shared_ptr<CAdvancedSettings> m_advancedSettings; | ||
| 71 | ADDON::CAddonMgr &m_addonManager; | ||
| 72 | |||
| 73 | // File extension properties | ||
| 74 | std::map<ADDON::TYPE, std::string> m_addonExtensions; | ||
| 75 | std::map<ADDON::TYPE, std::string> m_addonFileFolderExtensions; | ||
| 76 | |||
| 77 | // Protocols from add-ons with encoded host names | ||
| 78 | std::vector<std::string> m_encoded; | ||
| 79 | }; | ||
