BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdls::FilesystemUtil_WindowsImpUtil< WINDOWS_INTERFACE > Struct Template Reference

#include <bdls_filesystemutil_windowsimputil.h>

Public Types

typedef WINDOWS_INTERFACE::HANDLE FileDescriptor
 
typedef WINDOWS_INTERFACE::INT64 Offset
 

Static Public Member Functions

static int convertFileTimeToDatetime (bdlt::Datetime *time, const LPFILETIME lpFileTime)
 
static Offset getFileSize (FileDescriptor descriptor)
 
static int getLastModificationTime (bdlt::Datetime *time, FileDescriptor descriptor)
 

Static Public Attributes

static const bsls::Types::Int64 k_NANOSECONDS_PER_WINDOWS_TICK = 100
 
static const bsls::Types::Int64 k_WINDOWS_TICKS_PER_MICROSECOND
 

Detailed Description

template<class WINDOWS_INTERFACE>
struct bdls::FilesystemUtil_WindowsImpUtil< WINDOWS_INTERFACE >

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.

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), whereGetFileTime' 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.

Member Typedef Documentation

◆ FileDescriptor

template<class WINDOWS_INTERFACE >
typedef WINDOWS_INTERFACE::HANDLE bdls::FilesystemUtil_WindowsImpUtil< WINDOWS_INTERFACE >::FileDescriptor

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

◆ Offset

template<class WINDOWS_INTERFACE >
typedef WINDOWS_INTERFACE::INT64 bdls::FilesystemUtil_WindowsImpUtil< WINDOWS_INTERFACE >::Offset

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

Member Function Documentation

◆ convertFileTimeToDatetime()

template<class WINDOWS_INTERFACE >
int bdls::FilesystemUtil_WindowsImpUtil< WINDOWS_INTERFACE >::convertFileTimeToDatetime ( bdlt::Datetime time,
const LPFILETIME  lpFileTime 
)
static

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()

template<class WINDOWS_INTERFACE >
FilesystemUtil_WindowsImpUtil< WINDOWS_INTERFACE >::Offset bdls::FilesystemUtil_WindowsImpUtil< WINDOWS_INTERFACE >::getFileSize ( FileDescriptor  descriptor)
static

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

◆ getLastModificationTime()

template<class WINDOWS_INTERFACE >
int bdls::FilesystemUtil_WindowsImpUtil< WINDOWS_INTERFACE >::getLastModificationTime ( bdlt::Datetime time,
FileDescriptor  descriptor 
)
static

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.

Member Data Documentation

◆ k_NANOSECONDS_PER_WINDOWS_TICK

template<class WINDOWS_INTERFACE >
const bsls::Types::Int64 bdls::FilesystemUtil_WindowsImpUtil< WINDOWS_INTERFACE >::k_NANOSECONDS_PER_WINDOWS_TICK = 100
static

◆ k_WINDOWS_TICKS_PER_MICROSECOND

template<class WINDOWS_INTERFACE >
const bsls::Types::Int64 bdls::FilesystemUtil_WindowsImpUtil< WINDOWS_INTERFACE >::k_WINDOWS_TICKS_PER_MICROSECOND
static
Initial value:
=
static const bsls::Types::Int64 k_NANOSECONDS_PER_WINDOWS_TICK
Definition bdls_filesystemutil_windowsimputil.h:244
static const bsls::Types::Int64 k_NANOSECONDS_PER_MICROSECOND
Definition bdlt_timeunitratio.h:205

The documentation for this struct was generated from the following file: