Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cFileDevice Class Reference

#include <cFileDir.h>

Public Member Functions

 cFileDevice ()
 
 ~cFileDevice ()
 
HRESULT UpdateInfo (const FILECHAR_t *pszDeviceId=nullptr)
 
FILESYS_TYPE get_FileSysType () const
 
bool isCaseSensitive () const
 

Static Public Member Functions

static UINT __stdcall GetDeviceType (const FILECHAR_t *pszDeviceId)
 
static FILE_SIZE_t __stdcall GetDeviceFreeSpace (const FILECHAR_t *pszDeviceId=nullptr)
 
static HRESULT __stdcall GetSystemDeviceList (cArrayString< FILECHAR_t > &a)
 

Public Attributes

cStringF m_sVolumeName
 can be empty. More...
 
cStringF m_sTypeName
 File system format/type e.g. "NTFS", "FAT". More...
 
FILESYS_TYPE m_eType
 Enumerate known types for m_sTypeName (file system type) More...
 
UINT64 m_nSerialNumber
 Volume serial number (time stamp of last format) e.g. 0x0ca0e613 for _WIN32. More...
 
DWORD m_dwMaximumComponentLength
 block size? e.g. 255 bytes More...
 
bool m_bCaseSensitive
 e.g. 0x03e700ff, FILE_CASE_SENSITIVE_SEARCH. else IgnoreCase More...
 

Static Public Attributes

static const char * k_FileSysName [FILESYS_QTY]
 File system types i might support. More...
 

Detailed Description

Info for a particular Disk/Device/Volume. e.g. 'C:\'

Constructor & Destructor Documentation

◆ cFileDevice()

Gray::cFileDevice::cFileDevice ( )

◆ ~cFileDevice()

Gray::cFileDevice::~cFileDevice ( )

Member Function Documentation

◆ get_FileSysType()

FILESYS_TYPE Gray::cFileDevice::get_FileSysType ( ) const
inline

◆ GetDeviceFreeSpace()

FILE_SIZE_t GRAYCALL Gray::cFileDevice::GetDeviceFreeSpace ( const FILECHAR_t pszDeviceId = nullptr)
static

Get disk space on the pszDeviceId.

Returns
the free disk space in bytes.

◆ GetDeviceType()

UINT GRAYCALL Gray::cFileDevice::GetDeviceType ( const FILECHAR_t pszDeviceId)
static

Determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive. https://msdn.microsoft.com/en-us/library/windows/desktop/aa364939(v=vs.85).aspx

Returns
0 =DRIVE_UNKNOWN, 1=DRIVE_NO_ROOT_DIR, 2=DRIVE_REMOVABLE, 3=DRIVE_FIXED, 4=DRIVE_REMOTE, 5=DRIVE_CDROM, 6=DRIVE_RAMDISK

◆ GetSystemDeviceList()

HRESULT GRAYCALL Gray::cFileDevice::GetSystemDeviceList ( cArrayString< FILECHAR_t > &  a)
static

list all the devices/volumes available to the system.

◆ isCaseSensitive()

bool Gray::cFileDevice::isCaseSensitive ( ) const

The file system is case sensitive ? linux = true, _WIN32 = false A network mounted SAMBA share will use whatever rules the native OS/FileSystem uses. m_sTypeName = "FAT","NTFS" system = non case sensitive. "NFS" = case sensitive.

◆ UpdateInfo()

HRESULT Gray::cFileDevice::UpdateInfo ( const FILECHAR_t pszDeviceId = nullptr)
  • pszDeviceId = nullptr = use the current dir/path for the app. pszDeviceId can be from _WIN32 GetLogicalDriveStrings() some drives won't be ready (if removable). Thats OK. HRESULT_WIN32_C(ERROR_NOT_READY)

Member Data Documentation

◆ k_FileSysName

const char * Gray::cFileDevice::k_FileSysName
static
Initial value:
=
{
"",
"FAT",
"FAT32",
"NTFS",
"NFS",
}

File system types i might support.

◆ m_bCaseSensitive

bool Gray::cFileDevice::m_bCaseSensitive

e.g. 0x03e700ff, FILE_CASE_SENSITIVE_SEARCH. else IgnoreCase

◆ m_dwMaximumComponentLength

DWORD Gray::cFileDevice::m_dwMaximumComponentLength

block size? e.g. 255 bytes

◆ m_eType

FILESYS_TYPE Gray::cFileDevice::m_eType

Enumerate known types for m_sTypeName (file system type)

◆ m_nSerialNumber

UINT64 Gray::cFileDevice::m_nSerialNumber

Volume serial number (time stamp of last format) e.g. 0x0ca0e613 for _WIN32.

◆ m_sTypeName

cStringF Gray::cFileDevice::m_sTypeName

File system format/type e.g. "NTFS", "FAT".

◆ m_sVolumeName

cStringF Gray::cFileDevice::m_sVolumeName

can be empty.


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