Changeset 13231 in project


Ignore:
Timestamp:
02/09/09 23:54:41 (11 years ago)
Author:
sjamaan
Message:

Document latest changes, move documentation around a bit so it's clearer (IMHO)

File:
1 edited

Legend:

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

    r13215 r13231  
    1414This library should be considered to be a ''basis'' for creating
    1515scheme-specific URI parser libraries. This library only parses
    16 the generic components from an URI.  Any specific library can
     16the generic components from a URI.  Any specific library can
    1717further parse subcomponents. For this reason, encoding and decoding
    1818of percent-encoded characters is not done automatically.
     
    2121=== Library Procedures
    2222
    23 ==== Constructors
     23==== Constructors and predicates
    2424
    2525As specified in section 2.3 of RFC 3986, URI constructors
     
    3737parsed as a relative reference.
    3838
     39<procedure>(uri-reference? URI) => BOOL</procedure>
     40
     41Is the given object a URI reference?  '''All objects created by
     42URI-generic constructors are URI references'''; they are either URIs
     43or relative references.  The constructors below are just more strict
     44checking versions of {{uri-reference}}.  They all create
     45URI references.
     46
    3947<procedure>(absolute-uri STRING) => URI</procedure>
    4048
    4149Parses the given string as an absolute URI, in which no fragments are
    42 allowed (RFC 3986, Section 4.2)
    43 
    44 
    45 ==== Predicates and Accessors
     50allowed.  If no URI scheme is found, or a fragment is detected, this
     51raises an error.
     52
     53Absolute URIs are defined by RFC 3986 as non-relative URI references
     54without a fragment (RFC 3986, Section 4.2).  Absolute URIs can be used
     55as a base URI to resolve a relative-ref against, using
     56{{uri-relative-to}} (see below).
     57
     58<procedure>(absolute-uri? URI) => BOOL</procedure>
     59
     60Is the given object an absolute URI?
     61
     62<procedure>(uri? URI) => BOOL</procedure>
     63
     64Is the given object a URI?  URIs are all URI references that include
     65a scheme part.  The other type of URI references are relative
     66references.
     67
     68<procedure>(relative-ref? URI) => BOOL</procedure>
     69
     70Is the given object a relative reference?  Relative references are
     71defined by RFC 3986 as URI references which are not URIs; they contain
     72no URI scheme and can be resolved against an absolute URI to obtain
     73a complete URI using {{uri-relative-to}}.
     74
     75==== Attribute accessors
    4676
    4777* <procedure>(uri-authority URI) => URI-AUTH</procedure>
     
    6999functional way (ie, it creates a new copy with the modifications).
    70100
    71 * <procedure>(uri? URI) => BOOL</procedure>
    72 
    73 Is the given object an URI-generic object?
    74 
    75 * <procedure>(relative-ref? URI) => BOOL</procedure>
    76 
    77 Is the given object a relative reference?  Relative references are
    78 defined by RFC 3986 as URI references which are not URIs; they contain
    79 no URI scheme and can be resolved against an absolute URI to obtain
    80 a complete URI using {{uri-relative-to}}.
    81 
    82 * <procedure>(absolute-uri? URI) => BOOL</procedure>
    83 
    84 Is the given object an absolute URI?  Absolute URI is defined by
    85 RFC 3986 as a non-relative URI reference without a fragment.  Absolute
    86 URIs can be used as a base URI to resolve a relative-ref against, using
    87 {{uri-relative-to}}.
    88 
    89101==== String and List Representations
    90102
     
    175187<constant>char-set:uri-unreserved</constant>
    176188
    177 All unreserved characters that are allowed in an URI.
     189All unreserved characters that are allowed in a URI.
    178190  unreserved  =  ALPHA / DIGIT / "-" / "." / "_" / "~"
    179191
    180192Note that this is _not_ the complement of {{char-set:uri-reserved}}!
    181193There are several characters (even printable, noncontrol characters)
    182 which are not allowed at all in an URI.
     194which are not allowed at all in a URI.
    183195
    184196
     
    190202=== Version History
    191203
    192 * trunk Add new predicates for absoluteness/relativeness. Fix absolute-uri so it raises a condition when passing in a non-absolute uri string, instead of returning a string with the error.
     204* trunk Add new predicates for URIs, absolute URIs and relative references. Fix absolute-uri so it raises a condition when passing in a non-absolute uri string, instead of returning a string with the error. Also throw an error if a fragment is detected in the string.
    193205* 2.0 Export char-sets, add char-set arg to uri-encode/uri-decode,
    194206       do not decode query args as x-www-form-urlencoded, change path
Note: See TracChangeset for help on using the changeset viewer.