Class ImapUrl.

Inherits Garbage

A parser for the IMAP URL scheme described in RFC 2192.

This class provides access to the components of an IMAP URL. It is meant for use by URLAUTH and CATENATE. Since those august extensions only permit URLs that refer to a message or part therein, this code does not recognise any of the less-specific forms at present. Both absolute and relative URLs are supported.

ImapUrl::ImapUrl( const EString & s )

Creates a new ImapUrl object to represent the IMAP URL s. The URL must be absolute (i.e., begin with "imap://").

ImapUrl::ImapUrl( const IMAP * imap, const EString & s )

Creates a new ImapUrl object to represent the IMAP URL s. The URL must be relative, and is interpreted in the context of the specified imap object. If a session has not been established, the URL must specify a mailbox; but otherwise, the currently-selected mailbox is used as a part of the base.

This behaviour is intended to serve the needs of CATENATE.

EString ImapUrl::access() const

Returns the "access" part of the URLAUTH specified for this URL, or an empty string if none was specified.

EString ImapUrl::auth() const

Returns the "AUTH" specification from this URL, or an empty string if none was specified.

Date * ImapUrl::expires() const

Returns a pointer to a Date representing the specified expiry date for this URL, or 0 if no EXPIRE=date-time was specified.

EString ImapUrl::host() const

Returns the hostname from this URL. (This function makes no allowance for relative URLs, because it's not needed yet.)

bool ImapUrl::isRump() const

Returns true if this URL is an "authimapurlrump", i.e. it specifies ";URLAUTH=access", but does not include a mechanism name or URLAUTH token. Returns false otherwise, including for URLs that are invalid.

UString ImapUrl::mailboxName() const

Returns the name of the mailbox from this URL. The mailbox is either specified explicitly in the URL, or, if an IMAP session exists, and no mailbox has been specified, from the currently selected mailbox.

EString ImapUrl::mechanism() const

Returns the name of the authorization mechanism specified for this URL, or an empty string if no URLAUTH was specified.

EString ImapUrl::orig() const

Returns the unmodified original input passed to the ImapUrl constructor, without regard to whether the URL is valid() or not.

void ImapUrl::parse( const EString & s )

Parses the string s as an IMAP URL, to extract its components and determine its validity. If it fails for any reason, valid() will be false afterwards. Called by the constructor.

uint ImapUrl::port() const

Returns the port number specified in this URL.

EString ImapUrl::rump() const

Returns only the rump of this URL (see RFC 4467), or an empty string if the rump is not meaningfully defined.

EString ImapUrl::section() const

Returns the message section part specified in this URL, or an empty string if no section was specified (in which case the URL refers to an entire message).

void ImapUrl::setText( const EString & s )

This function, meant for use by the ImapUrlFetcher, sets the text() for this URL to s.

EString ImapUrl::text() const

Returns the text that this URL refers to, as retrieved and set by an ImapUrlFetcher, or an empty string if setText() has not been called.

uint ImapUrl::uid() const

Returns the message UID specified in this URL.

uint ImapUrl::uidvalidity() const

Returns the mailbox UIDVALIDITY specified in this URL.

EString ImapUrl::urlauth() const

Returns the URLAUTH token specified for this URL, or an empty string if no URLAUTH was specified.

User * ImapUrl::user() const

Returns a pointer to the User object representing the user specified in the "iuserauth" portion of this URL, or 0 if none was specified. For relative URLs, which are interpreted with reference to a given IMAP object, this function returns the current IMAP user.

bool ImapUrl::valid() const

Returns true if the URL given to the constructor is syntactically valid, and false otherwise.

This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.