storage/udisks: new plugin

Documentation will follow soon.
This commit is contained in:
Max Kellermann
2018-06-03 11:03:49 +02:00
parent 5fa94d2a85
commit ba8040d068
5 changed files with 383 additions and 0 deletions

View File

@@ -25,6 +25,7 @@
#define UDISKS2_PATH "/org/freedesktop/UDisks2"
#define UDISKS2_INTERFACE "org.freedesktop.UDisks2"
#define UDISKS2_FILESYSTEM_INTERFACE "org.freedesktop.UDisks2.Filesystem"
namespace ODBus {
class Message;
@@ -48,6 +49,16 @@ struct Object {
(!drive_id.empty() || !block_id.empty());
}
template<typename I>
bool IsId(I &&other) const noexcept {
if (!drive_id.empty())
return drive_id == std::forward<I>(other);
else if (!block_id.empty())
return block_id == std::forward<I>(other);
else
return false;
}
std::string GetUri() const noexcept {
if (!drive_id.empty())
return "udisks://" + drive_id;