Allow a mount entry to be construct with just the mounted path
This commit is contained in:
parent
ac2181d92b
commit
7cfef55e2d
2 changed files with 12 additions and 0 deletions
|
|
@ -46,6 +46,16 @@ std::shared_ptr<MountEntry> MountEntry::create(const std::shared_ptr<LoopDevice>
|
|||
return entry;
|
||||
}
|
||||
|
||||
std::shared_ptr<MountEntry> MountEntry::create(const boost::filesystem::path &target) {
|
||||
auto entry = std::shared_ptr<MountEntry>(new MountEntry(target));
|
||||
if (!entry)
|
||||
return nullptr;
|
||||
|
||||
entry->active_ = true;
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
MountEntry::MountEntry(const boost::filesystem::path &target) :
|
||||
active_{false}, target_{target} {}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ class MountEntry {
|
|||
static std::shared_ptr<MountEntry> create(const std::shared_ptr<LoopDevice> &loop, const boost::filesystem::path &target,
|
||||
const std::string &fs_type = "", unsigned long flags = 0);
|
||||
|
||||
static std::shared_ptr<MountEntry> create(const boost::filesystem::path &target);
|
||||
|
||||
~MountEntry();
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue