Main Page | Class Hierarchy | Class List | Class Members

BadResponse Class Reference

Inheritance diagram for BadResponse:

Response List of all members.

Detailed Description

BadResponse is a class that represents an IMAP4 BAD response.

A BAD response indicates a negative result at the server. If the BAD response is tagged, it indicates that the client command with the same tag has failed. If the BAD response is untagged (that is, the tag is "*"), then it indicates an error for which there is no specific client command.

A NO 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 BadResponse following a client command, you will want to check the tag of the BadResponse by calling the Tag member function. If the tag is not "*", then this response indicates that the client command with the same tag has failed.

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


Public Member Functions

 BadResponse ()
 Default constructor.
 BadResponse (const char *tag)
 Constructor that takes the tag as a parameter.
 BadResponse (const BadResponse &other)
 Copy constructor.
virtual ~BadResponse ()
 Destructor.
BadResponseoperator= (const BadResponse &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

BadResponse  ) 
 

Default constructor.

BadResponse 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

BadResponse const BadResponse other  ) 
 

Copy constructor.

Parameters:
other other object to copy

~BadResponse  )  [virtual]
 

Destructor.


Member Function Documentation

BadResponse & operator= const BadResponse 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.