Main Page | Class Hierarchy | Class List | Class Members

NoResponse Class Reference

Inheritance diagram for NoResponse:

Response List of all members.

Detailed Description

NoResponse is a class that represents an IMAP4 NO response.

A NO response indicates a negative result at the server. If the NO response is tagged, it indicates that the client command with the same tag has failed. If the NO response is untagged (that is, the tag is "*"), then it contains a warning from the server.

A BAD response also indicates a negative result, but a BAD response and a NO response are not the same. A NO response indicates that the negative result occurred because of conditions at the server, such as an internal server error. A BAD response indicates a protocol error, such as a command that is not supported by the server or a syntax error in the command message.

When you receive a NoResponse following a client command, you will want to check the tag of the NoResponse by calling the Tag member function. If the tag is "*", it indicates a warning message from the server. In this case, you may want to check the response code by calling the ResponseCode member function. If the tag is not "*", then this response indicates that the client command with the same tag was unsuccessful.

Typically, a NO response contains human-readable text. You can get this text by calling the ResponseText member function.


Public Member Functions

 NoResponse ()
 Default constructor.
 NoResponse (const char *tag)
 Constructor that takes the tag as a parameter.
 NoResponse (const NoResponse &other)
 Copy constructor.
virtual ~NoResponse ()
 Destructor.
NoResponseoperator= (const NoResponse &other)
 Assignment operator.
const char * Tag () const
 Returns the tag of a tagged response.
const char * ResponseCode () const
 Returns the response code.
const char * ResponseText () const
 Returns the response text.
void SetParams (const char *s)
 Sets parameters for the response.


Constructor & Destructor Documentation

NoResponse  ) 
 

Default constructor.

NoResponse const char *  tag  ) 
 

Constructor that takes the tag as a parameter.

The argument is the tag of a tagged response, or "*" if the response is untagged.

Parameters:
tag the tag of a tagged response; or "*" for an untagged response

NoResponse const NoResponse other  ) 
 

Copy constructor.

Parameters:
other other object to copy

~NoResponse  )  [virtual]
 

Destructor.


Member Function Documentation

NoResponse & operator= const NoResponse other  ) 
 

Assignment operator.

Parameters:
other other object to copy
Returns:
*this

const char * ResponseCode  )  const
 

Returns the response code.

Response codes are delimited in the response by square bracket characters ([...]). See the IMAP4 spec for the possible response codes and their meanings.

Returns:
the response code, if present; otherwise, an empty string

const char * ResponseText  )  const
 

Returns the response text.

The response text is intended to be meaningful to humans, for example, for debugging. (However, it's a mistake to assume that the response text will be meaningful to a user who is not familiar with IMAP4!)

Returns:
the response text, if present; otherwise, an empty string

void SetParams const char *  s  ) 
 

Sets parameters for the response.

Only the parser should call this function.

Parameters:
s string that contains unparsed parameters

const char * Tag  )  const
 

Returns the tag of a tagged response. If the response is not a tagged response, the function returns "*".

Returns:
the tag of a tagged response; otherwise "*"

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