diff --git a/lib/cfpropertylist/doc/classes/CFFormatError.html b/lib/cfpropertylist/doc/classes/CFFormatError.html deleted file mode 100644 index 9915ad4..0000000 --- a/lib/cfpropertylist/doc/classes/CFFormatError.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - -
-Class | -CFFormatError | -
In: | -
-
- rbCFFormatError.rb
-
- - |
-
Parent: | -- Exception - | -
-Exception thrown when format errors occur -
- -Module | -CFPropertyList | -
In: | -
-
- rbBinaryCFPropertyList.rb
-
- - - rbCFPropertyList.rb - - - - rbCFTypes.rb - - - - rbXMLCFPropertyList.rb - - - |
-
-CFPropertyList implementation parser -class to read, manipulate and write XML property list files (plist(5)) as -defined by Apple -
-Author: | Christian Kruse (cjk@wwwtech.de) - - |
Copyright: | Copyright (c) 2010 - - |
License: | Distributes under the same terms as Ruby - - |
-Converts a CFType hiercharchy to -native Ruby types -
-# File rbCFPropertyList.rb, line 72 - def guess(object, options = {}) - return if object.nil? - - if(object.is_a?(Fixnum) || object.is_a?(Integer)) then - return CFInteger.new(object) - elsif(object.is_a?(Float)) then - return CFReal.new(object) - elsif(object.is_a?(TrueClass) || object.is_a?(FalseClass)) then - return CFBoolean.new(object) - elsif(object.is_a?(String)) then - return CFString.new(object) - elsif(object.is_a?(Time) || object.is_a?(DateTime)) then - return CFDate.new(object) - elsif(object.is_a?(IO)) then - return CFData.new(object.read, CFData::DATA_RAW) - elsif(object.is_a?(Array)) then - ary = Array.new - object.each do - |o| - ary.push CFPropertyList.guess(o, options) - end - - return CFArray.new(ary) - elsif(object.is_a?(Hash)) then - hsh = Hash.new - object.each_pair do - |k,v| - k = k.to_s if k.is_a?(Symbol) - hsh[k] = CFPropertyList.guess(v, options) - end - - return CFDictionary.new(hsh) - elsif options[:convert_unknown_to_string] - return CFString.new(object.to_s) - end - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList.src/M000002.html b/lib/cfpropertylist/doc/classes/CFPropertyList.src/M000002.html deleted file mode 100644 index 3e51dd2..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList.src/M000002.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - -
# File rbCFPropertyList.rb, line 110 - def native_types(object,keys_as_symbols=false) - return if object.nil? - - if(object.is_a?(CFDate) || object.is_a?(CFString) || object.is_a?(CFInteger) || object.is_a?(CFReal) || object.is_a?(CFBoolean)) then - return object.value - elsif(object.is_a?(CFData)) then - return object.decoded_value - elsif(object.is_a?(CFArray)) then - ary = [] - object.value.each do - |v| - ary.push CFPropertyList.native_types(v) - end - - return ary - elsif(object.is_a?(CFDictionary)) then - hsh = {} - object.value.each_pair do - |k,v| - k = k.to_sym if keys_as_symbols - hsh[k] = CFPropertyList.native_types(v) - end - - return hsh - end - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.html deleted file mode 100644 index 34a259e..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.html +++ /dev/null @@ -1,710 +0,0 @@ - - - - - -
Class | -CFPropertyList::Binary | -
In: | -
-
- rbBinaryCFPropertyList.rb
-
- - |
-
Parent: | -- Object - | -
-Counts the number of bytes the string will have when coded; utf-16be if -non-ascii characters are present. -
--Uniques and transforms a string value to binary format and adds it to the -object table -
--Convert CFPropertyList to binary -format; since we have to count our objects we simply unique CFDictionary and CFArray -
--Read an object type byte at position $pos, decode it and delegate to the -correct reader function -
-# File rbBinaryCFPropertyList.rb, line 13 - def load(opts) - @unique_table = {} - @count_objects = 0 - @string_size = 0 - @int_size = 0 - @misc_size = 0 - @object_refs = 0 - - @written_object_count = 0 - @object_table = [] - @object_ref_size = 0 - - @offsets = [] - - fd = nil - if(opts.has_key?(:file)) then - fd = File.open(opts[:file],"rb") - file = opts[:file] - else - fd = StringIO.new(opts[:data],"rb") - file = "<string>" - end - - # first, we read the trailer: 32 byte from the end - fd.seek(-32,IO::SEEK_END) - buff = fd.read(32) - - offset_size, object_ref_size, number_of_objects, top_object, table_offset = buff.unpack "x6CCx4Nx4Nx4N" - - # after that, get the offset table - fd.seek(table_offset, IO::SEEK_SET) - coded_offset_table = fd.read(number_of_objects * offset_size) - raise CFFormatError.new("#{file}: Format error!") unless coded_offset_table.bytesize == number_of_objects * offset_size - - @count_objects = number_of_objects - - # decode offset table - formats = ["","C*","n*","(H6)*","N*"] - @offsets = coded_offset_table.unpack(formats[offset_size]) - if(offset_size == 3) then - 0.upto(@offsets.count-1) { |i| @offsets[i] = @offsets[i].to_i(16) } - end - - @object_ref_size = object_ref_size - val = read_binary_object_at(file,fd,top_object) - - fd.close - return val - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000019.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000019.html deleted file mode 100644 index 4c04709..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000019.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 65 - def to_str(opts={}) - @unique_table = {} - @count_objects = 0 - @string_size = 0 - @int_size = 0 - @misc_size = 0 - @object_refs = 0 - - @written_object_count = 0 - @object_table = [] - @object_ref_size = 0 - - @offsets = [] - - binary_str = "bplist00" - unique_and_count_values(opts[:root]) - - @count_objects += @unique_table.count - @object_ref_size = Binary.bytes_needed(@count_objects) - - file_size = @string_size + @int_size + @misc_size + @object_refs * @object_ref_size + 40 - offset_size = Binary.bytes_needed(file_size) - table_offset = file_size - 32 - - @object_table = [] - @written_object_count = 0 - @unique_table = {} # we needed it to calculate several values, but now we need an empty table - - opts[:root].to_binary(self) - - object_offset = 8 - offsets = [] - - 0.upto(@object_table.count-1) do |i| - binary_str += @object_table[i] - offsets[i] = object_offset - object_offset += @object_table[i].bytesize - end - - offsets.each do |offset| - binary_str += Binary.pack_it_with_size(offset_size,offset) - end - - binary_str += [offset_size, @object_ref_size].pack("x6CC") - binary_str += [@count_objects].pack("x4N") - binary_str += [0].pack("x4N") - binary_str += [table_offset].pack("x4N") - - return binary_str - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000020.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000020.html deleted file mode 100644 index 0c56dfe..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000020.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 117 - def read_binary_null_type(length) - case length - when 0 then return 0 # null byte - when 8 then return CFBoolean.new(false) - when 9 then return CFBoolean.new(true) - when 15 then return 15 # fill type - end - - raise CFFormatError.new("unknown null type: #{length}") - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000021.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000021.html deleted file mode 100644 index 8292949..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000021.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 130 - def read_binary_int(fname,fd,length) - raise CFFormatError.new("Integer greater than 8 bytes: #{length}") if length > 3 - - nbytes = 1 << length - - val = nil - buff = fd.read(nbytes) - - case length - when 0 then - val = buff.unpack("C") - val = val[0] - when 1 then - val = buff.unpack("n") - val = val[0] - when 2 then - val = buff.unpack("N") - val = val[0] - when 3 - hiword,loword = buff.unpack("NN") - val = hiword << 32 | loword - end - - return CFInteger.new(val); - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000022.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000022.html deleted file mode 100644 index d831bd4..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000022.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 158 - def read_binary_real(fname,fd,length) - raise CFFormatError.new("Real greater than 8 bytes: #{length}") if length > 3 - - nbytes = 1 << length - val = nil - buff = fd.read(nbytes) - - case length - when 0 then # 1 byte float? must be an error - raise CFFormatError.new("got #{length+1} byte float, must be an error!") - when 1 then # 2 byte float? must be an error - raise CFFormatError.new("got #{length+1} byte float, must be an error!") - when 2 then - val = buff.reverse.unpack("f") - val = val[0] - when 3 then - val = buff.reverse.unpack("d") - val = val[0] - end - - return CFReal.new(val) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000023.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000023.html deleted file mode 100644 index 79c6f22..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000023.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 183 - def read_binary_date(fname,fd,length) - raise CFFormatError.new("Date greater than 8 bytes: #{length}") if length > 3 - - nbytes = 1 << length - val = nil - buff = fd.read(nbytes) - - case length - when 0 then # 1 byte CFDate is an error - raise CFFormatError.new("#{length+1} byte CFDate, error") - when 1 then # 2 byte CFDate is an error - raise CFFormatError.new("#{length+1} byte CFDate, error") - when 2 then - val = buff.reverse.unpack("f") - val = val[0] - when 3 then - val = buff.reverse.unpack("d") - val = val[0] - end - - return CFDate.new(val,CFDate::TIMESTAMP_APPLE) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000024.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000024.html deleted file mode 100644 index f6ada03..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000024.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 208 - def read_binary_data(fname,fd,length) - buff = ""; - buff = fd.read(length) if length > 0 - return CFData.new(buff,CFData::DATA_RAW) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000025.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000025.html deleted file mode 100644 index c1210ea..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000025.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 216 - def read_binary_string(fname,fd,length) - buff = "" - buff = fd.read(length) if length > 0 - - @unique_table[buff] = true unless @unique_table.has_key?(buff) - return CFString.new(buff) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000026.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000026.html deleted file mode 100644 index 84071ea..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000026.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 226 - def Binary.charset_convert(str,from,to="UTF-8") - return str.clone.force_encoding(from).encode(to) if str.respond_to?("encode") - return Iconv.conv(to,from,str) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000027.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000027.html deleted file mode 100644 index c1cbfd0..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000027.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 232 - def Binary.charset_strlen(str,charset="UTF-8") - return str.length if str.respond_to?("encode") - - str = Iconv.conv("UTF-8",charset,str) if charset != "UTF-8" - return str.scan(/./mu).size - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000028.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000028.html deleted file mode 100644 index 8d1ce7c..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000028.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 240 - def read_binary_unicode_string(fname,fd,length) - # The problem is: we get the length of the string IN CHARACTERS; - # since a char in UTF-16 can be 16 or 32 bit long, we don't really know - # how long the string is in bytes - buff = fd.read(2*length) - - @unique_table[buff] = true unless @unique_table.has_key?(buff) - return CFString.new(Binary.charset_convert(buff,"UTF-16BE","UTF-8")) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000029.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000029.html deleted file mode 100644 index 4dd33e6..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000029.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 252 - def read_binary_array(fname,fd,length) - ary = [] - - # first: read object refs - if(length != 0) then - buff = fd.read(length * @object_ref_size) - objects = buff.unpack(@object_ref_size == 1 ? "C*" : "n*") - - # now: read objects - 0.upto(length-1) do |i| - object = read_binary_object_at(fname,fd,objects[i]) - ary.push object - end - end - - return CFArray.new(ary) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000030.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000030.html deleted file mode 100644 index e16589f..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000030.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 272 - def read_binary_dict(fname,fd,length) - dict = {} - - # first: read keys - if(length != 0) then - buff = fd.read(length * @object_ref_size) - keys = buff.unpack(@object_ref_size == 1 ? "C*" : "n*") - - # second: read object refs - buff = fd.read(length * @object_ref_size) - objects = buff.unpack(@object_ref_size == 1 ? "C*" : "n*") - - # read real keys and objects - 0.upto(length-1) do |i| - key = read_binary_object_at(fname,fd,keys[i]) - object = read_binary_object_at(fname,fd,objects[i]) - dict[key.value] = object - end - end - - return CFDictionary.new(dict) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000031.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000031.html deleted file mode 100644 index 46e87a5..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000031.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 297 - def read_binary_object(fname,fd) - # first: read the marker byte - buff = fd.read(1) - - object_length = buff.unpack("C*") - object_length = object_length[0] & 0xF - - buff = buff.unpack("H*") - object_type = buff[0][0].chr - - if(object_type != "0" && object_length == 15) then - object_length = read_binary_object(fname,fd) - object_length = object_length.value - end - - retval = nil - case object_type - when '0' then # null, false, true, fillbyte - retval = read_binary_null_type(object_length) - when '1' then # integer - retval = read_binary_int(fname,fd,object_length) - when '2' then # real - retval = read_binary_real(fname,fd,object_length) - when '3' then # date - retval = read_binary_date(fname,fd,object_length) - when '4' then # data - retval = read_binary_data(fname,fd,object_length) - when '5' then # byte string, usually utf8 encoded - retval = read_binary_string(fname,fd,object_length) - when '6' then # unicode string (utf16be) - retval = read_binary_unicode_string(fname,fd,object_length) - when 'a' then # array - retval = read_binary_array(fname,fd,object_length) - when 'd' then # dictionary - retval = read_binary_dict(fname,fd,object_length) - end - - return retval - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000032.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000032.html deleted file mode 100644 index e102a02..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000032.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 339 - def read_binary_object_at(fname,fd,pos) - position = @offsets[pos] - fd.seek(position,IO::SEEK_SET) - return read_binary_object(fname,fd) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000033.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000033.html deleted file mode 100644 index dba7567..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000033.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 347 - def Binary.bytes_size_int(int) - nbytes = 0 - - nbytes += 2 if int > 0xE # 2 bytes int - nbytes += 2 if int > 0xFF # 3 bytes int - nbytes += 2 if int > 0xFFFF # 5 bytes int - - return nbytes - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000034.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000034.html deleted file mode 100644 index 0d9e2f0..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000034.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 358 - def Binary.bytes_int(int) - nbytes = 1 - - nbytes += 1 if int > 0xFF # 2 byte int - nbytes += 2 if int > 0xFFFF # 4 byte int - nbytes += 4 if int > 0xFFFFFFFF # 8 byte int - nbytes += 7 if int < 0 # 8 byte int (since it is signed) - - return nbytes + 1 # one „marker” byte - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000035.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000035.html deleted file mode 100644 index a0c4130..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000035.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 370 - def Binary.pack_it_with_size(nbytes,int) - format = ["C", "n", "N", "N"][nbytes-1] - - if(nbytes == 3) then - val = [int].pack(format) - return val.slice(-3) - end - - return [int].pack(format) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000036.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000036.html deleted file mode 100644 index bcb14bd..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000036.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 382 - def Binary.bytes_needed(count) - nbytes = 0 - - while count >= 1 do - nbytes += 1 - count /= 256 - end - - return nbytes - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000037.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000037.html deleted file mode 100644 index f8452ad..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000037.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 394 - def Binary.int_bytes(int) - intbytes = "" - - if(int > 0xFFFF) then - intbytes = "\x12"+[int].pack("N") # 4 byte integer - elsif(int > 0xFF) then - intbytes = "\x11"+[int].pack("n") # 2 byte integer - else - intbytes = "\x10"+[int].pack("C") # 8 byte integer - end - - return intbytes; - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000038.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000038.html deleted file mode 100644 index 07582cd..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000038.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 409 - def Binary.type_bytes(type,type_len) - optional_int = "" - - if(type_len < 15) then - type += sprintf("%x",type_len) - else - type += "f" - optional_int = Binary.int_bytes(type_len) - end - - return [type].pack("H*") + optional_int - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000039.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000039.html deleted file mode 100644 index 8e17b6c..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000039.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 424 - def unique_and_count_values(value) - # no uniquing for other types than CFString and CFData - if(value.is_a?(CFInteger) || value.is_a?(CFReal)) then - val = value.value - if(value.is_a?(CFInteger)) then - @int_size += Binary.bytes_int(val) - else - @misc_size += 9 # 9 bytes (8 + marker byte) for real - end - - @count_objects += 1 - return - elsif(value.is_a?(CFDate)) then - @misc_size += 9 - @count_objects += 1 - return - elsif(value.is_a?(CFBoolean)) then - @count_objects += 1 - @misc_size += 1 - return - elsif(value.is_a?(CFArray)) then - cnt = 0 - - value.value.each do |v| - cnt += 1 - unique_and_count_values(v) - @object_refs += 1 # each array member is a ref - end - - @count_objects += 1 - @int_size += Binary.bytes_size_int(cnt) - @misc_size += 1 # marker byte for array - return - elsif(value.is_a?(CFDictionary)) then - cnt = 0 - - value.value.each_pair do |k,v| - cnt += 1 - - if(!@unique_table.has_key?(k)) - @unique_table[k] = 0 - @string_size += Binary.binary_strlen(k) + 1 - @int_size += Binary.bytes_size_int(Binary.charset_strlen(k,'UTF-8')) - end - - @object_refs += 2 # both, key and value, are refs - @unique_table[k] += 1 - unique_and_count_values(v) - end - - @count_objects += 1 - @misc_size += 1 # marker byte for dict - @int_size += Binary.bytes_size_int(cnt) - return - elsif(value.is_a?(CFData)) then - val = value.decoded_value - @int_size += Binary.bytes_size_int(val.length) - @misc_size += val.length - @count_objects += 1 - return - end - - val = value.value - if(!@unique_table.has_key?(val)) then - @unique_table[val] = 0 - @string_size += Binary.binary_strlen(val) + 1 - @int_size += Binary.bytes_size_int(Binary.charset_strlen(val,'UTF-8')) - end - - @unique_table[val] += 1 - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000040.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000040.html deleted file mode 100644 index b2e80bb..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000040.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 498 - def Binary.binary_strlen(val) - val.each_byte do |b| - if(b > 127) then - val = Binary.charset_convert(val, 'UTF-8', 'UTF-16BE') - return val.bytesize - end - end - - return val.bytesize - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000041.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000041.html deleted file mode 100644 index 558b438..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000041.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 510 - def string_to_binary(val) - saved_object_count = -1 - - unless(@unique_table.has_key?(val)) then - saved_object_count = @written_object_count - @written_object_count += 1 - - @unique_table[val] = saved_object_count - utf16 = false - - val.each_byte do |b| - if(b > 127) then - utf16 = true - break - end - end - - if(utf16) then - bdata = Binary.type_bytes("6",Binary.charset_strlen(val,"UTF-8")) # 6 is 0110, unicode string (utf16be) - val = Binary.charset_convert(val,"UTF-8","UTF-16BE") - - val.force_encoding("ASCII-8BIT") if val.respond_to?("encode") - @object_table[saved_object_count] = bdata + val - else - bdata = Binary.type_bytes("5",val.bytesize) # 5 is 0101 which is an ASCII string (seems to be ASCII encoded) - @object_table[saved_object_count] = bdata + val - end - else - saved_object_count = @unique_table[val] - end - - return saved_object_count - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000042.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000042.html deleted file mode 100644 index a0bfcf1..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000042.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 545 - def int_to_binary(value) - nbytes = 0 - nbytes = 1 if value > 0xFF # 1 byte integer - nbytes += 1 if value > 0xFFFF # 4 byte integer - nbytes += 1 if value > 0xFFFFFFFF # 8 byte integer - nbytes = 3 if value < 0 # 8 byte integer, since signed - - bdata = Binary.type_bytes("1", nbytes) # 1 is 0001, type indicator for integer - buff = "" - - if(nbytes < 3) then - fmt = "N" - - if(nbytes == 0) then - fmt = "C" - elsif(nbytes == 1) - fmt = "n" - end - - buff = [value].pack(fmt) - else - # 64 bit signed integer; we need the higher and the lower 32 bit of the value - high_word = value >> 32 - low_word = value & 0xFFFFFFFF - buff = [high_word,low_word].pack("NN") - end - - return bdata + buff - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000043.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000043.html deleted file mode 100644 index 3e89d06..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000043.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 576 - def real_to_binary(val) - bdata = Binary.type_bytes("2",3) # 2 is 0010, type indicator for reals - buff = [val].pack("d") - return bdata + buff.reverse - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000044.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000044.html deleted file mode 100644 index 1949222..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000044.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 583 - def num_to_binary(value) - saved_object_count = @written_object_count - @written_object_count += 1 - - val = "" - if(value.is_a?(CFInteger)) then - val = int_to_binary(value.value) - else - val = real_to_binary(value.value) - end - - @object_table[saved_object_count] = val - return saved_object_count - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000045.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000045.html deleted file mode 100644 index ab0d87c..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000045.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 599 - def date_to_binary(val) - saved_object_count = @written_object_count - @written_object_count += 1 - - val = val.getutc.to_f - CFDate::DATE_DIFF_APPLE_UNIX # CFDate is a real, number of seconds since 01/01/2001 00:00:00 GMT - - bdata = Binary.type_bytes("3", 3) # 3 is 0011, type indicator for date - @object_table[saved_object_count] = bdata + [val].pack("d").reverse - - return saved_object_count - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000046.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000046.html deleted file mode 100644 index 94e0665..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000046.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 612 - def bool_to_binary(val) - saved_object_count = @written_object_count - @written_object_count += 1 - - @object_table[saved_object_count] = val ? "\x9" : "\x8" # 0x9 is 1001, type indicator for true; 0x8 is 1000, type indicator for false - return saved_object_count - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000047.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000047.html deleted file mode 100644 index eeeee04..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000047.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 621 - def data_to_binary(val) - saved_object_count = @written_object_count - @written_object_count += 1 - - bdata = Binary.type_bytes("4", val.bytesize) # a is 1000, type indicator for data - @object_table[saved_object_count] = bdata + val - - return saved_object_count - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000048.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000048.html deleted file mode 100644 index 4645651..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000048.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 632 - def array_to_binary(val) - saved_object_count = @written_object_count - @written_object_count += 1 - - bdata = Binary.type_bytes("a", val.value.count) # a is 1010, type indicator for arrays - - val.value.each do |v| - bdata += Binary.pack_it_with_size(@object_ref_size, v.to_binary(self)); - end - - @object_table[saved_object_count] = bdata - return saved_object_count - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000049.html b/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000049.html deleted file mode 100644 index fb49926..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/Binary.src/M000049.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - -
# File rbBinaryCFPropertyList.rb, line 647 - def dict_to_binary(val) - saved_object_count = @written_object_count - @written_object_count += 1 - - bdata = Binary.type_bytes("d",val.value.count) # d=1101, type indicator for dictionary - - val.value.each_key do |k| - str = CFString.new(k) - key = str.to_binary(self) - bdata += Binary.pack_it_with_size(@object_ref_size,key) - end - - val.value.each_value do |v| - bdata += Binary.pack_it_with_size(@object_ref_size,v.to_binary(self)) - end - - @object_table[saved_object_count] = bdata - return saved_object_count - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFArray.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFArray.html deleted file mode 100644 index 4f33d08..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFArray.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - -
Class | -CFPropertyList::CFArray | -
In: | -
-
- rbCFTypes.rb
-
- - |
-
Parent: | -- - CFType - - | -
-This class contains an array of values -
- -# File rbCFTypes.rb, line 185 - def initialize(val=[]) - @value = val - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFArray.src/M000011.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFArray.src/M000011.html deleted file mode 100644 index 3b4acc0..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFArray.src/M000011.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 190 - def to_xml - n = LibXML::XML::Node.new('array') - @value.each do - |v| - n << v.to_xml - end - - return n - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFArray.src/M000012.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFArray.src/M000012.html deleted file mode 100644 index 93b09cd..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFArray.src/M000012.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 201 - def to_binary(bplist) - return bplist.array_to_binary(self) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFBoolean.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFBoolean.html deleted file mode 100644 index e6c4155..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFBoolean.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - -
Class | -CFPropertyList::CFBoolean | -
In: | -
-
- rbCFTypes.rb
-
- - |
-
Parent: | -- - CFType - - | -
-This class contains a boolean value -
- -# File rbCFTypes.rb, line 140 - def to_xml - return LibXML::XML::Node.new(@value ? 'true' : 'false') - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFBoolean.src/M000066.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFBoolean.src/M000066.html deleted file mode 100644 index 5171b28..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFBoolean.src/M000066.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 145 - def to_binary(bplist) - return bplist.bool_to_binary(@value); - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFData.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFData.html deleted file mode 100644 index 70fb7b4..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFData.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - -
Class | -CFPropertyList::CFData | -
In: | -
-
- rbCFTypes.rb
-
- - |
-
Parent: | -- - CFType - - | -
-This class contains binary data values -
- -DATA_BASE64 | -= | -0 | -- | -Base64 encoded data - - | -
DATA_RAW | -= | -1 | -- | -Raw data - - | -
# File rbCFTypes.rb, line 158 - def initialize(value=nil,format=DATA_BASE64) - if(format == DATA_RAW) then - @value = Base64.encode64(value) - else - @value = value - end - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFData.src/M000053.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFData.src/M000053.html deleted file mode 100644 index 2c0962e..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFData.src/M000053.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 167 - def decoded_value - return Base64.decode64(@value) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFData.src/M000054.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFData.src/M000054.html deleted file mode 100644 index 1427bd9..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFData.src/M000054.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 172 - def to_xml - return LibXML::XML::Node.new('data') << LibXML::XML::Node.new_text(@value) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFData.src/M000055.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFData.src/M000055.html deleted file mode 100644 index e95dd8b..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFData.src/M000055.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 177 - def to_binary(bplist) - return bplist.data_to_binary(decoded_value()) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.html deleted file mode 100644 index 795063b..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.html +++ /dev/null @@ -1,285 +0,0 @@ - - - - - -
Class | -CFPropertyList::CFDate | -
In: | -
-
- rbCFTypes.rb
-
- - |
-
Parent: | -- - CFType - - | -
-This class holds Time values. While Apple uses seconds since 2001, the rest -of the world uses seconds since 1970. So if you access value directly, you -get the Time class. If you access via get_value you either geht the timestamp or -the Apple timestamp -
- -TIMESTAMP_APPLE | -= | -0 | -
TIMESTAMP_UNIX | -= | -1; | -
DATE_DIFF_APPLE_UNIX | -= | -978307200 | -
# File rbCFTypes.rb, line 86 - def CFDate.date_string(val) - # 2009-05-13T20:23:43Z - val.getutc.strftime("%Y-%m-%dT%H:%M:%SZ") - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.src/M000072.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.src/M000072.html deleted file mode 100644 index 42ba1b7..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.src/M000072.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 92 - def CFDate.parse_date(val) - # 2009-05-13T20:23:43Z - val =~ %r{^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$} - year,month,day,hour,min,sec = $1, $2, $3, $4, $5, $6 - return Time.utc(year,month,day,hour,min,sec).getlocal - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.src/M000073.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.src/M000073.html deleted file mode 100644 index 9572d86..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.src/M000073.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 100 - def initialize(value = nil,format=CFDate::TIMESTAMP_UNIX) - if(value.is_a?(Time) || value.nil?) then - @value = value.nil? ? Time.now : value - else - set_value(value,format) - end - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.src/M000074.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.src/M000074.html deleted file mode 100644 index 34ee540..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.src/M000074.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 109 - def set_value(value,format=CFDate::TIMESTAMP_UNIX) - if(format == CFDate::TIMESTAMP_UNIX) then - @value = Time.at(value) - else - @value = Time.at(value + CFDate::DATE_DIFF_APPLE_UNIX) - end - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.src/M000075.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.src/M000075.html deleted file mode 100644 index 53bf0b6..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.src/M000075.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 118 - def get_value(format=CFDate::TIMESTAMP_UNIX) - if(format == CFDate::TIMESTAMP_UNIX) then - return @value.to_i - else - return @value.to_f - CFDate::DATE_DIFF_APPLE_UNIX - end - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.src/M000076.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.src/M000076.html deleted file mode 100644 index e10a76f..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.src/M000076.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 127 - def to_xml - return LibXML::XML::Node.new('date') << LibXML::XML::Node.new_text(CFDate::date_string(@value)) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.src/M000077.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.src/M000077.html deleted file mode 100644 index 0a9898d..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDate.src/M000077.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 132 - def to_binary(bplist) - return bplist.date_to_binary(@value) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDictionary.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFDictionary.html deleted file mode 100644 index 8e9877d..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDictionary.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - -
Class | -CFPropertyList::CFDictionary | -
In: | -
-
- rbCFTypes.rb
-
- - |
-
Parent: | -- - CFType - - | -
-this class contains a hash of values -
- -# File rbCFTypes.rb, line 209 - def initialize(value={}) - @value = value - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDictionary.src/M000014.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFDictionary.src/M000014.html deleted file mode 100644 index d976e89..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDictionary.src/M000014.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 214 - def to_xml - n = LibXML::XML::Node.new('dict') - @value.each_pair do - |key,value| - k = LibXML::XML::Node.new('key') << LibXML::XML::Node.new_text(key) - n << k - n << value.to_xml - end - - return n - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDictionary.src/M000015.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFDictionary.src/M000015.html deleted file mode 100644 index b570f5c..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFDictionary.src/M000015.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 227 - def to_binary(bplist) - return bplist.dict_to_binary(self) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFInteger.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFInteger.html deleted file mode 100644 index dec44a6..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFInteger.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - -
Class | -CFPropertyList::CFInteger | -
In: | -
-
- rbCFTypes.rb
-
- - |
-
Parent: | -- - CFType - - | -
-This class holds integer/fixnum values -
- -# File rbCFTypes.rb, line 53 - def to_xml - return LibXML::XML::Node.new('integer') << LibXML::XML::Node.new_text(@value.to_s) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFInteger.src/M000068.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFInteger.src/M000068.html deleted file mode 100644 index 7c15599..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFInteger.src/M000068.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 58 - def to_binary(bplist) - return bplist.num_to_binary(self) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFReal.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFReal.html deleted file mode 100644 index fd8bb0a..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFReal.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - -
Class | -CFPropertyList::CFReal | -
In: | -
-
- rbCFTypes.rb
-
- - |
-
Parent: | -- - CFType - - | -
-This class holds float values -
- -# File rbCFTypes.rb, line 66 - def to_xml - return LibXML::XML::Node.new('real') << LibXML::XML::Node.new_text(@value.to_s) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFReal.src/M000017.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFReal.src/M000017.html deleted file mode 100644 index 731b260..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFReal.src/M000017.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 71 - def to_binary(bplist) - return bplist.num_to_binary(self) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFString.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFString.html deleted file mode 100644 index bfa3462..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFString.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - - -
Class | -CFPropertyList::CFString | -
In: | -
-
- rbCFTypes.rb
-
- - |
-
Parent: | -- - CFType - - | -
-This class holds string values, both, UTF-8 and UTF-16BE It will convert -the value to UTF-16BE if necessary (i.e. if non-ascii char contained) -
- -# File rbCFTypes.rb, line 38 - def to_xml - n = LibXML::XML::Node.new('string') - n << LibXML::XML::Node.new_text(@value) unless @value.nil? - return n - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFString.src/M000070.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFString.src/M000070.html deleted file mode 100644 index 2d2e0af..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFString.src/M000070.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 45 - def to_binary(bplist) - return bplist.string_to_binary(@value); - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFType.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFType.html deleted file mode 100644 index aea9dd8..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFType.html +++ /dev/null @@ -1,201 +0,0 @@ - - - - - -
Class | -CFPropertyList::CFType | -
In: | -
-
- rbCFTypes.rb
-
- - |
-
Parent: | -- Object - | -
-This class defines the base class for all CFType -classes -
- -value | -[RW] | --value of the type - - | -
# File rbCFTypes.rb, line 21 - def initialize(value=nil) - @value = value - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFType.src/M000004.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFType.src/M000004.html deleted file mode 100644 index 120b553..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFType.src/M000004.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 26 - def to_xml - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/CFType.src/M000005.html b/lib/cfpropertylist/doc/classes/CFPropertyList/CFType.src/M000005.html deleted file mode 100644 index 9e9dd68..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/CFType.src/M000005.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - -
# File rbCFTypes.rb, line 30 - def to_binary(bplist) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/List.html b/lib/cfpropertylist/doc/classes/CFPropertyList/List.html deleted file mode 100644 index 2bb11bb..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/List.html +++ /dev/null @@ -1,412 +0,0 @@ - - - - - -
Class | -CFPropertyList::List | -
In: | -
-
- rbCFPropertyList.rb
-
- - |
-
Parent: | -- Object - | -
FORMAT_BINARY | -= | -1 | -- | -Format constant for binary format - - | -
FORMAT_XML | -= | -2 | -- | -Format constant for XML format - - | -
FORMAT_AUTO | -= | -0 | -- | -Format constant for automatic format recognizing - - | -
filename | -[RW] | --Path of PropertyList - - | -
format | -[RW] | --Path of PropertyList - - | -
value | -[RW] | --the root value in the plist file - - | -
-Read a plist file -
-file = nil: | The filename of the file to read. If nil, use filename instance -variable - - |
format = nil: | The format of the plist file. Auto-detect if nil - - |
-read a binary plist file -
-filename = nil: | The filename to read from; if nil, read from the file defined by instance -variable filename - - |
-load a plist from a binary string -
-str: | The string containing the plist - - |
-load a plist from a string -
-str = nil: | The string containing the plist - - |
format = nil: | The format of the plist - - |
-Load an XML PropertyList -
-filename = nil: | The filename to read from; if nil, read from the file defined by instance -variable filename - - |
-Serialize CFPropertyList object to -specified format and write it to file -
-file = nil: | The filename of the file to write to. Uses filename instance -variable if nil - - |
format = nil: | The format to save in. Uses format -instance variable if nil - - |
-convert plist to string -
-format = List::FORMAT_BINARY: | The format to save the plist - - |
opts={}: | Pass parser options - - |
# File rbCFPropertyList.rb, line 158 - def initialize(opts={}) - @filename = opts[:file] - @format = opts[:format] || FORMAT_AUTO - @data = opts[:data] - - load(@filename) unless @filename.nil? - load_str(@data) unless @data.nil? - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000057.html b/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000057.html deleted file mode 100644 index ad639d4..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000057.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
# File rbCFPropertyList.rb, line 169 - def load_xml(filename=nil) - load(filename,List::FORMAT_XML) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000058.html b/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000058.html deleted file mode 100644 index 4affdad..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000058.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
# File rbCFPropertyList.rb, line 175 - def load_binary(filename=nil) - load(filename,List::FORMAT_BINARY) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000059.html b/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000059.html deleted file mode 100644 index cccbbb5..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000059.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
# File rbCFPropertyList.rb, line 181 - def load_xml_str(str=nil) - load_str(str,List::FORMAT_XML) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000060.html b/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000060.html deleted file mode 100644 index 7fbac42..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000060.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
# File rbCFPropertyList.rb, line 187 - def load_binary_str(str=nil) - load_str(str,List::FORMAT_BINARY) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000061.html b/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000061.html deleted file mode 100644 index bef1599..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000061.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - -
# File rbCFPropertyList.rb, line 194 - def load_str(str=nil,format=nil) - str = @data if str.nil? - format = @format if format.nil? - - @value = {} - case format - when List::FORMAT_BINARY, List::FORMAT_XML then - prsr = @@parsers[format-1].new - @value = prsr.load({:data => str}) - - when List::FORMAT_AUTO then # what we now do is ugly, but neccessary to recognize the file format - filetype = str[0..5] - version = str[6..7] - - prsr = nil - if filetype == "bplist" then - raise CFFormatError.new("Wong file version #{version}") unless version == "00" - prsr = Binary.new - else - prsr = XML.new - end - - @value = prsr.load({:data => str}) - end - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000062.html b/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000062.html deleted file mode 100644 index dcaf2da..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000062.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - -
# File rbCFPropertyList.rb, line 223 - def load(file=nil,format=nil) - file = @filename if file.nil? - format = @format if format.nil? - @value = {} - - raise IOError.new("File #{file} not readable!") unless File.readable? file - - case format - when List::FORMAT_BINARY, List::FORMAT_XML then - prsr = @@parsers[format-1].new - @value = prsr.load({:file => file}) - - when List::FORMAT_AUTO then # what we now do is ugly, but neccessary to recognize the file format - magic_number = IO.read(file,8) - filetype = magic_number[0..5] - version = magic_number[6..7] - - prsr = nil - if filetype == "bplist" then - raise CFFormatError.new("Wong file version #{version}") unless version == "00" - prsr = Binary.new - else - prsr = XML.new - end - - @value = prsr.load({:file => file}) - end - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000063.html b/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000063.html deleted file mode 100644 index 173ed18..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000063.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - -
# File rbCFPropertyList.rb, line 255 - def save(file=nil,format=nil,opts={}) - format = @format if format.nil? - file = @filename if file.nil? - - raise CFFormatError.new("Format #{format} not supported, use List::FORMAT_BINARY or List::FORMAT_XML") if format != FORMAT_BINARY && format != FORMAT_XML - - if(!File.exists?(file)) then - raise IOError.new("File #{file} not writable!") unless File.writable?(File.dirname(file)) - elsif(!File.writable?(file)) then - raise IOError.new("File #{file} not writable!") - end - - opts[:root] = @value - prsr = @@parsers[format-1].new - content = prsr.to_str(opts) - - File.open(file, 'wb') { - |fd| - fd.write content - } - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000064.html b/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000064.html deleted file mode 100644 index 5e349ed..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/List.src/M000064.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - -
# File rbCFPropertyList.rb, line 280 - def to_str(format=List::FORMAT_BINARY,opts={}) - prsr = @@parsers[format-1].new - opts[:root] = @value - return prsr.to_str(opts) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/ParserInterface.html b/lib/cfpropertylist/doc/classes/CFPropertyList/ParserInterface.html deleted file mode 100644 index 69ee338..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/ParserInterface.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - - -
Class | -CFPropertyList::ParserInterface | -
In: | -
-
- rbCFPropertyList.rb
-
- - |
-
Parent: | -- Object - | -
-interface class for PList parsers -
- -# File rbCFPropertyList.rb, line 46 - def load(opts={}) - return "" - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/ParserInterface.src/M000051.html b/lib/cfpropertylist/doc/classes/CFPropertyList/ParserInterface.src/M000051.html deleted file mode 100644 index 0eb9cdc..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/ParserInterface.src/M000051.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
# File rbCFPropertyList.rb, line 51 - def to_str(opts={}) - return true - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/XML.html b/lib/cfpropertylist/doc/classes/CFPropertyList/XML.html deleted file mode 100644 index 0c277e7..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/XML.html +++ /dev/null @@ -1,218 +0,0 @@ - - - - - -
Class | -CFPropertyList::XML | -
In: | -
-
- rbXMLCFPropertyList.rb
-
- - |
-
Parent: | -- - ParserInterface - - | -
-XML parser -
- --serialize CFPropertyList object to XML -
-opts = {}: | Specify options: :formatted - Use indention and line breaks - - |
# File rbXMLCFPropertyList.rb, line 16 - def load(opts) - if(opts.has_key?(:file)) then - doc = LibXML::XML::Document.file(opts[:file],:options => LibXML::XML::Parser::Options::NOBLANKS|LibXML::XML::Parser::Options::NOENT) - else - doc = LibXML::XML::Document.string(opts[:data],:options => LibXML::XML::Parser::Options::NOBLANKS|LibXML::XML::Parser::Options::NOENT) - end - - root = doc.root.first - return import_xml(root) - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/XML.src/M000007.html b/lib/cfpropertylist/doc/classes/CFPropertyList/XML.src/M000007.html deleted file mode 100644 index 1e30bc2..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/XML.src/M000007.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - -
# File rbXMLCFPropertyList.rb, line 29 - def to_str(opts={}) - doc = LibXML::XML::Document.new - - doc.root = LibXML::XML::Node.new('plist') - doc.encoding = LibXML::XML::Encoding::UTF_8 - - doc.root['version'] = '1.0' - doc.root << opts[:root].to_xml() - - # ugly hack, but there's no other possibility I know - str = doc.to_s(:indent => opts[:formatted]) - str1 = String.new - first = false - str.each_line do - |line| - str1 << line - unless(first) then - str1 << "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n" if line =~ /^\s*<\?xml/ - end - - first = true - end - - return str1 - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/XML.src/M000008.html b/lib/cfpropertylist/doc/classes/CFPropertyList/XML.src/M000008.html deleted file mode 100644 index 679a206..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/XML.src/M000008.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - -
# File rbXMLCFPropertyList.rb, line 58 - def get_value(n) - return n.first.content if n.children? - return n.content - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/classes/CFPropertyList/XML.src/M000009.html b/lib/cfpropertylist/doc/classes/CFPropertyList/XML.src/M000009.html deleted file mode 100644 index 4457947..0000000 --- a/lib/cfpropertylist/doc/classes/CFPropertyList/XML.src/M000009.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - -
# File rbXMLCFPropertyList.rb, line 64 - def import_xml(node) - ret = nil - - case node.name - when 'dict' - hsh = Hash.new - key = nil - - if node.children? then - node.children.each do - |n| - - if n.name == "key" then - key = get_value(n) - else - raise CFFormatError.new("Format error!") if key.nil? - hsh[key] = import_xml(n) - key = nil - end - end - end - - ret = CFDictionary.new(hsh) - - when 'array' - ary = Array.new - - if node.children? then - node.children.each do - |n| - ary.push import_xml(n) - end - end - - ret = CFArray.new(ary) - - when 'true' - ret = CFBoolean.new(true) - when 'false' - ret = CFBoolean.new(false) - when 'real' - ret = CFReal.new(get_value(node).to_f) - when 'integer' - ret = CFInteger.new(get_value(node).to_i) - when 'string' - ret = CFString.new(get_value(node)) - when 'data' - ret = CFData.new(get_value(node)) - when 'date' - ret = CFDate.new(CFDate.parse_date(get_value(node))) - end - - return ret - end- - \ No newline at end of file diff --git a/lib/cfpropertylist/doc/created.rid b/lib/cfpropertylist/doc/created.rid deleted file mode 100644 index 495074c..0000000 --- a/lib/cfpropertylist/doc/created.rid +++ /dev/null @@ -1 +0,0 @@ -Tue, 02 Mar 2010 18:22:40 +0100 diff --git a/lib/cfpropertylist/doc/files/rbBinaryCFPropertyList_rb.html b/lib/cfpropertylist/doc/files/rbBinaryCFPropertyList_rb.html deleted file mode 100644 index c4bd200..0000000 --- a/lib/cfpropertylist/doc/files/rbBinaryCFPropertyList_rb.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - -
Path: | -rbBinaryCFPropertyList.rb - | -
Last Update: | -Tue Mar 02 18:22:30 +0100 2010 | -
-CFPropertyList implementation -parser class to read, manipulate and write binary property list files -(plist(5)) as defined by Apple -
-Author: | Christian Kruse (cjk@wwwtech.de) - - |
Copyright: | Copyright (c) 2010 - - |
License: | Distributes under the same terms as Ruby - - |
Path: | -rbCFFormatError.rb - | -
Last Update: | -Tue Mar 02 18:22:30 +0100 2010 | -
-CFFormatError implementation -
-Author: | Christian Kruse (cjk@wwwtech.de) - - |
Copyright: | Copyright (c) 2010 - - |
License: | MIT License - - |
Path: | -rbCFPropertyList.rb - | -
Last Update: | -Tue Mar 02 18:22:30 +0100 2010 | -
-CFPropertyList implementation -class to read, manipulate and write both XML and binary property list files -(plist(5)) as defined by Apple -
-- # create a arbitrary data structure of basic data types - data = { - 'name' => 'John Doe', - 'missing' => true, - 'last_seen' => Time.now, - 'friends' => ['Jane Doe','Julian Doe'], - 'likes' => { - 'me' => false - } - } - - # create CFPropertyList::List object - plist = CFPropertyList::List.new - - # call CFPropertyList.guess() to create corresponding CFType values - # pass in optional :convert_unknown_to_string => true to convert things like symbols into strings. - plist.value = CFPropertyList.guess(data) - - # write plist to file - plist.save("example.plist", CFPropertyList::List::FORMAT_BINARY) - - # … later, read it again - plist = CFPropertyList::List.new({:file => "example.plist"}) - data = CFPropertyList.native_types(plist.value) --
Author: | Christian Kruse (cjk@wwwtech.de) - - |
Copyright: | Copyright (c) 2010 - - |
License: | Distributes under the same terms as Ruby - - |
Path: | -rbCFTypes.rb - | -
Last Update: | -Tue Mar 02 18:22:30 +0100 2010 | -
-CFTypes, e.g. CFString, CFInteger needed to create unambiguous plists -
-Author: | Christian Kruse (cjk@wwwtech.de) - - |
Copyright: | Copyright (c) 2009 - - |
License: | Distributes under the same terms as Ruby - - |
Path: | -rbXMLCFPropertyList.rb - | -
Last Update: | -Tue Mar 02 18:22:30 +0100 2010 | -
-CFPropertyList implementation -parser class to read, manipulate and write XML property list files -(plist(5)) as defined by Apple -
-Author: | Christian Kruse (cjk@wwwtech.de) - - |
Copyright: | Copyright (c) 2010 - - |
License: | Distributes under the same terms as Ruby - - |