00001 #ifndef __CDriveInformation__ 00002 #define __CDriveInformation__ 00003 00004 #include "../Basics/CString.hpp" 00005 #include "../Basics/CSystemString.hpp" 00006 #include "../Collections/CollectionTypedef.h" 00007 #include "../IO/CTextStream.hpp" 00008 00009 // =========================================================================== 00010 00011 using Exponent::Basics::CString; 00012 using Exponent::Basics::CSystemString; 00013 using Exponent::IO::CTextStream; 00014 using Exponent::Collections::TStringCountedPointerArray; 00015 00016 // =========================================================================== 00017 00018 namespace Exponent 00019 { 00020 namespace Host 00021 { 00040 class CDriveInformation 00041 { 00042 public: 00043 00044 // =========================================================================== 00045 00047 #ifdef WIN32 00048 00049 static const long CDRIVE_INFO_UNKNOWN_DRIVE = DRIVE_UNKNOWN; 00050 static const long CDRIVE_INFO_UNMOUNTED_DRIVE = DRIVE_NO_ROOT_DIR; 00051 static const long CDRIVE_INFO_REMOVEABLE_DRIVE = DRIVE_REMOVABLE; 00052 static const long CDRIVE_INFO_FIXED_DRIVE = DRIVE_FIXED; 00053 static const long CDRIVE_INFO_NETWORK_DRIVE = DRIVE_REMOTE; 00054 static const long CDRIVE_INFO_CDROM_DRIVE = DRIVE_CDROM; 00055 static const long CDRIVE_INFO_RAM_DRIVE = DRIVE_RAMDISK; 00057 #endif 00058 00060 // =========================================================================== 00061 00066 static void dumpDriveInfoToFile(const CSystemString &path); 00067 00072 static void dumpDriveInfoToFile(CTextStream &stream); 00073 00074 // =========================================================================== 00075 00080 static void getDriveNames(TStringCountedPointerArray &array); 00081 00090 static void getDriveInformation(const CString &driveToExamine, CString &volumeName, CString &fileSystem, long &volumeSerialNumber); 00091 00092 // =========================================================================== 00093 00095 #ifdef WIN32 00096 00102 static long getDriveType(const CString &driveToExamine); 00103 00109 static bool driveIsCdrom(const CString &driveToExamine); 00110 00116 static bool driveIsNetworkDrive(const CString &driveToExamine); 00117 00123 static bool driveIsFixedDrive(const CString &driveToExamine); 00124 00130 static void getDriveTypeAsString(const CString &driveToExamine, CString type); 00131 00132 // =========================================================================== 00133 00138 static void getWindowsTemporaryFolder(CSystemString &folder); 00139 00144 static void getWindowsFolder(CSystemString &folder); 00146 #endif 00147 00149 // =========================================================================== 00150 00151 private: 00152 00153 // =========================================================================== 00154 00156 #ifdef WIN32 00157 00158 static const char *CDRIVE_INFO_DRIVE_STRINGS[]; 00160 #endif 00161 00163 // =========================================================================== 00164 }; 00165 } 00166 } 00167 #endif // End of CDriveInformation.hpp