The ImapResponse class models a single IMAP response. It has the knowledge necessary to decide whether a particular response can be sent, has been sent, and formulates the exact textual form of the response.
Constructs a response which is bound to server but not to any Session, and sends the constant string response. response should not contain the leading "* " or trailing CRLF.
Constructs a response which is bound to session. A subclass is responsible for text().
The response is meaningful() only if session is active.
Constructs a response which is bound to session and sends the constant string response. response should not contain the leading "* " or trailing CRLF.
Returns true if sending this response will change the session() MSN map, and false if not.
Returns the IMAP server to which this response pertains.
Returns true if this response has meaning, and false if it may be discarded.
One reason to discard a response is that it's related to a session, but the session has ended.
Returns true if setSent() has been called.
Returns the session passed to the constructor, or 0 if none.
Records that when the text() is sent, the client's idea of MSN->UID mapping will change.
Meant to be called by subclass constructors.
Notifies this ImapResponse that it has been sent to the client.
This function is virtual and not const. Subclasses may perform state changes in this function, e.g. calling IMAP::endSession(), so that the server's state matches what the IMAP client will have after parsing this response.
Returns the text of the response.
Subclasses may need to compute this, so if possible it should be called only once. The function is const, so subclasses should not perform any state changes here (but rather in setSent()).
If text() returns an empty string, the caller should discard the response and not send it.
Virtual destructor to please gcc.
This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.