Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > b4603fcd3afb71dfbec25f4867b993f4 > files > 312

js_of_ocaml-doc-2.4.1-2.mga5.noarch.rpm

<!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=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="previous" href="Typed_array.html">
<link rel="next" href="WebGL.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="CSS" rel="Chapter" href="CSS.html">
<link title="Dom" rel="Chapter" href="Dom.html">
<link title="Dom_events" rel="Chapter" href="Dom_events.html">
<link title="Dom_html" rel="Chapter" href="Dom_html.html">
<link title="Dom_svg" rel="Chapter" href="Dom_svg.html">
<link title="EventSource" rel="Chapter" href="EventSource.html">
<link title="File" rel="Chapter" href="File.html">
<link title="Firebug" rel="Chapter" href="Firebug.html">
<link title="Form" rel="Chapter" href="Form.html">
<link title="Js" rel="Chapter" href="Js.html">
<link title="Json" rel="Chapter" href="Json.html">
<link title="Jsonp" rel="Chapter" href="Jsonp.html">
<link title="Keycode" rel="Chapter" href="Keycode.html">
<link title="Lwt_js" rel="Chapter" href="Lwt_js.html">
<link title="Lwt_js_events" rel="Chapter" href="Lwt_js_events.html">
<link title="Regexp" rel="Chapter" href="Regexp.html">
<link title="Sys_js" rel="Chapter" href="Sys_js.html">
<link title="Typed_array" rel="Chapter" href="Typed_array.html">
<link title="Url" rel="Chapter" href="Url.html">
<link title="WebGL" rel="Chapter" href="WebGL.html">
<link title="WebSockets" rel="Chapter" href="WebSockets.html">
<link title="XmlHttpRequest" rel="Chapter" href="XmlHttpRequest.html">
<link title="Lwt_log_js" rel="Chapter" href="Lwt_log_js.html">
<link title="JsooTop" rel="Chapter" href="JsooTop.html">
<link title="Ocamlbuild_js_of_ocaml" rel="Chapter" href="Ocamlbuild_js_of_ocaml.html">
<link title="Deriving_Json" rel="Chapter" href="Deriving_Json.html">
<link title="Deriving_Json_lexer" rel="Chapter" href="Deriving_Json_lexer.html">
<link title="Pa_deriving_Json" rel="Chapter" href="Pa_deriving_Json.html"><title>Url</title>
</head>
<body>
<div class="navbar"><a class="pre" href="Typed_array.html" title="Typed_array">Previous</a>
&nbsp;<a class="up" href="index.html" title="Index">Up</a>
&nbsp;<a class="post" href="WebGL.html" title="WebGL">Next</a>
</div>
<h1>Module <a href="type_Url.html">Url</a></h1>

<pre><span class="keyword">module</span> Url: <code class="code">sig</code> <a href="Url.html">..</a> <code class="code">end</code></pre><div class="info module top">
This module provides functions for tampering with Url. It's main goal is to
    allow one to stay in the Ocaml realm without wandering into the
    <a href="Dom_html.html#VALwindow"><code class="code">Dom_html.window</code></a>##location object.<br>
</div>
<hr width="100%">
<br>
The first functions are mainly from and to string conversion functions for
     the different parts of a url.<br>

<pre><span id="VALurldecode"><span class="keyword">val</span> urldecode</span> : <code class="type">string -> string</code></pre><div class="info ">
<code class="code">urldecode s</code> swaps percent encoding characters for their usual
    representation.<br>
</div>

<pre><span id="VALurlencode"><span class="keyword">val</span> urlencode</span> : <code class="type">?with_plus:bool -> string -> string</code></pre><div class="info ">
<code class="code">urlencode ?with_plus s</code> replace characters for their percent encoding
    representation. Note that the '/' (slash) character is escaped as well. If
    <code class="code">with_plus</code> is <code class="code">true</code> (default) then <code class="code">'+'</code>'s are escaped as <code class="code">"%2B"</code>. If not,
    <code class="code">'+'</code>'s are left as is.<br>
</div>

<pre><code><span id="TYPEhttp_url"><span class="keyword">type</span> <code class="type"></code>http_url</span> = {</code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELThttp_url.hu_host">hu_host</span>&nbsp;: <code class="type">string</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The host part of the url.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELThttp_url.hu_port">hu_port</span>&nbsp;: <code class="type">int</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The port for the connection if any.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELThttp_url.hu_path">hu_path</span>&nbsp;: <code class="type">string list</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The path splitted on <code class="code">'/'</code> characters.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELThttp_url.hu_path_string">hu_path_string</span>&nbsp;: <code class="type">string</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The original entire path.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELThttp_url.hu_arguments">hu_arguments</span>&nbsp;: <code class="type">(string * string) list</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Arguments as a field-value
                                             association list.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELThttp_url.hu_fragment">hu_fragment</span>&nbsp;: <code class="type">string</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The fragment part (after the <code class="code">'#'</code> character).</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr></table>
}

<div class="info ">
The type for HTTP(s) url.<br>
</div>


<pre><code><span id="TYPEfile_url"><span class="keyword">type</span> <code class="type"></code>file_url</span> = {</code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTfile_url.fu_path">fu_path</span>&nbsp;: <code class="type">string list</code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTfile_url.fu_path_string">fu_path_string</span>&nbsp;: <code class="type">string</code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTfile_url.fu_arguments">fu_arguments</span>&nbsp;: <code class="type">(string * string) list</code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTfile_url.fu_fragment">fu_fragment</span>&nbsp;: <code class="type">string</code>;</code></td>

</tr></table>
}

<div class="info ">
The type for local file urls.<br>
</div>


<pre><code><span id="TYPEurl"><span class="keyword">type</span> <code class="type"></code>url</span> = </code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTurl.Http"><span class="constructor">Http</span></span> <span class="keyword">of</span> <code class="type"><a href="Url.html#TYPEhttp_url">http_url</a></code></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Non secure HTTP urls</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTurl.Https"><span class="constructor">Https</span></span> <span class="keyword">of</span> <code class="type"><a href="Url.html#TYPEhttp_url">http_url</a></code></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Secure HTTPS urls</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTurl.File"><span class="constructor">File</span></span> <span class="keyword">of</span> <code class="type"><a href="Url.html#TYPEfile_url">file_url</a></code></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Local files</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr></table>

<div class="info ">
The type for urls.<br>
</div>


<pre><span id="VALdefault_http_port"><span class="keyword">val</span> default_http_port</span> : <code class="type">int</code></pre><div class="info ">
The default port for <code class="code">Http</code> communications (80).<br>
</div>

<pre><span id="VALdefault_https_port"><span class="keyword">val</span> default_https_port</span> : <code class="type">int</code></pre><div class="info ">
The default port for <code class="code">Https</code> communications (443).<br>
</div>

<pre><span id="VALpath_of_path_string"><span class="keyword">val</span> path_of_path_string</span> : <code class="type">string -> string list</code></pre><div class="info ">
<code class="code">path_of_path_string s</code> splits <code class="code">s</code> on each <code class="code">"/"</code> character.<br>
</div>

<pre><span id="VALencode_arguments"><span class="keyword">val</span> encode_arguments</span> : <code class="type">(string * string) list -> string</code></pre><div class="info ">
<code class="code">encode_arguments a</code> expects a list of pair of values of the form
    <code class="code">(name,value)</code> were <code class="code">name</code> is the name of an argument and <code class="code">value</code> it's
    associated value.<br>
</div>

<pre><span id="VALdecode_arguments"><span class="keyword">val</span> decode_arguments</span> : <code class="type">string -> (string * string) list</code></pre><div class="info ">
<code class="code">decode_arguments s</code> parses <code class="code">s</code> returning the sliced-diced
    association list.<br>
</div>
<br>
The following part allow one to handle Url object in a much higher level
    than what a string provides.<br>

<pre><span id="VALurl_of_string"><span class="keyword">val</span> url_of_string</span> : <code class="type">string -> <a href="Url.html#TYPEurl">url</a> option</code></pre><div class="info ">
<code class="code">url_of_string s</code> parses <code class="code">s</code> and builds a value of type <code class="code">url</code> if <code class="code">s</code> is not
    a valid url string, it returns <code class="code">None</code>.<br>
</div>

<pre><span id="VALstring_of_url"><span class="keyword">val</span> string_of_url</span> : <code class="type"><a href="Url.html#TYPEurl">url</a> -> string</code></pre><div class="info ">
<code class="code">string_of_url u</code> returns a valid string representation of <code class="code">u</code>. Note that
  * <code class="code">string_of_url ((fun Some u -&gt; u) (url_of_string s))</code> is NOT necessarily
  * equal to <code class="code">s</code>. However <code class="code">url_of_string (string_of_url u) = u</code>.<br>
</div>

<pre><span class="keyword">module</span> <a href="Url.Current.html">Current</a>: <code class="code">sig</code> <a href="Url.Current.html">..</a> <code class="code">end</code></pre><div class="info">
This module can be used to handle the Url associated to the current
    document.
</div>
</body></html>