source: project/wiki/uri-generic @ 11564

Last change on this file since 11564 was 11564, checked in by Ivan Raikov, 12 years ago

Fixed the license text.

File size: 3.7 KB
Line 
1[[tags: eggs]]
2[[toc:]]
3
4== uri-generic
5
6=== Description
7
8The {{uri-generic}} library contains procedures for parsing and
9manipulation of Uniform Resource Identifiers
10([[http://tools.ietf.org/html/rfc3986|RFC 3986]]). It is intended to
11conform more closely to the RFC, and uses combinator parsing and
12character classes rather than regular expressions.
13
14=== Library Procedures
15
16==== Constructors
17
18; {{uri-reference:: STRING -> URI}}
19A URI reference is either a URI or a relative reference (RFC 3986,
20Section 4.1).  If the given string's prefix does not match the syntax
21of a scheme followed by a colon separator, then the given string is
22parsed as a relative reference.
23
24==== Predicates and Accessors
25
26; {{uri?:: URI -> BOOL}}
27; {{uri-authority:: URI -> URI-AUTH}}
28; {{uri-scheme:: URI -> SYMBOL}}
29; {{uri-path:: URI -> LIST}}
30; {{uri-query:: URI -> LIST}}
31; {{uri-fragment:: URI -> STRING}}
32; {{uri-host:: URI -> STRING}}
33; {{uri-port:: URI -> INTEGER}}
34; {{uri-username:: URI -> STRING}}
35; {{uri-password:: URI -> STRING}}
36
37If a component is not defined in the given URI, then the corresponding
38accessor return {{#F}}.
39
40==== String and List Representations
41
42; {{uri->string:: URI * USERINFO -> STRING}}: reconstructs the give URI into a string; uses a supplied function {{LAMBDA USERNAME PASSWORD -> STRING}} to map the userinfo part of the URI
43; {{uri->list:: URI * USERINFO -> LIST}}: returns a list of the form {{(SCHEME SPECIFIC FRAGMENT)}}; {{SPECIFIC}} is of the form {{(AUTHORITY PATH QUERY)}}
44
45==== Reference Resolution
46
47; {{absolute-uri:: URI -> URI}}: converts the given URI to absolute URI, in which no fragments are allowed (RFC 3986, Section 4.2)
48; {{uri-relative-to:: URI * URI -> URI}}: constructs an absolute URI given a relative URI and a base URI (RFC 3986, Section 5.2.2)
49; {{uri-relative-from:: URI * URI -> URI}}: constructs a new, possibly relative, URI which represents the location of the first URI with respect to the second URI
50
51==== Normalization 
52
53; {{uri-normalize-case}}: URI case normalization (RFC 3986 section 6.2.2.1)
54; {{uri-normalize-path-segments}}: URI path segment normalization (RFC 3986 section 6.2.2.4)
55
56=== Requires
57
58; [[syntax-case]]
59; [[matchable]]
60
61=== Version History
62
63* 1.0 Initial Release
64
65=== License
66
67Based on the Haskell URI library by  Graham Klyne <gk@ninebynine.org>.
68
69Copyright 2008 Ivan Raikov.
70
71Redistribution and use in source and binary forms, with or without
72modification, are permitted provided that the following conditions are
73met:
74
75- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
76
77- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
78
79- Neither name of the copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
80
81THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
82
Note: See TracBrowser for help on using the repository browser.