Main Page | Class Hierarchy | Class List | Class Members

ListResponse Class Reference

Inheritance diagram for ListResponse:

Response List of all members.

Detailed Description

ListResponse is a class that represents an IMAP4 LIST response.

An IMAP4 server sends zero or more LIST responses in response to a LIST command. Each LIST response provides information about a name that matches the pattern in the LIST command. Typically, a matched name is the name of a mailbox, and the LIST response provides basic information about that mailbox as a list of name attributes.

The ListResponse class has member functions that you may use to get the name, hierarchy delimiter, and attributes of the LIST response. The ListResponse class also provides convenience member functions that you may use to check for these common attributes: \Noinferiors, \Noselect, \Marked, and \Unmarked.

See also:
Imap4Client::List

LIST Response in the IMAP4 specification


Public Member Functions

 ListResponse ()
 Default constructor.
 ListResponse (const ListResponse &other)
 Copy constructor.
virtual ~ListResponse ()
 Destructor.
ListResponseoperator= (const ListResponse &other)
 Assignment operator.
bool Noinferiors () const
 Indicates if a \Noinferiors flag is present in the response.
bool Noselect () const
 Indicates if a \Noselect flag is present in the response.
bool Marked () const
 Indicates if a \Marked flag is present in the response.
bool Unmarked () const
 Indicates if an \Unmarked flag is present in the response.
bool Attribute (const char *flag) const
 Indicates if the specified flag is present in the response.
unsigned NumAttributes () const
 Gets the number of attributes.
const char * AttributeAt (unsigned index)
 Gets the attribute at the specified position.
char Delimiter () const
 Gets the delimiter character for the naming hierarchy.
const char * MailboxName () const
 Gets the mailbox name.
void ImportData (ListItem *root)
 Called by the parser to set the data for this object.


Constructor & Destructor Documentation

ListResponse  ) 
 

Default constructor.

ListResponse const ListResponse other  ) 
 

Copy constructor.

Parameters:
other other object to copy

~ListResponse  )  [virtual]
 

Destructor.


Member Function Documentation

bool Attribute const char *  flag  )  const
 

Indicates if the specified flag is present in the response.

Parameters:
flag the attribute to check for
Returns:
true if the attribute is present; otherwise, false

const char * AttributeAt unsigned  index  ) 
 

Gets the attribute at the specified position.

You may use this member function and the NumAttributes() member function to discover all the attributes (flags) in the response. For the most common attributes, you may use the convenience member functions Noinferiors(), Noselect(), Marked(), Unmarked() to learn if those attributes are in the response.

The parameter index must satisfy the constraint index < NumAttributes().

Parameters:
index position of the attribute to get
Returns:
attribute at the specified position

char Delimiter  )  const
 

Gets the delimiter character for the naming hierarchy.

Because IMAP4 allows mailboxes that are arranged in hierarchies, mailbox names may consist of one or more components separated by a delimiter character. An example is the character '/', which delimits the components of a UNIX path name in the file system. The delimiter character is not standard. Implementations often use '/' or '.', but other delimiter characters are possible.

Some IMAP4 servers do not support hierarchical mailbox names. Such IMAP4 servers send NIL for the delimiter. In this situation the Delimiter() member function returns NUL.

Returns:
delimiter char for mailbox hierarchy, or NUL if the server does not allow hierarchical names

void ImportData ListItem *  root  ) 
 

Called by the parser to set the data for this object.

Only the parser should call this function.

Parameters:
root root item of parse tree

const char * MailboxName  )  const
 

Gets the mailbox name.

Technically, the name need not be the name of a mailbox, although it often is. If the name is not a mailbox name, the server returns the \Noselect flag (attribute) to indicate that fact. If the \Noinferiors flag is absent, then the name might be the name of a "folder" that contains mailboxes.

If the name is empty, the function returns an empty string.

Returns:
string containing the mailbox name

bool Marked  )  const
 

Indicates if a \Marked flag is present in the response.

The \Marked flag indicates that the name is marked as "interesting" by the server. Typically, "interesting" means that the mailbox has new messages.

Returns:
true if a \Marked flag is present; otherwise, false

bool Noinferiors  )  const
 

Indicates if a \Noinferiors flag is present in the response.

The \Noinferiors flag indicates that no child names can exist under this name in the hierarchy.

Returns:
true if a \Noinferiors flag is present; otherwise, false

bool Noselect  )  const
 

Indicates if a \Noselect flag is present in the response.

The \Noselect flag indicates that this name may not be selected as a mailbox.

Returns:
true if a \Noselect flag is present; otherwise, false

unsigned NumAttributes  )  const
 

Gets the number of attributes.

You may use this member function and the AttributeAt() member function to discover all the attributes (flags) in the response. For the most common attributes, you may use the convenience member functions Noinferiors(), Noselect(), Marked(), Unmarked() to learn if those attributes are in the response.

Returns:
number of attributes in the response

ListResponse & operator= const ListResponse other  ) 
 

Assignment operator.

Parameters:
other other object to copy
Returns:
*this

bool Unmarked  )  const
 

Indicates if an \Unmarked flag is present in the response.

The \Unmarked flag indicates that there are no new messages since the last time the mailbox was read.

Returns:
true if an \Unmarked flag is present; otherwise, false

Copyright © 2001-2005 Hunny Software, Inc. All rights reserved.