Merge pull request #2212 from unxed/ctrl_yo
[far2l.git] / far2l / src / mix / MountInfo.h
blob80a2d34466ce449bb9fbc42352b061fe32d8b560
1 #pragma once
2 #include <string>
3 #include <vector>
4 #include <memory>
6 struct Mountpoint
8 std::string path;
9 std::string filesystem;
10 std::string device;
11 bool multi_thread_friendly;
13 // following fields valid only if for_location_menu set to true
14 volatile bool bad;
15 volatile bool read_only;
16 volatile unsigned long long total;
17 volatile unsigned long long avail;
18 volatile unsigned long long free_;
21 struct Mountpoints;
24 This class enumerates mountpoints and provides extra info
25 like disk sizes (if for_location_menu enabled) and also
26 (if for_location_menu disabled) - it provides ability to check
27 if specified path points to device that is best to be
28 accessed in multi-thread parallel manner, like SSD drives.
29 Later currently works only under Linux, others defaulted to <true>.
31 class MountInfo
33 std::shared_ptr<Mountpoints> _mountpoints;
34 char _mtfs = 0;
36 public:
37 MountInfo(bool for_location_menu = false);
39 const std::vector<Mountpoint> &Enum() const;
41 std::string GetFileSystem(const std::string &path) const;
43 /// Returns true if path fine to be used multi-threaded-ly
44 bool IsMultiThreadFriendly(const std::string &path) const;