Main Page | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

StatusResponse Class Reference

Inheritance diagram for StatusResponse:

Response List of all members.

Detailed Description

StatusResponse is a class that represents an IMAP4 STATUS response. The server sends a STATUS response in response to a STATUS command. The STATUS response includes a mailbox name and the requested status information for that mailbox.

Some of the status data items may not be present in the STATUS response, because the server sends only the data items that were requested in the STATUS command. This class does not provide a way to tell if a data item was absent from the RESPONSE. You should assume that the status data items are present only if your corresponding STATUS command requested those data items. For example, if your STATUS command requested the MESSAGES data item (the number of messages in the mailbox), then you can assume that the value returned from StatusResponse::Messages() is the value of the MESSAGES data item received in the STATUS response. Conversely, if you did not request the MESSAGES data item, then the value returned by StatusResponse::Messages() is undefined.

Important: It is a violation of the IMAP4 protocol to use the STATUS command to get information about the currently selected mailbox. This point is clearly stated in the most recent revision of RFC 2060 (which is now an Internet Draft).

See also:
Imap4Client::Status


Public Member Functions

 StatusResponse ()
 Default constructor.
 StatusResponse (const StatusResponse &other)
 Copy constructor.
virtual ~StatusResponse ()
 Destructor.
StatusResponseoperator= (const StatusResponse &other)
 Assignment operator.
const char * MailboxName () const
 Returns name of the mailbox.
uint32_t Messages () const
 Returns number of messages in the mailbox.
uint32_t Recent () const
 Returns number of recent messages.
uint32_t UidNext () const
 Returns next UID value for the mailbox.
uint32_t UidValidity () const
 Returns UID validity value for the mailbox.
uint32_t Unseen () const
 Returns number of "unseen" messages.
void SetParams (const char *s)
 Sets parameters for the response.


Constructor & Destructor Documentation

StatusResponse  ) 
 

Default constructor.

StatusResponse const StatusResponse other  ) 
 

Copy constructor.

Parameters:
other other object to copy

~StatusResponse  )  [virtual]
 

Destructor.


Member Function Documentation

const char * MailboxName  )  const
 

Returns name of the mailbox that the status information applies to. This name matches the name sent in the client's STATUS command.

Returns:
string containing the name of the mailbox

uint32_t Messages  )  const
 

Returns the number of messages in the mailbox.

Returns:
number of messages in the mailbox

StatusResponse & operator= const StatusResponse other  ) 
 

Assignment operator.

Parameters:
other other object to copy
Returns:
*this

uint32_t Recent  )  const
 

Returns the number of messages in the mailbox that are considered "recent".

Returns:
number of recent messages

void SetParams const char *  str  ) 
 

Sets parameters for the response.

Only the parser should call this function.

Parameters:
str string that contains unparsed parameters

uint32_t UidNext  )  const
 

Returns the value of the next UID to be assigned for the mailbox. (UID stands for "unique identifier".)

Returns:
next UID value for the mailbox

uint32_t UidValidity  )  const
 

Returns the UID validity value for the mailbox. The UID validity value is changed by the server whenever UIDs are re-assigned to the messages in the mailbox. Thus, if a client saves the UIDs between sessions, the UID validity value provides a way for the client to discover that the UIDs have been changed from a previous session.

Returns:
UID validity value for the mailbox

uint32_t Unseen  )  const
 

Returns the number of messages in the mailbox that are "unseen", that is, messages that have not yet been viewed in any client session.

Returns:
number of unseen messages

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