URL

Represents a URL decomposed into its components.

struct URL {}

Constructors

this
this(string schema, string host, ushort port, InetPath path)
this(string schema, InetPath path)
this(string schema, string host, ushort port, PosixPath path)
this(string schema, PosixPath path)
this(string schema, string host, ushort port, WindowsPath path)
this(string schema, WindowsPath path)

Constructs a new URL object from its components.

this
this(WindowsPath path)
this(PosixPath path)

Constructs a "file:" URL from a native file system path.

this
this(string url_string)

Constructs a URL from its string representation.

Members

Functions

defaultPort
ushort defaultPort()

Get the default port for the given schema or 0

opBinary
URL opBinary(Path rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
URL opBinary(Path.Segment rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
URL opBinary(Path.Segment2 rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opCmp
int opCmp(URL rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(URL rhs)
bool opEquals(URL other)

Tests two URLs for equality using '=='.

opOpAssign
void opOpAssign(Path rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
void opOpAssign(Path.Segment rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
void opOpAssign(Path.Segment2 rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
startsWith
bool startsWith(URL rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
toNativePath
NativePath toNativePath()

Converts a "file" URL back to a native file system path.

toString
string toString()

Converts this URL object to its string representation.

Properties

anchor
string anchor [@property getter]

The anchor part of the URL (optional)

host
string host [@property getter]
string host [@property setter]

The host part of the URL (depends on the schema)

localURI
string localURI [@property getter]
string localURI [@property setter]

The path part plus query string and anchor

parentURL
URL parentURL [@property getter]

The URL to the parent path with query string and anchor stripped.

password
string password [@property getter]
string password [@property setter]

The password part of the URL (optional)

path
InetPath path [@property getter]
InetPath path [@property setter]
Path path [@property setter]

The path part of the URL

pathString
string pathString [@property getter]

The url encoded path part of the URL

pathString
string pathString [@property setter]

Set the path part of the URL. It should be properly encoded.

port
ushort port [@property getter]
ushort port [@property setter]

The port part of the URL (optional)

queryString
string queryString [@property getter]
string queryString [@property setter]

The query string part of the URL (optional)

schema
string schema [@property getter]
string schema [@property setter]

The schema/protocol part of the URL

username
string username [@property getter]
string username [@property setter]

The user name part of the URL (optional)

Static functions

defaultPort
ushort defaultPort(string schema)

Get the default port for the given schema or 0

fromString
URL fromString(string url_string)
parse
URL parse(string url_string)

Constructs a URL from its string representation.

Meta