first commit

This commit is contained in:
Jeena Paradies 2010-06-12 17:59:50 +02:00
commit 2bba8c5fee
122 changed files with 8389 additions and 0 deletions

View file

@ -0,0 +1,710 @@
<?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>Class: CFPropertyList::Binary</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="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Class</strong></td>
<td class="class-name-in-header">CFPropertyList::Binary</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/rbBinaryCFPropertyList_rb.html">
rbBinaryCFPropertyList.rb
</a>
<br />
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Parent:</strong></td>
<td>
Object
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000048">array_to_binary</a>&nbsp;&nbsp;
<a href="#M000040">binary_strlen</a>&nbsp;&nbsp;
<a href="#M000046">bool_to_binary</a>&nbsp;&nbsp;
<a href="#M000034">bytes_int</a>&nbsp;&nbsp;
<a href="#M000036">bytes_needed</a>&nbsp;&nbsp;
<a href="#M000033">bytes_size_int</a>&nbsp;&nbsp;
<a href="#M000026">charset_convert</a>&nbsp;&nbsp;
<a href="#M000027">charset_strlen</a>&nbsp;&nbsp;
<a href="#M000047">data_to_binary</a>&nbsp;&nbsp;
<a href="#M000045">date_to_binary</a>&nbsp;&nbsp;
<a href="#M000049">dict_to_binary</a>&nbsp;&nbsp;
<a href="#M000037">int_bytes</a>&nbsp;&nbsp;
<a href="#M000042">int_to_binary</a>&nbsp;&nbsp;
<a href="#M000018">load</a>&nbsp;&nbsp;
<a href="#M000044">num_to_binary</a>&nbsp;&nbsp;
<a href="#M000035">pack_it_with_size</a>&nbsp;&nbsp;
<a href="#M000029">read_binary_array</a>&nbsp;&nbsp;
<a href="#M000024">read_binary_data</a>&nbsp;&nbsp;
<a href="#M000023">read_binary_date</a>&nbsp;&nbsp;
<a href="#M000030">read_binary_dict</a>&nbsp;&nbsp;
<a href="#M000021">read_binary_int</a>&nbsp;&nbsp;
<a href="#M000020">read_binary_null_type</a>&nbsp;&nbsp;
<a href="#M000031">read_binary_object</a>&nbsp;&nbsp;
<a href="#M000032">read_binary_object_at</a>&nbsp;&nbsp;
<a href="#M000022">read_binary_real</a>&nbsp;&nbsp;
<a href="#M000025">read_binary_string</a>&nbsp;&nbsp;
<a href="#M000028">read_binary_unicode_string</a>&nbsp;&nbsp;
<a href="#M000043">real_to_binary</a>&nbsp;&nbsp;
<a href="#M000041">string_to_binary</a>&nbsp;&nbsp;
<a href="#M000019">to_str</a>&nbsp;&nbsp;
<a href="#M000038">type_bytes</a>&nbsp;&nbsp;
<a href="#M000039">unique_and_count_values</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Class methods</h3>
<div id="method-M000040" class="method-detail">
<a name="M000040"></a>
<div class="method-heading">
<a href="Binary.src/M000040.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000040.html');return false;">
<span class="method-name">binary_strlen</span><span class="method-args">(val)</span>
</a>
</div>
<div class="method-description">
<p>
Counts the number of bytes the string will have when coded; utf-16be if
non-ascii characters are present.
</p>
</div>
</div>
<div id="method-M000034" class="method-detail">
<a name="M000034"></a>
<div class="method-heading">
<a href="Binary.src/M000034.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000034.html');return false;">
<span class="method-name">bytes_int</span><span class="method-args">(int)</span>
</a>
</div>
<div class="method-description">
<p>
Calculate the byte needed for a „normal” integer value
</p>
</div>
</div>
<div id="method-M000036" class="method-detail">
<a name="M000036"></a>
<div class="method-heading">
<a href="Binary.src/M000036.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000036.html');return false;">
<span class="method-name">bytes_needed</span><span class="method-args">(count)</span>
</a>
</div>
<div class="method-description">
<p>
calculate how many bytes are needed to save <tt>count</tt>
</p>
</div>
</div>
<div id="method-M000033" class="method-detail">
<a name="M000033"></a>
<div class="method-heading">
<a href="Binary.src/M000033.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000033.html');return false;">
<span class="method-name">bytes_size_int</span><span class="method-args">(int)</span>
</a>
</div>
<div class="method-description">
<p>
calculate the bytes needed for a size integer value
</p>
</div>
</div>
<div id="method-M000026" class="method-detail">
<a name="M000026"></a>
<div class="method-heading">
<a href="Binary.src/M000026.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000026.html');return false;">
<span class="method-name">charset_convert</span><span class="method-args">(str,from,to=&quot;UTF-8&quot;)</span>
</a>
</div>
<div class="method-description">
<p>
Convert the given string from one charset to another
</p>
</div>
</div>
<div id="method-M000027" class="method-detail">
<a name="M000027"></a>
<div class="method-heading">
<a href="Binary.src/M000027.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000027.html');return false;">
<span class="method-name">charset_strlen</span><span class="method-args">(str,charset=&quot;UTF-8&quot;)</span>
</a>
</div>
<div class="method-description">
<p>
Count characters considering character set
</p>
</div>
</div>
<div id="method-M000037" class="method-detail">
<a name="M000037"></a>
<div class="method-heading">
<a href="Binary.src/M000037.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000037.html');return false;">
<span class="method-name">int_bytes</span><span class="method-args">(int)</span>
</a>
</div>
<div class="method-description">
<p>
create integer bytes of <tt>int</tt>
</p>
</div>
</div>
<div id="method-M000035" class="method-detail">
<a name="M000035"></a>
<div class="method-heading">
<a href="Binary.src/M000035.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000035.html');return false;">
<span class="method-name">pack_it_with_size</span><span class="method-args">(nbytes,int)</span>
</a>
</div>
<div class="method-description">
<p>
pack an <tt>int</tt> of <tt>nbytes</tt> with size
</p>
</div>
</div>
<div id="method-M000038" class="method-detail">
<a name="M000038"></a>
<div class="method-heading">
<a href="Binary.src/M000038.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000038.html');return false;">
<span class="method-name">type_bytes</span><span class="method-args">(type,type_len)</span>
</a>
</div>
<div class="method-description">
<p>
Create a type byte for binary format as defined by apple
</p>
</div>
</div>
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000048" class="method-detail">
<a name="M000048"></a>
<div class="method-heading">
<a href="Binary.src/M000048.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000048.html');return false;">
<span class="method-name">array_to_binary</span><span class="method-args">(val)</span>
</a>
</div>
<div class="method-description">
<p>
Convert array to binary format and add it to the object table
</p>
</div>
</div>
<div id="method-M000046" class="method-detail">
<a name="M000046"></a>
<div class="method-heading">
<a href="Binary.src/M000046.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000046.html');return false;">
<span class="method-name">bool_to_binary</span><span class="method-args">(val)</span>
</a>
</div>
<div class="method-description">
<p>
Convert a bool value to binary and add it to the object table
</p>
</div>
</div>
<div id="method-M000047" class="method-detail">
<a name="M000047"></a>
<div class="method-heading">
<a href="Binary.src/M000047.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000047.html');return false;">
<span class="method-name">data_to_binary</span><span class="method-args">(val)</span>
</a>
</div>
<div class="method-description">
<p>
Convert data value to binary format and add it to the object table
</p>
</div>
</div>
<div id="method-M000045" class="method-detail">
<a name="M000045"></a>
<div class="method-heading">
<a href="Binary.src/M000045.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000045.html');return false;">
<span class="method-name">date_to_binary</span><span class="method-args">(val)</span>
</a>
</div>
<div class="method-description">
<p>
Convert date value (apple format) to binary and adds it to the object table
</p>
</div>
</div>
<div id="method-M000049" class="method-detail">
<a name="M000049"></a>
<div class="method-heading">
<a href="Binary.src/M000049.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000049.html');return false;">
<span class="method-name">dict_to_binary</span><span class="method-args">(val)</span>
</a>
</div>
<div class="method-description">
<p>
Convert dictionary to binary format and add it to the object table
</p>
</div>
</div>
<div id="method-M000042" class="method-detail">
<a name="M000042"></a>
<div class="method-heading">
<a href="Binary.src/M000042.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000042.html');return false;">
<span class="method-name">int_to_binary</span><span class="method-args">(value)</span>
</a>
</div>
<div class="method-description">
<p>
Codes an integer to binary format
</p>
</div>
</div>
<div id="method-M000018" class="method-detail">
<a name="M000018"></a>
<div class="method-heading">
<a href="Binary.src/M000018.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000018.html');return false;">
<span class="method-name">load</span><span class="method-args">(opts)</span>
</a>
</div>
<div class="method-description">
<p>
Read a binary plist file
</p>
</div>
</div>
<div id="method-M000044" class="method-detail">
<a name="M000044"></a>
<div class="method-heading">
<a href="Binary.src/M000044.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000044.html');return false;">
<span class="method-name">num_to_binary</span><span class="method-args">(value)</span>
</a>
</div>
<div class="method-description">
<p>
Converts a numeric value to binary and adds it to the object table
</p>
</div>
</div>
<div id="method-M000043" class="method-detail">
<a name="M000043"></a>
<div class="method-heading">
<a href="Binary.src/M000043.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000043.html');return false;">
<span class="method-name">real_to_binary</span><span class="method-args">(val)</span>
</a>
</div>
<div class="method-description">
<p>
Codes a real value to binary format
</p>
</div>
</div>
<div id="method-M000041" class="method-detail">
<a name="M000041"></a>
<div class="method-heading">
<a href="Binary.src/M000041.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000041.html');return false;">
<span class="method-name">string_to_binary</span><span class="method-args">(val)</span>
</a>
</div>
<div class="method-description">
<p>
Uniques and transforms a string value to binary format and adds it to the
object table
</p>
</div>
</div>
<div id="method-M000019" class="method-detail">
<a name="M000019"></a>
<div class="method-heading">
<a href="Binary.src/M000019.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000019.html');return false;">
<span class="method-name">to_str</span><span class="method-args">(opts={})</span>
</a>
</div>
<div class="method-description">
<p>
Convert <a href="../CFPropertyList.html">CFPropertyList</a> to binary
format; since we have to count our objects we simply unique <a
href="CFDictionary.html">CFDictionary</a> and <a
href="CFArray.html">CFArray</a>
</p>
</div>
</div>
<h3 class="section-bar">Protected Instance methods</h3>
<div id="method-M000029" class="method-detail">
<a name="M000029"></a>
<div class="method-heading">
<a href="Binary.src/M000029.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000029.html');return false;">
<span class="method-name">read_binary_array</span><span class="method-args">(fname,fd,length)</span>
</a>
</div>
<div class="method-description">
<p>
Read an binary array value, including contained objects
</p>
</div>
</div>
<div id="method-M000024" class="method-detail">
<a name="M000024"></a>
<div class="method-heading">
<a href="Binary.src/M000024.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000024.html');return false;">
<span class="method-name">read_binary_data</span><span class="method-args">(fname,fd,length)</span>
</a>
</div>
<div class="method-description">
<p>
Read a binary data value
</p>
</div>
</div>
<div id="method-M000023" class="method-detail">
<a name="M000023"></a>
<div class="method-heading">
<a href="Binary.src/M000023.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000023.html');return false;">
<span class="method-name">read_binary_date</span><span class="method-args">(fname,fd,length)</span>
</a>
</div>
<div class="method-description">
<p>
read a binary date value
</p>
</div>
</div>
<div id="method-M000030" class="method-detail">
<a name="M000030"></a>
<div class="method-heading">
<a href="Binary.src/M000030.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000030.html');return false;">
<span class="method-name">read_binary_dict</span><span class="method-args">(fname,fd,length)</span>
</a>
</div>
<div class="method-description">
<p>
Read a dictionary value, including contained objects
</p>
</div>
</div>
<div id="method-M000021" class="method-detail">
<a name="M000021"></a>
<div class="method-heading">
<a href="Binary.src/M000021.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000021.html');return false;">
<span class="method-name">read_binary_int</span><span class="method-args">(fname,fd,length)</span>
</a>
</div>
<div class="method-description">
<p>
read a binary int value
</p>
</div>
</div>
<div id="method-M000020" class="method-detail">
<a name="M000020"></a>
<div class="method-heading">
<a href="Binary.src/M000020.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000020.html');return false;">
<span class="method-name">read_binary_null_type</span><span class="method-args">(length)</span>
</a>
</div>
<div class="method-description">
<p>
read a „null” type (i.e. null byte, marker byte, bool value)
</p>
</div>
</div>
<div id="method-M000031" class="method-detail">
<a name="M000031"></a>
<div class="method-heading">
<a href="Binary.src/M000031.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000031.html');return false;">
<span class="method-name">read_binary_object</span><span class="method-args">(fname,fd)</span>
</a>
</div>
<div class="method-description">
<p>
Read an object type byte, decode it and delegate to the correct reader
function
</p>
</div>
</div>
<div id="method-M000032" class="method-detail">
<a name="M000032"></a>
<div class="method-heading">
<a href="Binary.src/M000032.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000032.html');return false;">
<span class="method-name">read_binary_object_at</span><span class="method-args">(fname,fd,pos)</span>
</a>
</div>
<div class="method-description">
<p>
Read an object type byte at position $pos, decode it and delegate to the
correct reader function
</p>
</div>
</div>
<div id="method-M000022" class="method-detail">
<a name="M000022"></a>
<div class="method-heading">
<a href="Binary.src/M000022.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000022.html');return false;">
<span class="method-name">read_binary_real</span><span class="method-args">(fname,fd,length)</span>
</a>
</div>
<div class="method-description">
<p>
read a binary real value
</p>
</div>
</div>
<div id="method-M000025" class="method-detail">
<a name="M000025"></a>
<div class="method-heading">
<a href="Binary.src/M000025.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000025.html');return false;">
<span class="method-name">read_binary_string</span><span class="method-args">(fname,fd,length)</span>
</a>
</div>
<div class="method-description">
<p>
Read a binary string value
</p>
</div>
</div>
<div id="method-M000028" class="method-detail">
<a name="M000028"></a>
<div class="method-heading">
<a href="Binary.src/M000028.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000028.html');return false;">
<span class="method-name">read_binary_unicode_string</span><span class="method-args">(fname,fd,length)</span>
</a>
</div>
<div class="method-description">
<p>
Read a unicode string value, coded as UTF-16BE
</p>
</div>
</div>
<div id="method-M000039" class="method-detail">
<a name="M000039"></a>
<div class="method-heading">
<a href="Binary.src/M000039.html" target="Code" class="method-signature"
onclick="popupCode('Binary.src/M000039.html');return false;">
<span class="method-name">unique_and_count_values</span><span class="method-args">(value)</span>
</a>
</div>
<div class="method-description">
<p>
„unique” and count values. „Unique” means, several objects (e.g.
strings) will only be saved once and referenced later
</p>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>