Changeset 13000 in project


Ignore:
Timestamp:
01/12/09 21:18:29 (12 years ago)
Author:
sjamaan
Message:

Update uri-common docs. Do not refer to uri-generic docs but copy the text from those docs, making uri-common readable as a stand-alone document

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/uri-common

    r12993 r13000  
    1919=== Library Procedures
    2020
     21This library replaces most of the procedures in [[uri-generic]]. If
     22you need to work with URIs on the uri-generic level or need to work
     23with both uri-generic and uri-common URI objects, you will have to
     24import and prefix or rename procedures.
     25
    2126==== Constructors
    2227
    23 <procedure>(uri-common-reference string) => uri-common</procedure>
    24 <procedure>(absolute-uri-common string) => uri-common</procedure>
     28These constructors fully decode their arguments, so afterwards it is
     29impossible to distinguish between encoded delimiters and unencoded
     30delimiters.  This makes uri-common objects decoding endpoints; no
     31further decoding on the URI level is possible (of course, applications
     32are free to decode further information inside the URI).  If for some
     33reason, the original URI is still needed, it can be converted to a
     34uri-generic.  However, updating a URI component causes this
     35component's original encoding to be lost, so be careful!
    2536
    26 Construct a new uri-common object, analogous to uri-reference and
    27 absolute-uri from [[uri-generic]].
     37<procedure>(uri-reference string) => uri-common</procedure>
     38
     39A URI reference is either a URI or a relative reference (RFC 3986,
     40Section 4.1).  If the given string's prefix does not match the syntax
     41of a scheme followed by a colon separator, then the given string is
     42parsed as a relative reference.
     43
     44<procedure>(absolute-uri string) => uri-common</procedure>
     45
     46Parses the given string as an absolute URI, in which no fragments are
     47allowed (RFC 3986, Section 4.2)
    2848
    2949==== uri-generic and string representation
    3050
    31 <procedure>(uri-common->uri-generic uri-common) => uri-generic</procedure>
    32 <procedure>(uri-generic->uri-common uri-common) => uri-common</procedure>
     51<procedure>(uri->uri-generic uri-common) => uri-generic</procedure>
     52<procedure>(uri-generic->uri uri-common) => uri-common</procedure>
    3353
    3454To convert between uri-generic and uri-common objects, use these
    35 procedures.
     55procedures.  As stated above, this will allow you to retrieve the
     56original encoding of the URI components, but once you update a
     57component from the uri-common side, the original encoding is no longer
     58available (the updated value replaces the original value).
    3659
    37 <procedure>(uri-common->string uri-common userinfo) => string</procedure>
     60<procedure>(uri->string uri-common userinfo) => string</procedure>
    3861
    3962Reconstructs the given URI into a string; uses a supplied function
    4063{{LAMBDA USERNAME PASSWORD -> STRING}} to map the userinfo part of the
    41 URI
     64URI.
    4265
    4366
    4467==== Predicates and Accessors
    4568
    46 * <procedure>(uri-common? uri-common) => bool</procedure>
    47 * <procedure>(uri-common-scheme uri-common) => symbol</procedure>
    48 * <procedure>(uri-common-path uri-common) => list</procedure>
    49 * <procedure>(uri-common-query uri-common) => alist</procedure>
    50 * <procedure>(uri-common-fragment uri-common) => string</procedure>
    51 * <procedure>(uri-common-host uri-common) => string</procedure>
    52 * <procedure>(uri-common-port uri-common) => integer</procedure>
    53 * <procedure>(uri-common-username uri-common) => string</procedure>
    54 * <procedure>(uri-common-password uri-common) => string</procedure>
     69* <procedure>(uri? uri-common) => bool</procedure>
     70* <procedure>(uri-scheme uri-common) => symbol</procedure>
     71* <procedure>(uri-path uri-common) => list</procedure>
     72* <procedure>(uri-query uri-common) => alist</procedure>
     73* <procedure>(uri-fragment uri-common) => string</procedure>
     74* <procedure>(uri-host uri-common) => string</procedure>
     75* <procedure>(uri-port uri-common) => integer</procedure>
     76* <procedure>(uri-username uri-common) => string</procedure>
     77* <procedure>(uri-password uri-common) => string</procedure>
    5578
    5679If a component is not defined in the given URI-common, then the
    5780corresponding accessor returns {{#f}}.
    5881
    59 * <procedure>(update-uri-common URI-common #!key scheme path query fragment host port username password) => URI-common</procedure>
     82* <procedure>(update-uri URI-common #!key scheme path query fragment host port username password) => URI-common</procedure>
    6083
    6184Update the specified keys in the URI-common object in a functional way
     
    6487==== Reference Resolution
    6588
    66 <procedure>(uri-common-relative-to URI URI) => URI</procedure>
     89<procedure>(uri-relative-to URI URI) => URI</procedure>
    6790
    6891Constructs an absolute URI given a relative URI and a base URI (RFC 3986, Section 5.2.2)
    6992
    70 <procedure>(uri-common-relative-from URI URI) => URI</procedure>
     93<procedure>(uri-relative-from URI URI) => URI</procedure>
    7194
    7295Constructs a new, possibly relative, URI which represents the location
     
    102125==== Normalization 
    103126
    104 <procedure>(uri-common-normalize-case URI) => URI</procedure>
     127<procedure>(uri-normalize-case URI) => URI</procedure>
    105128
    106129URI case normalization (RFC 3986 section 6.2.2.1)
    107130
    108 <procedure>(uri-common-normalize-path-segments URI) => URI</procedure>
     131<procedure>(uri-normalize-path-segments URI) => URI</procedure>
    109132
    110133URI path segment normalization (RFC 3986 section 6.2.2.3)
Note: See TracChangeset for help on using the changeset viewer.