Skip to content
API Documentation
BastionGuard™
MountEntry Class Reference
Inheritance diagram for MountEntry:

Public Member Functions

 MountEntry (Device? device, string mount_point, string mount_options)
string subvolume_name ()
string lvm_name ()

Static Public Member Functions

static ? MountEntry find_entry_by_mount_point (Gee.ArrayList< MountEntry > entries, string mount_path)

Public Attributes

Device device = null
string mount_point = ""
string mount_options = ""

Detailed Description

Definition at line 10 of file MountEntry.vala.

Constructor & Destructor Documentation

◆ MountEntry()

MountEntry.MountEntry ( Device? device,
string mount_point,
string mount_options )
inline

Definition at line 16 of file MountEntry.vala.

16 {
17
18 this.device = device;
19 this.mount_point = mount_point;
20 this.mount_options = mount_options;
21 }
string mount_point
string mount_options
Device device

References device, mount_options, and mount_point.

Referenced by find_entry_by_mount_point(), Device.get_block_devices_using_lsblk(), Device.get_mounted_filesystems_using_mtab(), and Main.init_mount_list().

Member Function Documentation

◆ find_entry_by_mount_point()

? MountEntry MountEntry.find_entry_by_mount_point ( Gee.ArrayList< MountEntry > entries,
string mount_path )
inlinestatic

Definition at line 50 of file MountEntry.vala.

50 {
51
52 foreach(var entry in entries){
53 if (entry.mount_point == mount_path){
54 return entry;
55 }
56 }
57
58 return null;
59 }

References MountEntry().

Referenced by Main.fix_fstab_file().

◆ lvm_name()

string MountEntry.lvm_name ( )
inline

Definition at line 40 of file MountEntry.vala.

40 {
41
42 if ((device != null) && (device.type == "lvm") && (device.mapped_name.length > 0)){
43 return device.mapped_name.strip();
44 }
45 else{
46 return "";
47 }
48 }
string type
Definition Device.vala:64
string mapped_name
Definition Device.vala:49

References device, Device.mapped_name, and Device.type.

Referenced by RestoreDeviceBox.add_device_selection_option().

◆ subvolume_name()

string MountEntry.subvolume_name ( )
inline

Definition at line 23 of file MountEntry.vala.

23 {
24
25 if (mount_options.contains("subvol=")){
26
27 string txt = mount_options.split("subvol=")[1].split(",")[0].strip();
28
29 if (txt.has_prefix("/") && (txt.split("/").length == 2)){
30 txt = txt.split("/")[1];
31 }
32
33 return txt;
34 }
35 else{
36 return "";
37 }
38 }

References mount_options.

Referenced by RestoreDeviceBox.add_device_selection_option().

Member Data Documentation

◆ device

Device MountEntry.device = null

◆ mount_options

string MountEntry.mount_options = ""

Definition at line 14 of file MountEntry.vala.

Referenced by MountEntry(), and subvolume_name().

◆ mount_point

string MountEntry.mount_point = ""

The documentation for this class was generated from the following file: