logo top
Main Page   Widgets   glibmm Namespaces   Book  

Gio::Drive Class Reference

Virtual File System drive management. More...

Inheritance diagram for Gio::Drive:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~Drive ()
GDrive* gobj ()
 Provides access to the underlying C GObject.
const GDrive* gobj () const
 Provides access to the underlying C GObject.
Glib::ustring get_name () const
 Gets the name of drive .
Glib::RefPtr<Iconget_icon ()
 Gets the icon for drive .
Glib::RefPtr<const Iconget_icon () const
 Gets the icon for drive .
bool has_volumes () const
 Check if drive has any mountable volumes.
bool is_media_removable () const
 Checks if the drive supports removable media.
bool has_media () const
 Checks if the drive has media.
bool is_media_check_automatic ()
 Checks if drive is capabable of automatically detecting media changes.
bool can_poll_for_media () const
 Checks if a drive can be polled for media changes.
bool can_eject ()
 Checks if a drive can be ejected.
void eject (GMountUnmountFlags flags, const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot)
 Ejects the drive.
void eject (GMountUnmountFlags flags, const SlotAsyncReady& slot)
 Ejects the drive.
bool eject_finish (const Glib::RefPtr<AsyncResult>& result)
 Finishes ejecting a drive.
void poll_for_media (const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot)
void poll_for_media (const SlotAsyncReady& slot)
bool poll_for_media_finish (const Glib::RefPtr<AsyncResult>& result)
 Finishes poll_for_mediaing a drive.
virtual Glib::ustring get_name_vfunc () const
virtual bool has_volumes_vfunc () const

Static Public Member Functions

static void add_interface (GType gtype_implementer)

Related Functions

(Note that these are not member functions.)

Glib::RefPtr<Gio::Drivewrap (GDrive* object, bool take_copy=false)
 A Glib::wrap() method for this object.

Detailed Description

Virtual File System drive management.

This represent a piece of hardware connected to the machine. It's generally only created for removable hardware or hardware with removable media. Gio::Drive is a container class for Gio::Volume objects that stem from the same piece of media. As such, Gio::Drive abstracts a drive with (or without) removable media and provides operations for querying whether media is available, determing whether media change is automatically detected and ejecting the media.

If the Gio::Drive reports that media isn't automatically detected, one can poll for media; typically one should not do this periodically as a poll for media operation is potententially expensive and may spin up the drive, creating noise.

Since glibmm 2.16:


Constructor & Destructor Documentation

virtual Gio::Drive::~Drive (  )  [virtual]


Member Function Documentation

static void Gio::Drive::add_interface ( GType  gtype_implementer  )  [static]

GDrive* Gio::Drive::gobj (  )  [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::Interface.

const GDrive* Gio::Drive::gobj (  )  const [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::Interface.

Glib::ustring Gio::Drive::get_name (  )  const

Gets the name of drive .

Returns:
A string containing drive 's name. The returned string should be freed when no longer needed.

Glib::RefPtr<Icon> Gio::Drive::get_icon (  ) 

Gets the icon for drive .

Returns:
G::Icon for the drive .

Glib::RefPtr<const Icon> Gio::Drive::get_icon (  )  const

Gets the icon for drive .

Returns:
G::Icon for the drive .

bool Gio::Drive::has_volumes (  )  const

Check if drive has any mountable volumes.

Returns:
true if the drive contains volumes, false otherwise.

bool Gio::Drive::is_media_removable (  )  const

Checks if the drive supports removable media.

Returns:
true if drive supports removable media, false otherwise.

bool Gio::Drive::has_media (  )  const

Checks if the drive has media.

Note that the OS may not be polling the drive for media changes; see g_drive_is_media_check_automatic() for more details.

Returns:
true if drive has media, false otherwise.

bool Gio::Drive::is_media_check_automatic (  ) 

Checks if drive is capabable of automatically detecting media changes.

Returns:
true if the drive is capabable of automatically detecting media changes, false otherwise.

bool Gio::Drive::can_poll_for_media (  )  const

Checks if a drive can be polled for media changes.

Returns:
true if the drive can be polled for media changes. false otherwise.

bool Gio::Drive::can_eject (  ) 

Checks if a drive can be ejected.

Returns:
true if the drive can be ejected. false otherwise.

void Gio::Drive::eject ( GMountUnmountFlags  flags,
const Glib::RefPtr<Cancellable>&  cancellable,
const SlotAsyncReady slot 
)

Ejects the drive.

Parameters:
flags Flags affecting the unmount if required for eject.
cancellable A cancellable object which can be used to cancel the eject.
slot A callback which will be called when the eject is completed or canceled.

void Gio::Drive::eject ( GMountUnmountFlags  flags,
const SlotAsyncReady slot 
)

Ejects the drive.

Parameters:
flags Flags affecting the unmount if required for eject.
slot A callback which will be called when the eject is completed.

bool Gio::Drive::eject_finish ( const Glib::RefPtr<AsyncResult>&  result  ) 

Finishes ejecting a drive.

Parameters:
result A G::AsyncResult.
error A G::Error.
Returns:
true if the drive has been ejected successfully, false otherwise.

void Gio::Drive::poll_for_media ( const Glib::RefPtr<Cancellable>&  cancellable,
const SlotAsyncReady slot 
)

void Gio::Drive::poll_for_media ( const SlotAsyncReady slot  ) 

bool Gio::Drive::poll_for_media_finish ( const Glib::RefPtr<AsyncResult>&  result  ) 

Finishes poll_for_mediaing a drive.

Parameters:
result A G::AsyncResult.
error A G::Error.
Returns:
true if the drive has been poll_for_mediaed successfully, false otherwise.

virtual Glib::ustring Gio::Drive::get_name_vfunc (  )  const [virtual]

virtual bool Gio::Drive::has_volumes_vfunc (  )  const [virtual]


Friends And Related Function Documentation

Glib::RefPtr<Gio::Drive> wrap ( GDrive *  object,
bool  take_copy = false 
) [related]

A Glib::wrap() method for this object.

Parameters:
object The C instance.
take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns:
A C++ instance that wraps this C instance.


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

Generated for glibmm 2.4 by Doxygen 1.5.1 © 1997-2001