adbncfs  0.9.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MountInfo::Entry Class Reference

A class to manage a line obtained from the output of the busybox applet mount command. More...

Public Member Functions

 Entry (const char *pcMountLine)
 Initializes this object with the given mount line. More...
 
virtual ~Entry ()
 
const string & fileSystem () const
 Retrieve the file system name. More...
 
const string & mountPoint () const
 Retrieve the mount point path. More...
 
const string & deviceType () const
 Retrieve the device type. More...
 
const set< string > & mountOptions () const
 Retrieve the set of mount options. More...
 
bool isMountedRo () const
 Test this mount point is mounted read only. More...
 
bool isMountedNoexec () const
 Test this mount point is mounted wit no execution option. More...
 

Private Member Functions

 Entry ()
 
void parseMountInfo (const char *pcMountLine)
 Parse the given mount line and store the results in the corresponding member variables. More...
 

Private Attributes

string m_strFileSystem
 
string m_strMountPoint
 
string m_strDevType
 
set< string > m_mountOptions
 

Detailed Description

A class to manage a line obtained from the output of the busybox applet mount command.

Definition at line 48 of file mountInfo.h.

Constructor & Destructor Documentation

MountInfo::Entry::Entry ( const char *  pcMountLine)

Initializes this object with the given mount line.

The accepted format for the mount line parameter is one line that the busybox applet mount command returns.

Examples:
rootfs on / type rootfs (ro,relatime)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
Parameters
pcMountLineone mount output line as described above.
Returns
true if and only if line could be parsed without error, false otherwise.

Definition at line 49 of file mountInfo.cpp.

Here is the call graph for this function:

virtual MountInfo::Entry::~Entry ( )
inlinevirtual

Definition at line 52 of file mountInfo.h.

MountInfo::Entry::Entry ( )
private

Member Function Documentation

const string& MountInfo::Entry::deviceType ( ) const
inline

Retrieve the device type.

Returns
the device type.

Definition at line 73 of file mountInfo.h.

const string& MountInfo::Entry::fileSystem ( ) const
inline

Retrieve the file system name.

Returns
the name of the file system.

Definition at line 59 of file mountInfo.h.

bool MountInfo::Entry::isMountedNoexec ( ) const

Test this mount point is mounted wit no execution option.

Returns
true if mounted with mount option "noexec" false otherwise.

Definition at line 69 of file mountInfo.cpp.

Here is the caller graph for this function:

bool MountInfo::Entry::isMountedRo ( ) const

Test this mount point is mounted read only.

Returns
true if mounted with mount option "ro" false otherwise.

Definition at line 59 of file mountInfo.cpp.

Here is the caller graph for this function:

const set<string>& MountInfo::Entry::mountOptions ( ) const
inline

Retrieve the set of mount options.

Returns
the set of mount options.

Definition at line 80 of file mountInfo.h.

const string& MountInfo::Entry::mountPoint ( ) const
inline

Retrieve the mount point path.

Returns
the mount point.

Definition at line 66 of file mountInfo.h.

void MountInfo::Entry::parseMountInfo ( const char *  pcMountLine)
private

Parse the given mount line and store the results in the corresponding member variables.

The accepted format for the mount line parameter is one line that the busybox applet mount command returns.

Examples:
rootfs on / type rootfs (ro,relatime)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
Parameters
pcMountLineone mount output line as described above.

Definition at line 94 of file mountInfo.cpp.

Here is the caller graph for this function:

Member Data Documentation

set<string> MountInfo::Entry::m_mountOptions
private

Definition at line 94 of file mountInfo.h.

string MountInfo::Entry::m_strDevType
private

Definition at line 93 of file mountInfo.h.

string MountInfo::Entry::m_strFileSystem
private

Definition at line 91 of file mountInfo.h.

string MountInfo::Entry::m_strMountPoint
private

Definition at line 92 of file mountInfo.h.


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