Merge pull request #26126 from stephan49/fix-pipewire-unlock-error
[xbmc.git] / xbmc / platform / android / storage / AndroidStorageProvider.h
blob27ed350c38372d3b0158ce277e768a4282fcbeea
1 /*
2 * Copyright (C) 2012-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 "storage/IStorageProvider.h"
13 #include <set>
14 #include <string>
15 #include <vector>
17 class CAndroidStorageProvider : public IStorageProvider
19 public:
20 CAndroidStorageProvider();
21 ~CAndroidStorageProvider() override = default;
23 void Initialize() override {}
24 void Stop() override {}
25 bool Eject(const std::string& mountpath) override { return false; }
27 void GetLocalDrives(std::vector<CMediaSource>& localDrives) override;
28 void GetRemovableDrives(std::vector<CMediaSource>& removableDrives) override;
29 std::vector<std::string> GetDiskUsage() override;
31 bool PumpDriveChangeEvents(IStorageEventsCallback* callback) override;
33 /*!
34 * \brief If external storage is available, it returns the path for the external storage (for the specified type)
35 * \param path will contain the path of the external storage (for the specified type)
36 * \param type optional type. Possible values are "", "files", "music", "videos", "pictures", "photos, "downloads"
37 * \return true if external storage is available and a valid path has been stored in the path parameter
39 static bool GetExternalStorage(std::string& path, const std::string& type = "");
41 private:
42 std::string unescape(const std::string& str);
43 std::vector<CMediaSource> m_removableDrives;
44 unsigned int m_removableLength;
46 static std::set<std::string> GetRemovableDrives();
47 static std::set<std::string> GetRemovableDrivesLinux();
49 bool GetStorageUsage(const std::string& path, std::string& usage);