]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/volume.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFSVolume - encapsulates system volume information
4 // Author: George Policello
8 // Copyright: (c) 2002 George Policello
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 // ----------------------------------------------------------------------------
13 // wxFSVolume represents a volume/drive/mount point in a file system
14 // ----------------------------------------------------------------------------
16 #ifndef _WX_FSVOLUME_H_
17 #define _WX_FSVOLUME_H_
20 #pragma interface "fsvolume.h"
30 // is the volume mounted?
31 wxFS_VOL_MOUNTED
= 0x0001,
33 // is the volume removable (floppy, CD, ...)?
34 wxFS_VOL_REMOVABLE
= 0x0002,
36 // read only? (otherwise read write)
37 wxFS_VOL_READONLY
= 0x0004,
40 wxFS_VOL_REMOTE
= 0x0008
61 wxFS_VOL_ICO_SMALL
= 0,
63 wxFS_VOL_ICO_SEL_SMALL
,
64 wxFS_VOL_ICO_SEL_LARGE
,
68 WX_DECLARE_OBJARRAY(wxIcon
, wxIconArray
);
72 class WXDLLEXPORT wxFSVolume
75 // return the array containing the names of the volumes
77 // only the volumes with the flags such that
78 // (flags & flagsSet) == flagsSet && !(flags & flagsUnset)
79 // are returned (by default, all mounted ones)
80 static wxArrayString
GetVolumes(int flagsSet
= wxFS_VOL_MOUNTED
,
83 // stop execution of GetVolumes() called previously (should be called from
84 // another thread, of course)
85 static void CancelSearch();
87 // create the volume object with this name (should be one of those returned
90 wxFSVolume(const wxString
& name
);
91 bool Create(const wxString
& name
);
96 // is this a valid volume?
99 // kind of this volume?
100 wxFSVolumeKind
GetKind() const;
102 // flags of this volume?
103 int GetFlags() const;
105 // can we write to this volume?
106 bool IsWritable() const { return !(GetFlags() & wxFS_VOL_READONLY
); }
108 // get the name of the volume and the name which should be displayed to the
110 wxString
GetName() const { return m_volName
; }
111 wxString
GetDisplayName() const { return m_dispName
; }
114 wxIcon
GetIcon(wxFSIconType type
) const;
117 // TODO: operatios (Mount(), Unmount(), Eject(), ...)?
129 #endif // wxUSE_FSVOLUME
131 #endif // _WX_FSVOLUME_H_