libstorage-ng
Loading...
Searching...
No Matches
storage::Mountable Class Reference
Inheritance diagram for storage::Mountable:
[legend]
Collaboration diagram for storage::Mountable:
[legend]

Public Member Functions

bool supports_mount () const
 Checks whether the library supports mounting the mountable.
MountPointcreate_mount_point (const std::string &path)
 Create a new mount point for the mountable with path.
bool has_mount_point () const
 Checks whether the mountable has a mount point.
MountPointget_mount_point ()
 Returns the mount point of the mountable.
const MountPointget_mount_point () const
 Returns the mount point of the mountable.
void remove_mount_point ()
 Removes the mount point from the mountable.
bool has_filesystem () const
 Checks whether the mountable has a filesystem.
Filesystemget_filesystem ()
 Return the filesystem of the mountable.
const Filesystemget_filesystem () const
 Return the filesystem of the mountable.
MountByType get_mount_by () const ST_DEPRECATED
void set_mount_by (MountByType mount_by) ST_DEPRECATED
const std::vector< std::string > & get_mount_opts () const ST_DEPRECATED
void set_mount_opts (const std::vector< std::string > &mount_opts) ST_DEPRECATED
const std::vector< std::string > & get_fstab_options () const ST_DEPRECATED
void set_fstab_options (const std::vector< std::string > &mount_opts) ST_DEPRECATED
Impl & get_impl ()
const Impl & get_impl () const
Public Member Functions inherited from storage::Device
sid_t get_sid () const
 Return the storage id (sid) of the device.
bool operator== (const Device &rhs) const
bool operator!= (const Device &rhs) const
Devicecopy_to_devicegraph (Devicegraph *devicegraph) const
 Copies the device to the devicegraph.
bool exists_in_devicegraph (const Devicegraph *devicegraph) const
 Checks if the device exists in the devicegraph.
bool exists_in_probed () const
 Checks if the device exists in the probed devicegraph.
bool exists_in_staging () const
 Checks if the device exists in the staging devicegraph.
bool exists_in_system () const
 Checks if the device exists in the system devicegraph.
std::string get_displayname () const
ResizeInfo detect_resize_info () const
 Detect the resize info of the device.
bool has_children () const
size_t num_children () const
bool has_parents () const
size_t num_parents () const
std::vector< Device * > get_children ()
std::vector< const Device * > get_children () const
std::vector< Device * > get_children (View view)
 Get all children of the device.
std::vector< const Device * > get_children (View view) const
 Get all children of the device.
std::vector< Device * > get_parents ()
std::vector< const Device * > get_parents () const
std::vector< Device * > get_parents (View view)
 Get all parents of the device.
std::vector< const Device * > get_parents (View view) const
 Get all parents of the device.
std::vector< Device * > get_siblings (bool itself)
std::vector< const Device * > get_siblings (bool itself) const
std::vector< Device * > get_descendants (bool itself)
std::vector< const Device * > get_descendants (bool itself) const
std::vector< Device * > get_descendants (bool itself, View view)
std::vector< const Device * > get_descendants (bool itself, View view) const
std::vector< Device * > get_ancestors (bool itself)
std::vector< const Device * > get_ancestors (bool itself) const
std::vector< Device * > get_leaves (bool itself)
std::vector< const Device * > get_leaves (bool itself) const
std::vector< Device * > get_roots (bool itself)
std::vector< const Device * > get_roots (bool itself) const
std::vector< Holder * > get_in_holders ()
std::vector< const Holder * > get_in_holders () const
std::vector< Holder * > get_out_holders ()
std::vector< const Holder * > get_out_holders () const
void remove_descendants () ST_DEPRECATED
void remove_descendants (View view)
 Remove all descendants of the device.
const std::map< std::string, std::string > & get_userdata () const
 Return the userdata of the device.
void set_userdata (const std::map< std::string, std::string > &userdata)
 Set the userdata of the device.
std::string get_name_sort_key () const
 Get a sort-key based on the device name.
Devicegraphget_devicegraph ()
 Return the devicegraph the device belongs to.
const Devicegraphget_devicegraph () const
 Return the devicegraph the device belongs to.
Impl & get_impl ()
const Impl & get_impl () const
virtual Deviceclone () const =0
void save (xmlNode *node) const ST_DEPRECATED

Static Public Member Functions

static std::vector< Mountable * > get_all (Devicegraph *devicegraph)
 Get all Mountables.
static std::vector< const Mountable * > get_all (const Devicegraph *devicegraph)
 Get all Mountables.
static bool is_valid_path (FsType fs_type, const std::string &path)
 Checks whether the path is valid.
Static Public Member Functions inherited from storage::Device
static std::vector< Device * > get_all (Devicegraph *devicegraph)
 Get all Devices.
static std::vector< const Device * > get_all (const Devicegraph *devicegraph)
 Get all Devices.
static bool compare_by_sid (const Device *lhs, const Device *rhs)
 Compare (less than) two Devices by sid.
static bool compare_by_name (const Device *lhs, const Device *rhs)
 Compare (less than) two Devices by name.

Protected Member Functions

 Mountable (Impl *impl)
Protected Member Functions inherited from storage::Device
 Device (Impl *impl)
void create (Devicegraph *devicegraph) ST_DEPRECATED
 Create a device in the devicegraph.
void load (Devicegraph *devicegraph) ST_DEPRECATED

Member Function Documentation

◆ create_mount_point()

MountPoint * storage::Mountable::create_mount_point ( const std::string & path)

Create a new mount point for the mountable with path.

It will also set the default mount-by method to the storage default mount-by method and the default mount options.

◆ get_all()

std::vector< const Mountable * > storage::Mountable::get_all ( const Devicegraph * devicegraph)
static

Get all Mountables.

◆ get_filesystem() [1/2]

Filesystem * storage::Mountable::get_filesystem ( )

Return the filesystem of the mountable.

Normally this is the same object but for btrfs subvolumes the btrfs filesystem is returned.

◆ get_filesystem() [2/2]

const Filesystem * storage::Mountable::get_filesystem ( ) const

Return the filesystem of the mountable.

Normally this is the same object but for btrfs subvolumes the btrfs filesystem is returned.

◆ get_mount_point()

const MountPoint * storage::Mountable::get_mount_point ( ) const

Returns the mount point of the mountable.

◆ has_filesystem()

bool storage::Mountable::has_filesystem ( ) const

Checks whether the mountable has a filesystem.

Currently always true.

◆ is_valid_path()

bool storage::Mountable::is_valid_path ( FsType fs_type,
const std::string & path )
static

Checks whether the path is valid.

For FsType::UNKNOWN and FsType::AUTO the result is always false.

◆ remove_mount_point()

void storage::Mountable::remove_mount_point ( )

Removes the mount point from the mountable.

Exceptions
Exception

◆ supports_mount()

bool storage::Mountable::supports_mount ( ) const

Checks whether the library supports mounting the mountable.

So far this is always the case except for Bitlocker.

Note: Mounting may still fail if the system does not support it, e.g. due to missing kernel modules or missing user space tools.


The documentation for this class was generated from the following file:
  • /home/abuild/rpmbuild/BUILD/libstorage-ng-4.5.266-build/libstorage-ng-4.5.266/storage/Filesystems/Mountable.h