The OpenD Programming Language

Uri

Represents a URI. It offers named access to the components and relative uri resolution, though as a user of the library, you'd mostly just construct it like Uri("http://example.com/index.html").

Constructors

this
this(string uri)

Breaks down a uri string to its components

Alias This

toString

Members

Functions

basedOn
Uri basedOn(Uri baseUrl)

Returns a new absolute Uri given a base. It treats this one as relative where possible, but absolute if not. (If protocol, domain, or other info is not set, the new one inherits it from the base.)

effectivePort
int effectivePort()

Returns port if set, otherwise if scheme is https 443, otherwise always 80

removeDots
void removeDots()

Resolves ../ and ./ parts of the path. Used in the implementation of basedOn and you could also use it to normalize things.

toString
string toString()

Converts the broken down parts back into a complete string

viaAbstractSocket
Uri viaAbstractSocket(string path)

Goes through a unix socket in the abstract namespace (linux only). Returns new version without modifying this object.

viaUnixSocket
Uri viaUnixSocket(string path)

Indicates it should be accessed through a unix socket instead of regular tcp. Returns new version without modifying this object.

Variables

fragment
string fragment;

the stuff after the # in a uri.

host
string host;

the domain name

path
string path;

e.g. "/folder/file.html" in "http://example.com/folder/file.html"

port
int port;

port number, if given. Will be zero if a port was not explicitly given

query
string query;

the stuff after the ? in a uri

scheme
string scheme;

e.g. "http" in "http://example.com/"

userinfo
string userinfo;

the username (and possibly a password) in the uri

Meta