#ifndef __VOLUME_ENUMERATOR_H__
#define __VOLUME_ENUMERATOR_H__
#include <list>
// Class to enumerate volume labels of volumes assigned
// a drive letter under MSW.
// Also gets the full UNC path for drive-mapped network
// shares.
// Windows has this very exotic concept of drive letters (nowadays called
// volumes), even if the drive isn't mounted (in the sense of no media
// inserted).
// This can result in a long seek time if trying to enumerate the volume
// labels, especially with legacy floppy drives (why are people still using
// them?). Worse, even if no floppy drive is installed the BIOS can report
// one to exist and Windows dutifully displays A:
// Since the local directory tree including the drives is populated at
// startup, use a background thread to obtain the labels.
#ifdef __WXMSW__
DECLARE_EVENT_TYPE(fzEVT_VOLUMEENUMERATED, -1)
DECLARE_EVENT_TYPE(fzEVT_VOLUMESENUMERATED, -1)
class
{
public:
CVolumeDescriptionEnumeratorThread(wxEvtHandler* pEvtHandler);
virtual ~CVolumeDescriptionEnumeratorThread();
bool Failed() const { return m_failure; }
struct t_VolumeInfo
{
wxString volume;
wxString volumeName;
};
std::list<t_VolumeInfo> GetVolumes();
static std::list<wxString> GetDrives();
static long GetDrivesToHide( TRANSLATE_SIGNAL(;
static bool IsHidden(wxChar const* drive, long noDrives);
protected:
bool GetDriveLabels();
void ProcessDrive(wxString const& drive);
bool GetDriveLabel(wxString const& drive);
virtual ExitCode Entry();
wxEvtHandler* m_pEvtHandler;
bool m_failure;
bool m_stop;
bool java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 6
struct t_VolumeInfoInternal
{
wxChar* pVolume;
wxChar* pVolumeName;
};
std::list<t_VolumeInfoInternal> m_volumeInfo;
wxCriticalSection m_crit_section;
};
#endif //__WXMSW__
#endif //__VOLUME_ENUMERATOR_H__
¤ Dauer der Verarbeitung: 0.5 Sekunden
¤
*© Formatika GbR, Deutschland