This class contains binary data values
Base64 encoded data
Raw data
set value to defined state, either base64 encoded or raw
# File lib/facter/util/cfpropertylist/lib/rbCFTypes.rb, line 162 def initialize(value=nil,format=DATA_BASE64) if(format == DATA_RAW) @raw_value = value @raw_value.blob = true else @value = value end end
get base64 decoded value
# File lib/facter/util/cfpropertylist/lib/rbCFTypes.rb, line 177 def decoded_value @raw_value ||= String.new(Base64.decode64(@value)) @raw_value.blob = true @raw_value end
get base64 encoded value
# File lib/facter/util/cfpropertylist/lib/rbCFTypes.rb, line 172 def encoded_value @value ||= "\n#{Base64.encode64(@raw_value).gsub("\n", '').scan(/.{1,76}/).join("\n")}\n" end
convert to binary
# File lib/facter/util/cfpropertylist/lib/rbCFTypes.rb, line 191 def to_binary(bplist) bplist.data_to_binary(decoded_value()) end
convert to XML
# File lib/facter/util/cfpropertylist/lib/rbCFTypes.rb, line 184 def to_xml(parser) n = parser.new_node('data') n = parser.append_node(n, parser.new_text(encoded_value())) n end
Generated with the Darkfish Rdoc Generator 2.