ocaml-containers/0.21/CCBigstring.html
2016-11-03 16:14:53 +01:00

216 lines
No EOL
16 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="previous" href="CCParse.html">
<link rel="next" href="CCArray1.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of class methods" rel=Appendix href="index_methods.html">
<link title="Index of class types" rel=Appendix href="index_class_types.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="CCVector" rel="Chapter" href="CCVector.html">
<link title="CCPrint" rel="Chapter" href="CCPrint.html">
<link title="CCError" rel="Chapter" href="CCError.html">
<link title="CCHeap" rel="Chapter" href="CCHeap.html">
<link title="CCList" rel="Chapter" href="CCList.html">
<link title="CCOpt" rel="Chapter" href="CCOpt.html">
<link title="CCPair" rel="Chapter" href="CCPair.html">
<link title="CCFun" rel="Chapter" href="CCFun.html">
<link title="CCHash" rel="Chapter" href="CCHash.html">
<link title="CCInt" rel="Chapter" href="CCInt.html">
<link title="CCBool" rel="Chapter" href="CCBool.html">
<link title="CCFloat" rel="Chapter" href="CCFloat.html">
<link title="CCArray" rel="Chapter" href="CCArray.html">
<link title="CCRef" rel="Chapter" href="CCRef.html">
<link title="CCSet" rel="Chapter" href="CCSet.html">
<link title="CCOrd" rel="Chapter" href="CCOrd.html">
<link title="CCRandom" rel="Chapter" href="CCRandom.html">
<link title="CCString" rel="Chapter" href="CCString.html">
<link title="CCHashtbl" rel="Chapter" href="CCHashtbl.html">
<link title="CCMap" rel="Chapter" href="CCMap.html">
<link title="CCFormat" rel="Chapter" href="CCFormat.html">
<link title="CCIO" rel="Chapter" href="CCIO.html">
<link title="CCInt64" rel="Chapter" href="CCInt64.html">
<link title="CCChar" rel="Chapter" href="CCChar.html">
<link title="CCResult" rel="Chapter" href="CCResult.html">
<link title="Containers" rel="Chapter" href="Containers.html">
<link title="CCKTree" rel="Chapter" href="CCKTree.html">
<link title="CCKList" rel="Chapter" href="CCKList.html">
<link title="CCLazy_list" rel="Chapter" href="CCLazy_list.html">
<link title="CCMultiMap" rel="Chapter" href="CCMultiMap.html">
<link title="CCMultiSet" rel="Chapter" href="CCMultiSet.html">
<link title="CCTrie" rel="Chapter" href="CCTrie.html">
<link title="CCFlatHashtbl" rel="Chapter" href="CCFlatHashtbl.html">
<link title="CCCache" rel="Chapter" href="CCCache.html">
<link title="CCPersistentHashtbl" rel="Chapter" href="CCPersistentHashtbl.html">
<link title="CCDeque" rel="Chapter" href="CCDeque.html">
<link title="CCFQueue" rel="Chapter" href="CCFQueue.html">
<link title="CCBV" rel="Chapter" href="CCBV.html">
<link title="CCMixtbl" rel="Chapter" href="CCMixtbl.html">
<link title="CCMixmap" rel="Chapter" href="CCMixmap.html">
<link title="CCRingBuffer" rel="Chapter" href="CCRingBuffer.html">
<link title="CCIntMap" rel="Chapter" href="CCIntMap.html">
<link title="CCPersistentArray" rel="Chapter" href="CCPersistentArray.html">
<link title="CCMixset" rel="Chapter" href="CCMixset.html">
<link title="CCHashconsedSet" rel="Chapter" href="CCHashconsedSet.html">
<link title="CCGraph" rel="Chapter" href="CCGraph.html">
<link title="CCHashSet" rel="Chapter" href="CCHashSet.html">
<link title="CCBitField" rel="Chapter" href="CCBitField.html">
<link title="CCHashTrie" rel="Chapter" href="CCHashTrie.html">
<link title="CCBloom" rel="Chapter" href="CCBloom.html">
<link title="CCWBTree" rel="Chapter" href="CCWBTree.html">
<link title="CCRAL" rel="Chapter" href="CCRAL.html">
<link title="CCAllocCache" rel="Chapter" href="CCAllocCache.html">
<link title="CCImmutArray" rel="Chapter" href="CCImmutArray.html">
<link title="CCHet" rel="Chapter" href="CCHet.html">
<link title="Containers_string" rel="Chapter" href="Containers_string.html">
<link title="CCKMP" rel="Chapter" href="CCKMP.html">
<link title="CCLevenshtein" rel="Chapter" href="CCLevenshtein.html">
<link title="CCApp_parse" rel="Chapter" href="CCApp_parse.html">
<link title="CCParse" rel="Chapter" href="CCParse.html">
<link title="CCBigstring" rel="Chapter" href="CCBigstring.html">
<link title="CCArray1" rel="Chapter" href="CCArray1.html">
<link title="CCPool" rel="Chapter" href="CCPool.html">
<link title="CCLock" rel="Chapter" href="CCLock.html">
<link title="CCSemaphore" rel="Chapter" href="CCSemaphore.html">
<link title="CCThread" rel="Chapter" href="CCThread.html">
<link title="CCBlockingQueue" rel="Chapter" href="CCBlockingQueue.html">
<link title="CCTimer" rel="Chapter" href="CCTimer.html">
<link title="Containers_advanced" rel="Chapter" href="Containers_advanced.html">
<link title="CCLinq" rel="Chapter" href="CCLinq.html">
<link title="CCBatch" rel="Chapter" href="CCBatch.html">
<link title="CCCat" rel="Chapter" href="CCCat.html">
<link title="CCMonadIO" rel="Chapter" href="CCMonadIO.html">
<link title="Containers_io_is_deprecated" rel="Chapter" href="Containers_io_is_deprecated.html">
<link title="CCUnix" rel="Chapter" href="CCUnix.html">
<link title="CCSexp" rel="Chapter" href="CCSexp.html">
<link title="CCSexpM" rel="Chapter" href="CCSexpM.html"><link title="Conversions" rel="Section" href="#2_Conversions">
<link title="Memory-map" rel="Section" href="#2_Memorymap">
<title>Containers doc : CCBigstring</title>
</head>
<body>
<div class="navbar"><a class="pre" href="CCParse.html" title="CCParse">Previous</a>
&nbsp;<a class="up" href="index.html" title="Index">Up</a>
&nbsp;<a class="post" href="CCArray1.html" title="CCArray1">Next</a>
</div>
<h1>Module <a href="type_CCBigstring.html">CCBigstring</a></h1>
<pre><span class="keyword">module</span> CCBigstring: <code class="code"><span class="keyword">sig</span></code> <a href="CCBigstring.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info module top">
<span class="warning">Deprecated.</span>use the package <code class="code">bigstring</code> instead.
<p>
<b>status: deprecated, do not use anymore</b><br>
<h1 id="1_Interfaceto1dimensionBigarraysofbyteschar">Interface to 1-dimension Bigarrays of bytes (char)</h1><br>
<b>Since</b> 0.7<br>
</div>
<hr width="100%">
<pre><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> = <code class="type">(char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t</code> </pre>
<pre><span id="VALcreate"><span class="keyword">val</span> create</span> : <code class="type">int -> <a href="CCBigstring.html#TYPEt">t</a></code></pre><div class="info ">
Create a new bigstring of the given size.<br>
</div>
<pre><span id="VALempty"><span class="keyword">val</span> empty</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a></code></pre><div class="info ">
Empty string<br>
</div>
<pre><span id="VALinit"><span class="keyword">val</span> init</span> : <code class="type">int -> (int -> char) -> <a href="CCBigstring.html#TYPEt">t</a></code></pre><div class="info ">
Initialize with the given function (called at every index)<br>
</div>
<pre><span id="VALfill"><span class="keyword">val</span> fill</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> char -> unit</code></pre><div class="info ">
Fill with a single byte<br>
</div>
<pre><span id="VALsize"><span class="keyword">val</span> size</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> int</code></pre><div class="info ">
Number of bytes<br>
</div>
<pre><span id="VALlength"><span class="keyword">val</span> length</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> int</code></pre><div class="info ">
Alias for <code class="code">size</code>.<br>
<b>Since</b> 0.8<br>
</div>
<pre><span id="VALget"><span class="keyword">val</span> get</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> int -> char</code></pre>
<pre><span id="VALset"><span class="keyword">val</span> set</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> int -> char -> unit</code></pre>
<pre><span id="VALblit"><span class="keyword">val</span> blit</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> int -> <a href="CCBigstring.html#TYPEt">t</a> -> int -> int -> unit</code></pre><div class="info ">
Blit a slice of the bigstring into another<br>
</div>
<pre><span id="VALcopy"><span class="keyword">val</span> copy</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> <a href="CCBigstring.html#TYPEt">t</a></code></pre><div class="info ">
Copy of the string<br>
</div>
<pre><span id="VALsub"><span class="keyword">val</span> sub</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> int -> int -> <a href="CCBigstring.html#TYPEt">t</a></code></pre><div class="info ">
<code class="code">sub s i len</code> takes a slice of length <code class="code">len</code> from the string <code class="code">s</code>, starting
at offset <code class="code">i</code>.<br>
<b>Raises</b> <code>Invalid_argument</code> if <code class="code">i, len</code> doesn't designate a valid substring<br>
</div>
<pre><span id="VALfold"><span class="keyword">val</span> fold</span> : <code class="type">('a -> char -> 'a) -> 'a -> <a href="CCBigstring.html#TYPEt">t</a> -> 'a</code></pre>
<pre><span id="VALiter"><span class="keyword">val</span> iter</span> : <code class="type">(char -> unit) -> <a href="CCBigstring.html#TYPEt">t</a> -> unit</code></pre>
<pre><span id="VALequal"><span class="keyword">val</span> equal</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> <a href="CCBigstring.html#TYPEt">t</a> -> bool</code></pre>
<pre><span id="VALcompare"><span class="keyword">val</span> compare</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> <a href="CCBigstring.html#TYPEt">t</a> -> int</code></pre><div class="info ">
Lexicographic order<br>
</div>
<br>
<h2 id="2_Conversions">Conversions</h2><br>
<pre><span id="VALto_bytes"><span class="keyword">val</span> to_bytes</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> Bytes.t</code></pre>
<pre><span id="VALof_bytes"><span class="keyword">val</span> of_bytes</span> : <code class="type">Bytes.t -> <a href="CCBigstring.html#TYPEt">t</a></code></pre>
<pre><span id="VALof_bytes_slice"><span class="keyword">val</span> of_bytes_slice</span> : <code class="type">Bytes.t -> int -> int -> <a href="CCBigstring.html#TYPEt">t</a></code></pre>
<pre><span id="VALsub_bytes"><span class="keyword">val</span> sub_bytes</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> int -> int -> Bytes.t</code></pre>
<pre><span id="VALblit_to_bytes"><span class="keyword">val</span> blit_to_bytes</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> int -> Bytes.t -> int -> int -> unit</code></pre>
<pre><span id="VALblit_of_bytes"><span class="keyword">val</span> blit_of_bytes</span> : <code class="type">Bytes.t -> int -> <a href="CCBigstring.html#TYPEt">t</a> -> int -> int -> unit</code></pre>
<pre><span id="VALto_string"><span class="keyword">val</span> to_string</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> string</code></pre>
<pre><span id="VALof_string"><span class="keyword">val</span> of_string</span> : <code class="type">string -> <a href="CCBigstring.html#TYPEt">t</a></code></pre>
<pre><span id="VALof_string_slice"><span class="keyword">val</span> of_string_slice</span> : <code class="type">string -> int -> int -> <a href="CCBigstring.html#TYPEt">t</a></code></pre>
<pre><span id="VALsub_string"><span class="keyword">val</span> sub_string</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> int -> int -> string</code></pre>
<pre><span id="VALblit_of_string"><span class="keyword">val</span> blit_of_string</span> : <code class="type">string -> int -> <a href="CCBigstring.html#TYPEt">t</a> -> int -> int -> unit</code></pre>
<pre><span id="TYPEgen"><span class="keyword">type</span> <code class="type">'a</code> gen</span> = <code class="type">unit -> 'a option</code> </pre>
<pre><span id="TYPEsequence"><span class="keyword">type</span> <code class="type">'a</code> sequence</span> = <code class="type">('a -> unit) -> unit</code> </pre>
<pre><span id="TYPEprinter"><span class="keyword">type</span> <code class="type">'a</code> printer</span> = <code class="type">Format.formatter -> 'a -> unit</code> </pre>
<pre><span id="VALto_seq"><span class="keyword">val</span> to_seq</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> char <a href="CCBigstring.html#TYPEsequence">sequence</a></code></pre>
<pre><span id="VALto_gen"><span class="keyword">val</span> to_gen</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> char <a href="CCBigstring.html#TYPEgen">gen</a></code></pre>
<pre><span id="VALto_seq_slice"><span class="keyword">val</span> to_seq_slice</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> int -> int -> char <a href="CCBigstring.html#TYPEsequence">sequence</a></code></pre>
<pre><span id="VALto_gen_slice"><span class="keyword">val</span> to_gen_slice</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> -> int -> int -> char <a href="CCBigstring.html#TYPEgen">gen</a></code></pre>
<pre><span id="VALprint"><span class="keyword">val</span> print</span> : <code class="type"><a href="CCBigstring.html#TYPEt">t</a> <a href="CCBigstring.html#TYPEprinter">printer</a></code></pre><div class="info ">
<b>Since</b> 0.13<br>
</div>
<br>
<h2 id="2_Memorymap">Memory-map</h2><br>
<pre><span id="VALwith_map_file"><span class="keyword">val</span> with_map_file</span> : <code class="type">?pos:int64 -><br> ?len:int -><br> ?mode:int -><br> ?flags:Pervasives.open_flag list -><br> ?shared:bool -> string -> (<a href="CCBigstring.html#TYPEt">t</a> -> 'a) -> 'a</code></pre><div class="info ">
<code class="code">with_map_file name f</code> maps the file into memory, opening it, and
call <code class="code">f</code> with a slice <code class="code">pos.... pos+len</code> of the bytes of the file
where <code class="code">len</code> is the length of the file if not provided.
When <code class="code">f</code> returns, the file is closed.<br>
</div>
<div class="param_info"><code class="code">pos</code> : offset in the file (default 0)</div>
<div class="param_info"><code class="code">mode</code> : the mode for the file, if it's created</div>
<div class="param_info"><code class="code">flags</code> : opening flags (default rdonly)
see <code class="code"><span class="constructor">Bigarray</span>.<span class="constructor">Array1</span>.map_file</code> for more details</div>
<div class="param_info"><code class="code">shared</code> : if true, modifications are shared between processes that
have mapped this file (requires the filedescr to be open in write mode).</div>
<pre><span id="VALmap_file_descr"><span class="keyword">val</span> map_file_descr</span> : <code class="type">?pos:int64 -> ?shared:bool -> Unix.file_descr -> int -> <a href="CCBigstring.html#TYPEt">t</a></code></pre><div class="info ">
<code class="code">map_file_descr descr len</code> is a lower-level access to an underlying file descriptor.<br>
</div>
<div class="param_info"><code class="code">shared</code> : if true, modifications are shared between processes that
have mapped this file (requires the filedescr to be open in write mode).
see <code class="code"><span class="constructor">Bigarray</span>.<span class="constructor">Array1</span>.map_file</code> for more details</div>
</body></html>