This component‐private utility struct provides a namespace for a suite of functions that FilesystemUtil uses as implementation details. These functions have a WINDOWS_INTERFACE template parameter, which provides access to the entities that Windows systems declare, and that the function implementations need.

Synopsis

Declared in <bdls_filesystemutil_windowsimputil.h>

template<class WINDOWS_INTERFACE>
struct FilesystemUtil_WindowsImpUtil;

Description

The program is ill‐formed unless the specified WINDOWS_INTERFACE is a class type that meets the following requirements:

* WINDOWS_INTERFACE::BOOL is a type alias to the BOOL type provided by the windows.h header. * WINDOWS_INTERFACE::DWORD is a type alias to the DWORD type provided by the windows.h header. * WINDOWS_INTERFACE::FILETIME is a type alias to the FILETIME type provided by the windows.h header. * WINDOWS_INTERFACE::HANDLE is a type alias to the HANDLE type provided by the windows.h header. * WINDOWS_INTERFACE::INT64 is a type alias to the IN64 type provided by the windows.h header. * WINDOWS_INTERFACE::LPFILETIME is a type alias to the LPFILETIME type provided by the windows.h header. * WINDOWS_INTERFACE::SYSTEMTIME is a type alias to the LPFILETIME type provided by the windows.h header. * WINDOWS_INTERFACE::ULARGE_INTEGER is a type alias to the ULARGE_INTEGER type provided by the windows.h header. * WINDOWS_INTERFACE::ULONG64 is a type alias to the ULONG64 type provided by the windows.h header. * WINDOWS_INTERFACE::ULONGLONG is a type alias to the ULONGLONG type provided by the windows.h header. * WINDOWS_INTERFACE::WORD is a type alias to the WORD type provided by the windows.h header. * WINDOWS_INTERFACE::FileTimeToSystemTime is a public, static member function that has BOOL (const FILETIME *lpFileTime, LPSYSTEMTIME lpSystemTime) type and whose contract is to return the result of ::FileTimeToSystemTime(lpFileTime, lpSystemTime), where ::FileTimeToSystemTime is the corresponding function declared in the windows.h header. * WINDOWS_INTERFACE::GetFileSize is a public, static member function that has DWORD (HANDLE hFile, LPDWORD lpFileSizeHigh) type and whose contract is to return the result of ::GetFileSize(hFile, lpFileSizeHigh), where ::GetFileSize is the corresponding function declared in the windows.h header. * WINDOWS_INTERFACE::GetFileTime is a public, static member function that has 'BOOL (HANDLE hFile, LPFILETIME lpCreationTime, LPFILETIME lpLastAccessTime, LPFILETIME, lpLastWriteTime)' type and whose contract is to return the result of '::GetFileTime(hFile, lpCreationTime, lpLastAccessTime, lpLastWriteTime), where `::GetFileTime' is the corresponding function declared in the `windows.h header. * WINDOWS_INTERFACE::GetLastError is a public, static member function that has DWORD () type and whose contract is to return the result of ::GetLastError(), where ::GetLastError is the corresponding function declared in the windows.h header. * WINDOWS_INTERFACE::SystemTimeToFileTime is a public, static member function that has BOOL (const SYSTEMTIME *lpSystemTime, LPFILEMTIME lpFileTime) type and whose contract is to return the result of ::SystemTimeToFileTime(lpSystemTime, lpFileTime), where ::SystemTimeToFileTime is the corresponding function declared in the windows.h header.

Type Aliases

Name

Description

FileDescriptor

FileDescriptor is an alias for operating system's native file descriptor / file handle type.

Offset

Offset is an alias for a signed integral type, and represents the offset of a location in a file.

Static Member Functions

Name

Description

convertFileTimeToDatetime

Load into the specified time the time in the specified lpFileTime. Return 0 on success, and a non‐zero value otherwise. Note that the time is reported in UTC.

getFileSize

Return the size, in bytes, of the file with the specified descriptor, or a negative value if an error occurs.

getLastModificationTime

Load into the specified time the last modification time of the file with the specified descriptor, as reported by the filesystem. Return 0 on success, and a non‐zero value otherwise. Note that the time is reported in UTC.

Static Data Members