|
@ -73,9 +73,7 @@ String module compatible API.</p> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L1" target="_blank" class="view_source">Source</a> |
|
|
<a href="https://github.com/copenhas/ropex/blob/v0.1.1/lib/rope.ex#L1" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -144,7 +142,7 @@ String module compatible API.</p> |
|
|
</li> |
|
|
</li> |
|
|
<li> |
|
|
<li> |
|
|
<span class="summary_signature"> |
|
|
<span class="summary_signature"> |
|
|
<a href="#to_binary/1">to_binary/1</a> |
|
|
<a href="#to_string/1">to_string/1</a> |
|
|
</span> |
|
|
</span> |
|
|
</li> |
|
|
</li> |
|
|
|
|
|
|
|
@ -156,44 +154,95 @@ String module compatible API.</p> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="types_details" class="details_list"> |
|
|
|
|
|
<h2>Types</h2> |
|
|
|
|
|
<div class="type_detail"> |
|
|
|
|
|
<p class="typespec" id="t:rope/0"> |
|
|
|
|
|
<a href="#t:rope/0">rope</a> :: rnode_t | rleaf_t | nil |
|
|
|
|
|
</p> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="type_detail"> |
|
|
|
|
|
<p class="typespec" id="t:str/0"> |
|
|
|
|
|
<a href="#t:str/0">str</a> :: binary |
|
|
|
|
|
</p> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="type_detail"> |
|
|
|
|
|
<p class="typespec" id="t:codepoint/0"> |
|
|
|
|
|
<a href="#t:codepoint/0">codepoint</a> :: <a href="#t:str/0">str</a> |
|
|
|
|
|
</p> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="type_detail"> |
|
|
|
|
|
<p class="typespec" id="t:grapheme/0"> |
|
|
|
|
|
<a href="#t:grapheme/0">grapheme</a> :: <a href="#t:str/0">str</a> |
|
|
|
|
|
</p> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="functions_details" class="details_list"> |
|
|
<div id="functions_details" class="details_list"> |
|
|
<h2>Functions</h2> |
|
|
<h2>Functions</h2> |
|
|
<div class="detail"> |
|
|
<div class="detail"> |
|
|
<p class="signature" id="balanced?/1"> |
|
|
<p class="signature" id="balanced?/1"> |
|
|
<strong>balanced?(rope)</strong> |
|
|
<strong>balanced?(rope)</strong> |
|
|
</p> |
|
|
</p> |
|
|
|
|
|
|
|
|
|
|
|
<p>Specs:</p> |
|
|
|
|
|
<ul class="spec"> |
|
|
|
|
|
|
|
|
|
|
|
<li>balanced?(<a href="#t:rope/0">rope</a>) :: bool</li> |
|
|
|
|
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
|
<div class="docstring"><p>Checks if the rope is considered balanced based on comparing total length |
|
|
<div class="docstring"><p>Checks if the rope is considered balanced based on comparing total length |
|
|
and depth verses the fibanocci sequence.</p> |
|
|
and depth verses the fibanocci sequence.</p> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L164" target="_blank" class="view_source">Source</a> |
|
|
<a href="https://github.com/copenhas/ropex/blob/v0.1.1/lib/rope.ex#L173" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="detail"> |
|
|
<div class="detail"> |
|
|
<p class="signature" id="concat/2"> |
|
|
<p class="signature" id="concat/2"> |
|
|
<strong>concat(list1, opts // [])</strong> |
|
|
<strong>concat(list1, opts // [])</strong> |
|
|
</p> |
|
|
</p> |
|
|
|
|
|
|
|
|
|
|
|
<p>Specs:</p> |
|
|
|
|
|
<ul class="spec"> |
|
|
|
|
|
|
|
|
|
|
|
<li>concat([<a href="#t:rope/0">rope</a> | <a href="#t:str/0">str</a>], []) :: <a href="#t:rope/0">rope</a></li> |
|
|
|
|
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
|
<div class="docstring"><p>Concatenates the list of ropes or strings together into a single new rope. |
|
|
<div class="docstring"><p>Concatenates the list of ropes or strings together into a single new rope. |
|
|
Accepts ropes or strings as arguments. Additionally you can override the |
|
|
Accepts ropes or strings as arguments. Additionally you can override the |
|
|
auto-rebalancing behavior with a <code>rebalance: false</code> option.</p> |
|
|
auto-rebalancing behavior with a <code>rebalance: false</code> option.</p> |
|
|
|
|
|
|
|
|
<h2>Examples</h2> |
|
|
<h2>Examples</h2> |
|
|
|
|
|
|
|
|
<pre><code>iex> Rope.concat(["Time is", " an illusion."]) |> Rope.to_binary |
|
|
<pre><code>iex> Rope.concat(["Time is", " an illusion."]) |> Rope.to_string |
|
|
"Time is an illusion." |
|
|
"Time is an illusion." |
|
|
|
|
|
|
|
|
iex> Rope.concat([Rope.new("terrible"), " ghastly", " silence"]) |> Rope.to_binary |
|
|
iex> Rope.concat([Rope.new("terrible"), " ghastly", " silence"]) |> Rope.to_string |
|
|
"terrible ghastly silence" |
|
|
"terrible ghastly silence" |
|
|
</code></pre> |
|
|
</code></pre> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L95" target="_blank" class="view_source">Source</a> |
|
|
<a href="https://github.com/copenhas/ropex/blob/v0.1.1/lib/rope.ex#L95" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="detail"> |
|
|
<div class="detail"> |
|
|
<p class="signature" id="depth/1"> |
|
|
<p class="signature" id="depth/1"> |
|
|
<strong>depth(rope)</strong> |
|
|
<strong>depth(rope)</strong> |
|
|
</p> |
|
|
</p> |
|
|
|
|
|
|
|
|
|
|
|
<p>Specs:</p> |
|
|
|
|
|
<ul class="spec"> |
|
|
|
|
|
|
|
|
|
|
|
<li>depth(<a href="#t:rope/0">rope</a>) :: non_neg_integer</li> |
|
|
|
|
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
|
<div class="docstring"><p>Returns the depth of the rope tree. Only particularly of interest to |
|
|
<div class="docstring"><p>Returns the depth of the rope tree. Only particularly of interest to |
|
|
the curious, or those wanting to calculate for themselves when to |
|
|
the curious, or those wanting to calculate for themselves when to |
|
|
rebalance.</p> |
|
|
rebalance.</p> |
|
@ -210,13 +259,21 @@ iex> Rope.depth(Rope.concat([Rope.new("terrible"), " ghastly&q |
|
|
</code></pre> |
|
|
</code></pre> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L227" target="_blank" class="view_source">Source</a> |
|
|
<a href="https://github.com/copenhas/ropex/blob/v0.1.1/lib/rope.ex#L236" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="detail"> |
|
|
<div class="detail"> |
|
|
<p class="signature" id="find/2"> |
|
|
<p class="signature" id="find/2"> |
|
|
<strong>find(rope, term)</strong> |
|
|
<strong>find(rope, term)</strong> |
|
|
</p> |
|
|
</p> |
|
|
|
|
|
|
|
|
|
|
|
<p>Specs:</p> |
|
|
|
|
|
<ul class="spec"> |
|
|
|
|
|
|
|
|
|
|
|
<li>find(<a href="#t:rope/0">rope</a>, <a href="#t:str/0">str</a>) :: integer</li> |
|
|
|
|
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
|
<div class="docstring"><p>Returns the index of the first match or -1 if no match was found.</p> |
|
|
<div class="docstring"><p>Returns the index of the first match or -1 if no match was found.</p> |
|
|
|
|
|
|
|
|
<h2>Examples</h2> |
|
|
<h2>Examples</h2> |
|
@ -229,13 +286,21 @@ iex> Rope.find(Rope.concat(["loathe it", " or ignore it," |
|
|
</code></pre> |
|
|
</code></pre> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L304" target="_blank" class="view_source">Source</a> |
|
|
<a href="https://github.com/copenhas/ropex/blob/v0.1.1/lib/rope.ex#L313" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="detail"> |
|
|
<div class="detail"> |
|
|
<p class="signature" id="find_all/2"> |
|
|
<p class="signature" id="find_all/2"> |
|
|
<strong>find_all(rope, term)</strong> |
|
|
<strong>find_all(rope, term)</strong> |
|
|
</p> |
|
|
</p> |
|
|
|
|
|
|
|
|
|
|
|
<p>Specs:</p> |
|
|
|
|
|
<ul class="spec"> |
|
|
|
|
|
|
|
|
|
|
|
<li>find_all(<a href="#t:rope/0">rope</a>, <a href="#t:str/0">str</a>) :: [non_neg_integer]</li> |
|
|
|
|
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
|
<div class="docstring"><p>Find all matches in the rope returning a list of indexes, |
|
|
<div class="docstring"><p>Find all matches in the rope returning a list of indexes, |
|
|
or an empty list if no matches were found. The list is in order |
|
|
or an empty list if no matches were found. The list is in order |
|
|
from first to last match.</p> |
|
|
from first to last match.</p> |
|
@ -250,33 +315,49 @@ iex> Rope.find_all(Rope.concat(["loathe it", " or ignore it,&q |
|
|
</code></pre> |
|
|
</code></pre> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L355" target="_blank" class="view_source">Source</a> |
|
|
<a href="https://github.com/copenhas/ropex/blob/v0.1.1/lib/rope.ex#L364" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="detail"> |
|
|
<div class="detail"> |
|
|
<p class="signature" id="insert_at/3"> |
|
|
<p class="signature" id="insert_at/3"> |
|
|
<strong>insert_at(rope, index, str)</strong> |
|
|
<strong>insert_at(rope, index, str)</strong> |
|
|
</p> |
|
|
</p> |
|
|
|
|
|
|
|
|
|
|
|
<p>Specs:</p> |
|
|
|
|
|
<ul class="spec"> |
|
|
|
|
|
|
|
|
|
|
|
<li>insert_at(<a href="#t:rope/0">rope</a>, integer, <a href="#t:str/0">str</a>) :: <a href="#t:rope/0">rope</a></li> |
|
|
|
|
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
|
<div class="docstring"><p>Produces a new rope with the string inserted at the index provided. |
|
|
<div class="docstring"><p>Produces a new rope with the string inserted at the index provided. |
|
|
This wraps around so negative indexes will start from the end.</p> |
|
|
This wraps around so negative indexes will start from the end.</p> |
|
|
|
|
|
|
|
|
<h2>Examples</h2> |
|
|
<h2>Examples</h2> |
|
|
|
|
|
|
|
|
<pre><code>iex> Rope.insert_at(Rope.concat(["infinite ", "number ", "monkeys"]), 16, "of ") |> Rope.to_binary |
|
|
<pre><code>iex> Rope.insert_at(Rope.concat(["infinite ", "number ", "monkeys"]), 16, "of ") |> Rope.to_string |
|
|
"infinite number of monkeys" |
|
|
"infinite number of monkeys" |
|
|
|
|
|
|
|
|
iex> Rope.insert_at(Rope.concat(["infinite ", "number ", "monkeys"]), -7, "of ") |> Rope.to_binary |
|
|
iex> Rope.insert_at(Rope.concat(["infinite ", "number ", "monkeys"]), -7, "of ") |> Rope.to_string |
|
|
"infinite number of monkeys" |
|
|
"infinite number of monkeys" |
|
|
</code></pre> |
|
|
</code></pre> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L248" target="_blank" class="view_source">Source</a> |
|
|
<a href="https://github.com/copenhas/ropex/blob/v0.1.1/lib/rope.ex#L257" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="detail"> |
|
|
<div class="detail"> |
|
|
<p class="signature" id="length/1"> |
|
|
<p class="signature" id="length/1"> |
|
|
<strong>length(rope)</strong> |
|
|
<strong>length(rope)</strong> |
|
|
</p> |
|
|
</p> |
|
|
|
|
|
|
|
|
|
|
|
<p>Specs:</p> |
|
|
|
|
|
<ul class="spec"> |
|
|
|
|
|
|
|
|
|
|
|
<li>length(<a href="#t:rope/0">rope</a>) :: non_neg_integer</li> |
|
|
|
|
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
|
<div class="docstring"><p>Retrieve the length in ut8 characters in the rope.</p> |
|
|
<div class="docstring"><p>Retrieve the length in ut8 characters in the rope.</p> |
|
|
|
|
|
|
|
|
<h2>Examples</h2> |
|
|
<h2>Examples</h2> |
|
@ -286,93 +367,141 @@ iex> Rope.insert_at(Rope.concat(["infinite ", "number ", |
|
|
</code></pre> |
|
|
</code></pre> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L202" target="_blank" class="view_source">Source</a> |
|
|
<a href="https://github.com/copenhas/ropex/blob/v0.1.1/lib/rope.ex#L211" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="detail"> |
|
|
<div class="detail"> |
|
|
<p class="signature" id="new/1"> |
|
|
<p class="signature" id="new/1"> |
|
|
<strong>new(str)</strong> |
|
|
<strong>new(str)</strong> |
|
|
</p> |
|
|
</p> |
|
|
|
|
|
|
|
|
|
|
|
<p>Specs:</p> |
|
|
|
|
|
<ul class="spec"> |
|
|
|
|
|
|
|
|
|
|
|
<li>new(<a href="#t:str/0">str</a> | nil) :: <a href="#t:rope/0">rope</a></li> |
|
|
|
|
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
|
<div class="docstring"><p>Creates a new rope with the string provided. Not needed since |
|
|
<div class="docstring"><p>Creates a new rope with the string provided. Not needed since |
|
|
<a href="#concat/2"><code>concat/2</code></a> supports strings and ropes as arguments.</p> |
|
|
<a href="#concat/2"><code>concat/2</code></a> supports strings and ropes as arguments.</p> |
|
|
|
|
|
|
|
|
<h2>Examples</h2> |
|
|
<h2>Examples</h2> |
|
|
|
|
|
|
|
|
<pre><code>iex> Rope.new("Don't panic") |> Rope.to_binary |
|
|
<pre><code>iex> Rope.new("Don't panic") |> Rope.to_string |
|
|
"Don't panic" |
|
|
"Don't panic" |
|
|
</code></pre> |
|
|
</code></pre> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L73" target="_blank" class="view_source">Source</a> |
|
|
<a href="https://github.com/copenhas/ropex/blob/v0.1.1/lib/rope.ex#L73" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="detail"> |
|
|
<div class="detail"> |
|
|
<p class="signature" id="rebalance/1"> |
|
|
<p class="signature" id="rebalance/1"> |
|
|
<strong>rebalance(rope)</strong> |
|
|
<strong>rebalance(rope)</strong> |
|
|
</p> |
|
|
</p> |
|
|
|
|
|
|
|
|
|
|
|
<p>Specs:</p> |
|
|
|
|
|
<ul class="spec"> |
|
|
|
|
|
|
|
|
|
|
|
<li>rebalance(<a href="#t:rope/0">rope</a>) :: <a href="#t:rope/0">rope</a></li> |
|
|
|
|
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
|
<div class="docstring"><p>Rebalance the rope explicitly to help keep insert, remove, etc |
|
|
<div class="docstring"><p>Rebalance the rope explicitly to help keep insert, remove, etc |
|
|
efficient. This is a pretty greedy rebalancing and should produce |
|
|
efficient. This is a pretty greedy rebalancing and should produce |
|
|
a fully balanced rope.</p> |
|
|
a fully balanced rope.</p> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L181" target="_blank" class="view_source">Source</a> |
|
|
<a href="https://github.com/copenhas/ropex/blob/v0.1.1/lib/rope.ex#L190" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="detail"> |
|
|
<div class="detail"> |
|
|
<p class="signature" id="remove_at/3"> |
|
|
<p class="signature" id="remove_at/3"> |
|
|
<strong>remove_at(rope, index, len)</strong> |
|
|
<strong>remove_at(rope, index, len)</strong> |
|
|
</p> |
|
|
</p> |
|
|
|
|
|
|
|
|
|
|
|
<p>Specs:</p> |
|
|
|
|
|
<ul class="spec"> |
|
|
|
|
|
|
|
|
|
|
|
<li>remove_at(<a href="#t:rope/0">rope</a>, integer, non_neg_integer) :: <a href="#t:rope/0">rope</a></li> |
|
|
|
|
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
|
<div class="docstring"><p>Produces a new rope with the substr defined by the starting index and the length of |
|
|
<div class="docstring"><p>Produces a new rope with the substr defined by the starting index and the length of |
|
|
characters removed. The advantage of this is it takes full advantage of ropes |
|
|
characters removed. The advantage of this is it takes full advantage of ropes |
|
|
being optimized for index based operation.</p> |
|
|
being optimized for index based operation.</p> |
|
|
|
|
|
|
|
|
<h2>Examples</h2> |
|
|
<h2>Examples</h2> |
|
|
|
|
|
|
|
|
<pre><code>iex> Rope.remove_at(Rope.concat(["infinite ", "number of ", "monkeys"]), 19, 3) |> Rope.to_binary |
|
|
<pre><code>iex> Rope.remove_at(Rope.concat(["infinite ", "number of ", "monkeys"]), 19, 3) |> Rope.to_string |
|
|
"infinite number of keys" |
|
|
"infinite number of keys" |
|
|
|
|
|
|
|
|
iex> Rope.remove_at(Rope.concat(["infinite ", "number of ", "monkeys"]), -7, 3) |> Rope.to_binary |
|
|
iex> Rope.remove_at(Rope.concat(["infinite ", "number of ", "monkeys"]), -7, 3) |> Rope.to_string |
|
|
"infinite number of keys" |
|
|
"infinite number of keys" |
|
|
</code></pre> |
|
|
</code></pre> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L277" target="_blank" class="view_source">Source</a> |
|
|
<a href="https://github.com/copenhas/ropex/blob/v0.1.1/lib/rope.ex#L286" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="detail"> |
|
|
<div class="detail"> |
|
|
<p class="signature" id="replace/4"> |
|
|
<p class="signature" id="replace/4"> |
|
|
<strong>replace(rope, pattern, replacement, opts // [])</strong> |
|
|
<strong>replace(rope, pattern, replacement, opts // [])</strong> |
|
|
</p> |
|
|
</p> |
|
|
|
|
|
|
|
|
|
|
|
<p>Specs:</p> |
|
|
|
|
|
<ul class="spec"> |
|
|
|
|
|
|
|
|
|
|
|
<li>replace(<a href="#t:rope/0">rope</a>, <a href="#t:str/0">str</a>, <a href="#t:str/0">str</a>, []) :: <a href="#t:rope/0">rope</a></li> |
|
|
|
|
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
|
<div class="docstring"><p>Replaces the first match with the replacement text and returns |
|
|
<div class="docstring"><p>Replaces the first match with the replacement text and returns |
|
|
the new rope. If not found then the existing rope is returned. |
|
|
the new rope. If not found then the existing rope is returned. |
|
|
By default, it replaces all entries, except if the global option |
|
|
By default, it replaces all entries, except if the global option |
|
|
is set to false.</p> |
|
|
is set to false.</p> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L390" target="_blank" class="view_source">Source</a> |
|
|
<a href="https://github.com/copenhas/ropex/blob/v0.1.1/lib/rope.ex#L399" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="detail"> |
|
|
<div class="detail"> |
|
|
<p class="signature" id="slice/3"> |
|
|
<p class="signature" id="slice/3"> |
|
|
<strong>slice(rope, start, len)</strong> |
|
|
<strong>slice(rope, start, len)</strong> |
|
|
</p> |
|
|
</p> |
|
|
|
|
|
|
|
|
|
|
|
<p>Specs:</p> |
|
|
|
|
|
<ul class="spec"> |
|
|
|
|
|
|
|
|
|
|
|
<li>slice(<a href="#t:rope/0">rope</a>, integer, integer) :: <a href="#t:rope/0">rope</a></li> |
|
|
|
|
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
|
<div class="docstring"><p>Returns a sub-rope starting at the offset given by the first, and a length given by |
|
|
<div class="docstring"><p>Returns a sub-rope starting at the offset given by the first, and a length given by |
|
|
the second. If the offset is greater than string length, than it returns nil.</p> |
|
|
the second. If the offset is greater than string length, than it returns nil.</p> |
|
|
|
|
|
|
|
|
<p>Similar to String.slice/3, check the tests for some examples of usage.</p> |
|
|
<p>Similar to String.slice/3, check the tests for some examples of usage.</p> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L111" target="_blank" class="view_source">Source</a> |
|
|
<a href="https://github.com/copenhas/ropex/blob/v0.1.1/lib/rope.ex#L111" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="detail"> |
|
|
<div class="detail"> |
|
|
<p class="signature" id="to_binary/1"> |
|
|
<p class="signature" id="to_string/1"> |
|
|
<strong>to_binary(rope)</strong> |
|
|
<strong>to_string(rope)</strong> |
|
|
</p> |
|
|
</p> |
|
|
|
|
|
|
|
|
|
|
|
<p>Specs:</p> |
|
|
|
|
|
<ul class="spec"> |
|
|
|
|
|
|
|
|
|
|
|
<li>to_string(<a href="#t:rope/0">rope</a>) :: binary</li> |
|
|
|
|
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
|
<div class="docstring"><p>Converts the entire rope to a single binary.</p> |
|
|
<div class="docstring"><p>Converts the entire rope to a single binary.</p> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L404" target="_blank" class="view_source">Source</a> |
|
|
<a href="https://github.com/copenhas/ropex/blob/v0.1.1/lib/rope.ex#L413" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|