Class: RAPI::FileInformation

Inherits:
Object
  • Object
show all
Defined in:
lib/rapi.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ce_find_data) ⇒ FileInformation

Returns a new instance of FileInformation.



294
295
296
297
298
299
300
301
302
# File 'lib/rapi.rb', line 294

def initialize(ce_find_data)
  @attributes         = FileAttributes.new(ce_find_data[:dwFileAttributes])
  @create_time        = ce_find_data[:ftCreationTime]
  @last_access_time   = ce_find_data[:ftLastAccessTime]
  @last_write_time    = ce_find_data[:ftLastWriteTime]
  @name               = encode(ce_find_data[:cFileName].to_ptr.get_bytes(0, 260))
  @size               = ce_find_data[:nFileSizeHigh] << 32 &&
                        ce_find_data[:nFileSizeLow]
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



287
288
289
# File 'lib/rapi.rb', line 287

def attributes
  @attributes
end

#create_timeObject (readonly)

Returns the value of attribute create_time.



288
289
290
# File 'lib/rapi.rb', line 288

def create_time
  @create_time
end

#last_access_timeObject (readonly)

Returns the value of attribute last_access_time.



289
290
291
# File 'lib/rapi.rb', line 289

def last_access_time
  @last_access_time
end

#last_write_timeObject (readonly)

Returns the value of attribute last_write_time.



290
291
292
# File 'lib/rapi.rb', line 290

def last_write_time
  @last_write_time
end

#nameObject (readonly)

Returns the value of attribute name.



292
293
294
# File 'lib/rapi.rb', line 292

def name
  @name
end

#sizeObject (readonly)

Returns the value of attribute size.



291
292
293
# File 'lib/rapi.rb', line 291

def size
  @size
end