KMountPoint

Search for usage in LXR

#include <KMountPoint>

Inheritance diagram for KMountPoint:

Classes

class  List
 

Public Types

enum  DetailsNeededFlag { BasicInfoNeeded = 0 , NeedMountOptions = 1 , NeedRealDeviceName = 2 }
 
typedef QFlags< DetailsNeededFlagDetailsNeededFlags
 
enum  FileSystemFlag {
  SupportsChmod , SupportsChown , SupportsUTime , SupportsSymlinks ,
  CaseInsensitive
}
 
using Ptr = QExplicitlySharedDataPointer<KMountPoint>
 

Public Member Functions

 ~KMountPoint ()
 
dev_t deviceId () const
 
bool isOnNetwork () const
 
QString mountedFrom () const
 
QStringList mountOptions () const
 
QString mountPoint () const
 
QString mountType () const
 
bool probablySlow () const
 
QString realDeviceName () const
 
bool testFileSystemFlag (FileSystemFlag flag) const
 
- Public Member Functions inherited from QSharedData
 QSharedData (const QSharedData &)
 

Static Public Member Functions

static List currentMountPoints (DetailsNeededFlags infoNeeded=BasicInfoNeeded)
 
static List possibleMountPoints (DetailsNeededFlags infoNeeded=BasicInfoNeeded)
 

Detailed Description

The KMountPoint class provides information about mounted and unmounted disks.

It provides a system independent interface to fstab.

Author
Waldo Bastian basti.nosp@m.an@k.nosp@m.de.or.nosp@m.g

Definition at line 30 of file kmountpoint.h.

Member Typedef Documentation

◆ DetailsNeededFlags

Stores a combination of DetailsNeededFlag values.

Definition at line 82 of file kmountpoint.h.

◆ Ptr

Member Enumeration Documentation

◆ DetailsNeededFlag

Flags that specify which additional details should be fetched for each mountpoint.

See also
DetailsNeededFlags
Enumerator
BasicInfoNeeded 

Only the basic details: mountedFrom, mountPoint, mountType.

NeedMountOptions 

Also fetch the options used when mounting, see KMountPoint::mountOptions().

NeedRealDeviceName 

Also fetch the device name (with symlinks resolved), see KMountPoint::realDeviceName().

Definition at line 65 of file kmountpoint.h.

◆ FileSystemFlag

enum KMountPoint::FileSystemFlag

Definition at line 153 of file kmountpoint.h.

Constructor & Destructor Documentation

◆ ~KMountPoint()

KMountPoint::~KMountPoint ( )
default

Destructor.

Member Function Documentation

◆ currentMountPoints()

KMountPoint::List KMountPoint::currentMountPoints ( DetailsNeededFlags infoNeeded = BasicInfoNeeded)
static

Returns a list of all current mountpoints.

Parameters
infoNeededFlags that specify which additional information should be fetched.
Note
This method will return an empty list on Android

Definition at line 285 of file kmountpoint.cpp.

◆ deviceId()

dev_t KMountPoint::deviceId ( ) const

Returns the device ID (dev_t, major, minor) of this mount point.

This ID is unique per device (including network mounts).

Since
5.86

Definition at line 395 of file kmountpoint.cpp.

◆ isOnNetwork()

bool KMountPoint::isOnNetwork ( ) const

Returns true if this mount point represents a network filesystem (e.g. NFS, CIFS, etc.), otherwise returns false.

Since
5.86

Definition at line 400 of file kmountpoint.cpp.

◆ mountedFrom()

QString KMountPoint::mountedFrom ( ) const

Where this filesystem gets mounted from.

This can refer to a device, a remote server or something else.

Definition at line 390 of file kmountpoint.cpp.

◆ mountOptions()

QStringList KMountPoint::mountOptions ( ) const

Options used to mount the filesystem.

Only available if the NeedMountOptions flag was set.

Definition at line 420 of file kmountpoint.cpp.

◆ mountPoint()

QString KMountPoint::mountPoint ( ) const

Path where the filesystem is mounted (if you used currentMountPoints()), or can be mounted (if you used possibleMountPoints()).

Definition at line 410 of file kmountpoint.cpp.

◆ mountType()

QString KMountPoint::mountType ( ) const

Type of filesystem.

Definition at line 415 of file kmountpoint.cpp.

◆ possibleMountPoints()

KMountPoint::List KMountPoint::possibleMountPoints ( DetailsNeededFlags infoNeeded = BasicInfoNeeded)
static

This function gives a list of all possible mountpoints.

(fstab)

Parameters
infoNeededFlags that specify which additional information should be fetched.

Definition at line 169 of file kmountpoint.cpp.

◆ probablySlow()

bool KMountPoint::probablySlow ( ) const

Returns true if the filesystem is "probably" slow, e.g. a network mount, false otherwise.

Definition at line 473 of file kmountpoint.cpp.

◆ realDeviceName()

QString KMountPoint::realDeviceName ( ) const

Canonical name of the device where the filesystem got mounted from.

(Or empty, if not a device) Only available when the NeedRealDeviceName flag was set.

Definition at line 405 of file kmountpoint.cpp.

◆ testFileSystemFlag()

bool KMountPoint::testFileSystemFlag ( FileSystemFlag flag) const

Checks the capabilities of the filesystem.

Parameters
flagthe flag to check
Returns
true if the filesystem has that flag, false if not

The available flags are:

  • SupportsChmod: returns true if the filesystem supports chmod (e.g. msdos filesystems return false)
  • SupportsChown: returns true if the filesystem supports chown (e.g. msdos filesystems return false)
  • SupportsUtime: returns true if the filesystems supports utime (e.g. msdos filesystems return false)
  • SupportsSymlinks: returns true if the filesystems supports symlinks (e.g. msdos filesystems return false)
  • CaseInsensitive: returns true if the filesystem treats "foo" and "FOO" as being the same file (true for msdos filesystems)

Definition at line 485 of file kmountpoint.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:50:33 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.