Sha256: 855711cc9c4a7cb14bcda4e639be10e3009cd311bb8c9991a8abfdc7e8badc29

Contents?: true

Size: 1.57 KB

Versions: 5

Compression:

Stored size: 1.57 KB

Contents

require 'windows/api'

# In general you will want to use this module with Windows::National because
# it contains the various LOCALE and TIME constants.

module Windows
  module Time
    API.auto_namespace = 'Windows::Time'
    API.auto_constant  = true
    API.auto_method    = true
    API.auto_unicode   = true

    private
    
    TIME_ZONE_ID_UNKNOWN  = 0
    TIME_ZONE_ID_STANDARD = 1
    TIME_ZONE_ID_DAYLIGHT = 2      

    API.new('CompareFileTime', 'PP', 'L')
    API.new('DosDateTimeToFileTime', 'IIP', 'B')
    API.new('FileTimeToDosDateTime', 'PPP', 'B')
    API.new('FileTimeToLocalFileTime', 'PP', 'B')
    API.new('FileTimeToSystemTime', 'PP', 'B')
    API.new('GetFileTime', 'LPPP', 'B')
    API.new('GetLocalTime', 'P')
    API.new('GetSystemTime', 'P')
    API.new('GetSystemTimeAdjustment', 'PPP', 'B')
    API.new('GetSystemTimeAsFileTime', 'P')
    API.new('GetTickCount')
    API.new('GetTimeFormat', 'ILPPPI', 'I')
    API.new('GetTimeZoneInformation', 'P', 'L')
    API.new('LocalFileTimeToFileTime', 'PP', 'B')
    API.new('SetFileTime', 'LPPP', 'B')
    API.new('SetLocalTime', 'P', 'B')
    API.new('SetSystemTime', 'P', 'B')
    API.new('SetTimeZoneInformation', 'P', 'B')
    API.new('SetSystemTimeAdjustment', 'LI', 'B')
    API.new('SystemTimeToFileTime', 'PP', 'B')
    API.new('SystemTimeToTzSpecificLocalTime', 'PPP', 'B')

    begin
      API.new('GetSystemTimes', 'PPP', 'B')
      API.new('TzSpecificLocalTimeToSystemTime', 'PPP', 'B')
    rescue Win32::API::LoadLibraryError
      # Windows XP or later
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
windows-pr-1.2.6 lib/windows/time.rb
windows-pr-1.2.5 lib/windows/time.rb
windows-pr-1.2.2 lib/windows/time.rb
windows-pr-1.2.1 lib/windows/time.rb
windows-pr-1.2.0 lib/windows/time.rb