mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
removable drive manager - Windows part
This commit is contained in:
parent
62e36cd2d5
commit
8b4732e811
3 changed files with 195 additions and 0 deletions
41
src/slic3r/GUI/RemovableDriveManager.hpp
Normal file
41
src/slic3r/GUI/RemovableDriveManager.hpp
Normal file
|
@ -0,0 +1,41 @@
|
|||
#ifndef slic3r_GUI_RemovableDriveManager_hpp_
|
||||
#define slic3r_GUI_RemovableDriveManager_hpp_
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
struct DriveData
|
||||
{
|
||||
std::wstring name;
|
||||
std::string path;
|
||||
DriveData(std::wstring n, std::string p):name(n),path(p){}
|
||||
};
|
||||
class RemovableDriveManager
|
||||
{
|
||||
public:
|
||||
static RemovableDriveManager& getInstance()
|
||||
{
|
||||
static RemovableDriveManager instance;
|
||||
return instance;
|
||||
}
|
||||
RemovableDriveManager(RemovableDriveManager const&) = delete;
|
||||
void operator=(RemovableDriveManager const&) = delete;
|
||||
|
||||
//update() searches for removable devices, returns false if empty.
|
||||
static bool update();
|
||||
static bool isDriveMounted(std::string path);
|
||||
static void ejectDrive(std::string path);
|
||||
static std::string getLastDrivePath();
|
||||
static void getAllDrives(std::vector<DriveData>& drives);
|
||||
private:
|
||||
RemovableDriveManager(){}
|
||||
static void searchForDrives(std::vector<DriveData>& newDrives);
|
||||
static void printDrivesToLog();
|
||||
static void updateCurrentDrives(const std::vector<DriveData>& newDrives);
|
||||
static std::vector<DriveData> currentDrives;
|
||||
|
||||
};
|
||||
}}
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue