class CFPropertyList::CFData
This class contains binary data values
def decoded_value
def decoded_value @raw_value ||= String.new(Base64.decode64(@value)) @raw_value.blob = true @raw_value end
def encoded_value
def encoded_value @value ||= "\n#{Base64.encode64(@raw_value).gsub("\n", '').scan(/.{1,76}/).join("\n")}\n" end
def initialize(value=nil,format=DATA_BASE64)
def initialize(value=nil,format=DATA_BASE64) if(format == DATA_RAW) @raw_value = value @raw_value.blob = true else @value = value end end
def to_binary(bplist)
def to_binary(bplist) bplist.data_to_binary(decoded_value()) end
def to_xml(parser)
def to_xml(parser) n = parser.new_node('data') n = parser.append_node(n, parser.new_text(encoded_value())) n end