Add size (bytes) of the files on the clipboard

Output of the `clipboard_get_data` call now includes the size
of each file in bytes.
bug/bundler_fix
OJ 2013-10-16 22:54:55 +10:00
parent afc5e282a9
commit d4d4839dc2
No known key found for this signature in database
GPG Key ID: 49EEE7511FAA5749
5 changed files with 13 additions and 3 deletions

View File

@ -40,6 +40,14 @@ class Clipboard
files = response.get_tlv_values(TLV_TYPE_EXT_CLIPBOARD_TYPE_FILE)
files = []
response.each(TLV_TYPE_EXT_CLIPBOARD_TYPE_FILE) { |f|
files << {
:name => f.get_tlv_value(TLV_TYPE_EXT_CLIPBOARD_TYPE_FILE_NAME),
:size => f.get_tlv_value(TLV_TYPE_EXT_CLIPBOARD_TYPE_FILE_SIZE)
}
}
if files.length > 0
results << {
:type => :files,

View File

@ -29,7 +29,9 @@ TLV_TYPE_EXT_SERVICE_QUERY_INTERACTIVE = TLV_META_TYPE_BOOL | (TLV_TYPE_E
TLV_TYPE_EXT_SERVICE_QUERY_DACL = TLV_META_TYPE_STRING | (TLV_TYPE_EXTENSION_EXTAPI + TLV_EXTENSIONS + 26)
TLV_TYPE_EXT_CLIPBOARD_TYPE_TEXT = TLV_META_TYPE_STRING | (TLV_TYPE_EXTENSION_EXTAPI + TLV_EXTENSIONS + 40)
TLV_TYPE_EXT_CLIPBOARD_TYPE_FILE = TLV_META_TYPE_STRING | (TLV_TYPE_EXTENSION_EXTAPI + TLV_EXTENSIONS + 41)
TLV_TYPE_EXT_CLIPBOARD_TYPE_FILE = TLV_META_TYPE_GROUP | (TLV_TYPE_EXTENSION_EXTAPI + TLV_EXTENSIONS + 41)
TLV_TYPE_EXT_CLIPBOARD_TYPE_FILE_NAME = TLV_META_TYPE_STRING | (TLV_TYPE_EXTENSION_EXTAPI + TLV_EXTENSIONS + 42)
TLV_TYPE_EXT_CLIPBOARD_TYPE_FILE_SIZE = TLV_META_TYPE_QWORD | (TLV_TYPE_EXTENSION_EXTAPI + TLV_EXTENSIONS + 43)
end
end

View File

@ -87,14 +87,14 @@ class Console::CommandDispatcher::Extapi::Clipboard
print_line( "Downloading Clipboard Files" )
print_line( "-----------------------------------------------------" )
r[:data].each { |f|
download_file( loot_dir, f )
download_file( loot_dir, f[:name] )
}
print_line( "-----------------------------------------------------" )
else
print_line( "Current Clipboard Files" )
print_line( "-----------------------------------------------------" )
r[:data].each { |f|
print_line( f )
print_line( "#{f[:name]} (Bytes: #{f[:size]})" )
}
print_line( "-----------------------------------------------------" )
end