Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
InetHTTPURLs


NAME

InetHTTPURLs - implementation of HTTP URLs

SYNOPSIS

TYPE URL = POINTER TO URLRec;
TYPE URLRec =
   RECORD
      (InetURLs.URLRec)
      host: Streams.Stream;
      port: Streams.Stream;
      path: Streams.Stream;
      absolutePath: BOOLEAN;
      search: Streams.Stream;
      fragment: Streams.Stream;
   END;


CONST illegalScheme = 0; CONST expectingSlash = 1; CONST illegalName = 2; CONST illegalPort = 3; CONST illegalPath = 4; CONST illegalSearch = 5; CONST illegalFragment = 6; CONST errorcodes = 7; TYPE ErrorCode = SHORTINT; TYPE ErrorEvent = POINTER TO ErrorEventRec; TYPE ErrorEventRec = RECORD (Events.EventRec) errorcode: ErrorCode; END; VAR errorMessages: ARRAY errorcodes OF Events.Message; VAR error: Events.EventType;

PROCEDURE Create(VAR url: InetURLs.URL);

DESCRIPTION

The module InetHTTPURLs implements the procedures for processing a HTTP URL. It first expands the URL-object to the additional parts of a HTTP URL. host is the host name of the server or NIL if not supplied. port is the specified port of the URL or NIL if not supplied. path contains the path of the URL or NIL if not supplied. If the path is absolute (leading slash `/') absolutePath is TRUE. If the URL contains a parameter (split by a question mark `?' from the prefix of the URL) it will be stored in search otherwise search will be NIL. fragment contains a fragment part of the URL (split by a number sign `#' from the prefix of the URL) or NIL if not supplied. InetHTTPURLs supports relative and absolute URLs. All parts are substreams of the assigned stream.

Create creates a new HTTP URL. The components remain NIL until a stream is assigned by InetURLs.Assign.

InetURLs implements the procedures InetURLs.Assign and InetURLs.ToString.

DIAGNOSTICS

The following error events may be generated assigning a stream to an URL
illegalScheme
Illegal Character in scheme of URL - Syntax error
expectingSlash
Expecting '/' after scheme in URL - Syntax error
illegalName
Illegal Character in domain name of URL - Syntax error
illegalPort
Illegal Character in port number of URL - Syntax error
illegalPath
Illegal Character in path of URL - Syntax error
illegalSearch
Illegal Character in parameter part of URL - Syntax error
illegalFragment
Illegal Character in fragment-part of URL - Syntax error

SEE ALSO

InetURLs
addresses for web pages
Streams
stream operations

AUTHOR

Manfred Rueß, University of Ulm
Edited by: borchert, last change: 1998/04/24, revision: 1.1, converted to HTML: 1998/04/24

Oberon || Library || Module Index || Search Engine || Definition || Module