| Version: 3.2.5

Public Member Functions | Static Public Member Functions | List of all members
wxFSVolume Class Reference
Class List by Category » Miscellaneous

`#include <wx/volume.h>`

## Detailed Description

wxFSVolume represents a volume (also known as 'drive') in a file system under wxMSW.

Unix ports of wxWidgets do not have the concept of volumes and thus do not implement wxFSVolume.

Availability: only available for the wxMSW, wxOSX/Cocoa ports.

##

Library: wxBase
Category: Miscellaneous

## Public Member Functions

| wxFSVolume ()
| Default ctor. More...
| wxFSVolume (const wxString &name)
| Create the volume object with the given name (which should be one of those returned by GetVolumes()). More...
bool | Create (const wxString &name)
| Create the volume object with the given name (which should be one of those returned by GetVolumes()). More...
bool | IsOk () const
| Is this a valid volume? More...
wxFSVolumeKind | GetKind () const
| Returns the kind of this volume. More...
int | GetFlags () const
| Returns the flags of this volume. More...
bool | IsWritable () const
| Returns true if this volume is writable. More...
wxString | GetName () const
| Returns the name of the volume; this is the internal name for the volume used by the operating system. More...
wxString | GetDisplayName () const
| Returns the name of the volume meant to be shown to the user. More...
wxIcon | GetIcon (wxFSIconType type) const
| This function is available only when `wxUSE_GUI` is `1`. More...

## Static Public Member Functions

static wxArrayString | GetVolumes (int flagsSet=wxFS_VOL_MOUNTED, int flagsUnset=0)
| Returns an array containing the names of the volumes of this system. More...
static void | CancelSearch ()
| Stops execution of GetVolumes() called previously (should be called from another thread, of course). More...

## Constructor & Destructor Documentation

## ◆ wxFSVolume() [1/2]

wxFSVolume::wxFSVolume | ( |  | ) |

Default ctor.

Use Create() later.

## ◆ wxFSVolume() [2/2]

wxFSVolume::wxFSVolume | ( | const wxString & | name | ) |

Create the volume object with the given name (which should be one of those returned by GetVolumes()).

## Member Function Documentation

## ◆ CancelSearch()

static void wxFSVolume::CancelSearch | ( |  | ) |

static

Stops execution of GetVolumes() called previously (should be called from another thread, of course).

## ◆ Create()

bool wxFSVolume::Create | ( | const wxString & | name | ) |

Create the volume object with the given name (which should be one of those returned by GetVolumes()).

## ◆ GetDisplayName()

wxString wxFSVolume::GetDisplayName | ( |  | ) | const

Returns the name of the volume meant to be shown to the user.

## ◆ GetFlags()

int wxFSVolume::GetFlags | ( |  | ) | const

Returns the flags of this volume.

See wxFSVolumeFlags enumeration values.

## ◆ GetIcon()

wxIcon wxFSVolume::GetIcon | ( | wxFSIconType | type | ) | const

This function is available only when `wxUSE_GUI` is `1`.

Returns the icon used by the native toolkit for the given file system type.

Availability: only available for the wxMSW port.

## ◆ GetKind()

wxFSVolumeKind wxFSVolume::GetKind | ( |  | ) | const

Returns the kind of this volume.

## ◆ GetName()

wxString wxFSVolume::GetName | ( |  | ) | const

Returns the name of the volume; this is the internal name for the volume used by the operating system.

## ◆ GetVolumes()

static wxArrayString wxFSVolume::GetVolumes | ( | int | flagsSet = `wxFS_VOL_MOUNTED`,
|  | int | flagsUnset = `0`
| ) |  |

static

Returns an array containing the names of the volumes of this system.

Only the volumes with flags such that the expression

(flags & flagsSet) == flagsSet && !(flags & flagsUnset)

is true, are returned. By default, all mounted ones are returned. See wxFSVolumeFlags enumeration values for a list of valid flags.

This operation may take a while and, even if this function is synchronous, it can be stopped using CancelSearch().

## ◆ IsOk()

bool wxFSVolume::IsOk | ( |  | ) | const

Is this a valid volume?

## ◆ IsWritable()

bool wxFSVolume::IsWritable | ( |  | ) | const

Returns true if this volume is writable.