kodi
Win10StorageProvider.h
1 /*
2  * Copyright (C) 2005-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 "storage/IStorageProvider.h"
12 #include "utils/Job.h"
13 
14 #include <atomic>
15 #include <string>
16 #include <vector>
17 
19 {
20 public:
21  virtual ~CStorageProvider();
22 
23  void Initialize() override;
24  void Stop() override { }
25 
26  void GetLocalDrives(VECSOURCES &localDrives) override;
27  void GetRemovableDrives(VECSOURCES &removableDrives) override;
28  std::string GetFirstOpticalDeviceFileName() override;
29  bool Eject(const std::string& mountpath) override;
30  std::vector<std::string> GetDiskUsage() override;
31  bool PumpDriveChangeEvents(IStorageEventsCallback *callback) override;
32 
33 private:
34  enum Drive_Types
35  {
36  ALL_DRIVES = 0,
37  LOCAL_DRIVES,
38  REMOVABLE_DRIVES,
39  DVD_DRIVES
40  };
41  static void GetDrivesByType(VECSOURCES &localDrives, Drive_Types eDriveType = ALL_DRIVES, bool bonlywithmedia = false);
42 
43  winrt::Windows::Devices::Enumeration::DeviceWatcher m_watcher{ nullptr };
44  std::atomic<bool> m_changed;
45 };
Definition: IStorageProvider.h:65
Definition: Win10StorageProvider.h:18
Definition: IStorageProvider.h:44