157 lines
No EOL
3.5 KiB
HTML
157 lines
No EOL
3.5 KiB
HTML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!DOCTYPE html
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
<head>
|
|
<title>File: rbCFPropertyList.rb</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
<script type="text/javascript">
|
|
// <![CDATA[
|
|
|
|
function popupCode( url ) {
|
|
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
}
|
|
|
|
function toggleCode( id ) {
|
|
if ( document.getElementById )
|
|
elem = document.getElementById( id );
|
|
else if ( document.all )
|
|
elem = eval( "document.all." + id );
|
|
else
|
|
return false;
|
|
|
|
elemStyle = elem.style;
|
|
|
|
if ( elemStyle.display != "block" ) {
|
|
elemStyle.display = "block"
|
|
} else {
|
|
elemStyle.display = "none"
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
// Make codeblocks hidden by default
|
|
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
|
|
// ]]>
|
|
</script>
|
|
|
|
</head>
|
|
<body>
|
|
|
|
|
|
|
|
<div id="fileHeader">
|
|
<h1>rbCFPropertyList.rb</h1>
|
|
<table class="header-table">
|
|
<tr class="top-aligned-row">
|
|
<td><strong>Path:</strong></td>
|
|
<td>rbCFPropertyList.rb
|
|
</td>
|
|
</tr>
|
|
<tr class="top-aligned-row">
|
|
<td><strong>Last Update:</strong></td>
|
|
<td>Tue Mar 02 18:22:30 +0100 2010</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<!-- banner header -->
|
|
|
|
<div id="bodyContent">
|
|
|
|
|
|
|
|
<div id="contextContent">
|
|
|
|
<div id="description">
|
|
<p>
|
|
<a href="../classes/CFPropertyList.html">CFPropertyList</a> implementation
|
|
class to read, manipulate and write both XML and binary property list files
|
|
(plist(5)) as defined by Apple
|
|
</p>
|
|
<h2>Example</h2>
|
|
<pre>
|
|
# 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)
|
|
</pre>
|
|
<table>
|
|
<tr><td valign="top">Author:</td><td>Christian Kruse (<a href="mailto:cjk@wwwtech.de">cjk@wwwtech.de</a>)
|
|
|
|
</td></tr>
|
|
<tr><td valign="top">Copyright:</td><td>Copyright (c) 2010
|
|
|
|
</td></tr>
|
|
<tr><td valign="top">License:</td><td>Distributes under the same terms as Ruby
|
|
|
|
</td></tr>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div id="requires-list">
|
|
<h3 class="section-bar">Required files</h3>
|
|
|
|
<div class="name-list">
|
|
libxml
|
|
kconv
|
|
date
|
|
iconv
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- if includes -->
|
|
|
|
<div id="section">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- if method_list -->
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div id="validator-badges">
|
|
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
</div>
|
|
|
|
</body>
|
|
</html> |