You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
10 KiB

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>InferBase__DB (InferBase.InferBase__DB)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><meta name="generator" content="doc-ock-html v1.0.0-1-g1fc9bf0"/></head><body><nav id="top"><a href="../index.html">Up</a> &mdash; <span class="package">package <a href="../index.html">InferBase</a></span></nav><header><h1><span class="keyword">Module</span> <span class="module-path">InferBase__DB</span></h1></header><p>Database of analysis results</p><h3>Filename</h3><div class="spec type" id="type-filename"><a href="#type-filename" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>filename</code><code></code><code></code></div><div class="doc"><p>generic file name</p></div></div><div class="spec include"><div class="doc"></div><details open="open"><summary><span class="def"><code><span class="keyword">include </span><span class="keyword">sig</span> ... <span class="keyword">end</span></code></span></summary><div class="spec val" id="val-compare_filename"><a href="#val-compare_filename" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>compare_filename : <a href="index.html#type-filename">filename</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-filename">filename</a> <span class="keyword">&#8209;&gt;</span> int</code></div><div class="doc"></div></div></details></div><div class="spec val" id="val-filename_from_string"><a href="#val-filename_from_string" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>filename_from_string : string <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-filename">filename</a></code></div><div class="doc"></div></div><div class="spec val" id="val-filename_to_string"><a href="#val-filename_to_string" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>filename_to_string : <a href="index.html#type-filename">filename</a> <span class="keyword">&#8209;&gt;</span> string</code></div><div class="doc"></div></div><div class="spec val" id="val-filename_add_suffix"><a href="#val-filename_add_suffix" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>filename_add_suffix : <a href="index.html#type-filename">filename</a> <span class="keyword">&#8209;&gt;</span> string <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-filename">filename</a></code></div><div class="doc"></div></div><div class="spec val" id="val-file_exists"><a href="#val-file_exists" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>file_exists : <a href="index.html#type-filename">filename</a> <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"></div></div><div class="spec val" id="val-file_modified_time"><a href="#val-file_modified_time" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>file_modified_time : ?&#8288;symlink:bool <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-filename">filename</a> <span class="keyword">&#8209;&gt;</span> float</code></div><div class="doc"><p>Return the time when a file was last modified. The file must exist.</p></div></div><h3>Results Directory</h3><div class="spec module" id="module-Results_dir"><a href="#module-Results_dir" class="anchor"></a><div class="def module"><code><span class="keyword">module </span><a href="Results_dir/index.html">Results_dir</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></div><div class="doc"></div></div><div class="spec val" id="val-append_crc_cutoff"><a href="#val-append_crc_cutoff" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>append_crc_cutoff : ?&#8288;key:string <span class="keyword">&#8209;&gt;</span> ?&#8288;crc_only:bool <span class="keyword">&#8209;&gt;</span> string <span class="keyword">&#8209;&gt;</span> string</code></div><div class="doc"><p>Append a crc to the string, using string_crc_hex32.
Cut the string if it exceeds the cutoff limit.
Use an optional key to compute the crc.
Return only the crc if <code class="code">crc_only</code> is true.</p></div></div><div class="spec val" id="val-strip_crc"><a href="#val-strip_crc" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>strip_crc : string <span class="keyword">&#8209;&gt;</span> string</code></div><div class="doc"><p>Strip any crc attached to any string generated by string_append_crc_cutoff</p></div></div><div class="spec val" id="val-source_file_encoding"><a href="#val-source_file_encoding" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>source_file_encoding : <a href="../InferBase/SourceFile/index.html#type-t">InferBase.SourceFile.t</a> <span class="keyword">&#8209;&gt;</span> string</code></div><div class="doc"><p>string encoding of a source file (including path) as a single filename</p></div></div><h3>Source Dirs</h3><div class="spec type" id="type-source_dir"><a href="#type-source_dir" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>source_dir</code><code></code><code></code></div><div class="doc"><p>source directory: the directory inside the results dir corresponding to a source file</p></div></div><div class="spec include"><div class="doc"></div><details open="open"><summary><span class="def"><code><span class="keyword">include </span><span class="keyword">sig</span> ... <span class="keyword">end</span></code></span></summary><div class="spec val" id="val-compare_source_dir"><a href="#val-compare_source_dir" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>compare_source_dir : <a href="index.html#type-source_dir">source_dir</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-source_dir">source_dir</a> <span class="keyword">&#8209;&gt;</span> int</code></div><div class="doc"></div></div></details></div><div class="spec val" id="val-source_dir_to_string"><a href="#val-source_dir_to_string" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>source_dir_to_string : <a href="index.html#type-source_dir">source_dir</a> <span class="keyword">&#8209;&gt;</span> string</code></div><div class="doc"><p>expose the source dir as a string</p></div></div><div class="spec val" id="val-source_dir_get_internal_file"><a href="#val-source_dir_get_internal_file" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>source_dir_get_internal_file : <a href="index.html#type-source_dir">source_dir</a> <span class="keyword">&#8209;&gt;</span> string <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-filename">filename</a></code></div><div class="doc"><p>get the path to an internal file with the given extention (.tenv, ...)</p></div></div><div class="spec val" id="val-source_dir_from_source_file"><a href="#val-source_dir_from_source_file" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>source_dir_from_source_file : <a href="../InferBase/SourceFile/index.html#type-t">InferBase.SourceFile.t</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-source_dir">source_dir</a></code></div><div class="doc"><p>get the source directory corresponding to a source file</p></div></div><div class="spec val" id="val-read_file_with_lock"><a href="#val-read_file_with_lock" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>read_file_with_lock : string <span class="keyword">&#8209;&gt;</span> string <span class="keyword">&#8209;&gt;</span> string option</code></div><div class="doc"><p>Read a file using a lock to allow write attempts in parallel.</p></div></div><div class="spec val" id="val-update_file_with_lock"><a href="#val-update_file_with_lock" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>update_file_with_lock : string <span class="keyword">&#8209;&gt;</span> string <span class="keyword">&#8209;&gt;</span> (string <span class="keyword">&#8209;&gt;</span> string) <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Update the file contents with the update function provided.
If the directory does not exist, it is created.
If the file does not exist, it is created, and update is given the empty string.
A lock is used to allow write attempts in parallel.</p></div></div><div class="spec val" id="val-is_source_file"><a href="#val-is_source_file" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_source_file : string <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"><p>Check if a path is a Java, C, C++ or Objectve C source file according to the file extention</p></div></div><div class="spec val" id="val-fold_paths_matching"><a href="#val-fold_paths_matching" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>fold_paths_matching : dir:<a href="index.html#type-filename">filename</a> <span class="keyword">&#8209;&gt;</span> p:(<a href="index.html#type-filename">filename</a> <span class="keyword">&#8209;&gt;</span> bool) <span class="keyword">&#8209;&gt;</span> init:<span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> f:(<a href="index.html#type-filename">filename</a> <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span>) <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span></code></div><div class="doc"><p>Fold over all file paths recursively under <code class="code">dir</code> which match <code class="code">p</code>.</p></div></div><div class="spec val" id="val-paths_matching"><a href="#val-paths_matching" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>paths_matching : string <span class="keyword">&#8209;&gt;</span> (string <span class="keyword">&#8209;&gt;</span> bool) <span class="keyword">&#8209;&gt;</span> string list</code></div><div class="doc"><p>Return all file paths recursively under the given directory which match the given predicate</p></div></div></body></html>