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

Response Class Reference

Inheritance diagram for Response:

BadResponse ByeResponse CapabilityResponse ContinuationResponse ExistsResponse ExpungeResponse FetchResponse FlagsResponse ListResponse LsubResponse NamespaceResponse NoResponse OkResponse PreauthResponse QuotaResponse QuotaRootResponse RecentResponse SearchResponse StatusResponse List of all members.

Detailed Description

Response is the super class of several other classes that represent standard IMAP4 responses. One purpose for Response is to allow the subclasses to be contained in a common list.

There is very little functionality in the Response class, so you will have to cast any Response object to a more specific class. To do this safely, you must examine the result of the Name member function. The following code shows how to do this for an OK response:

    void foo(Response& rsp) {
        if (strcasecmp(rsp.Name(), "OK") == 0) {
            OkResponse& okRsp = (OkResponse&) rsp;
            // ...
        }
    }
 

All instances of Response should be obtained from an instance of Imap4Client.

See also:
Imap4Client

Imap4Client::NumResponses

Imap4Client::ResponseAt


Public Member Functions

virtual ~Response ()
 Destructor.
const char * Name () const
 Returns the name of the response.
TypeCode Type () const
 Returns the type of the response as an enumerated value.

Protected Member Functions

 Response (const char *name, TypeCode type)
 Constructor that takes a name argument.
 Response (const Response &other)
 Copy constructor.
Responseoperator= (const Response &other)
 Assignment operator.


Constructor & Destructor Documentation

~Response  )  [virtual]
 

Destructor.

Response const char *  name,
TypeCode  type
[protected]
 

This is the protected constructor that is called from the constructor of subclasses. The argument is the name of the response, for example, "OK" for an OK response.

Parameters:
name name of the response
type type code of the response

Response const Response other  )  [protected]
 

Copy constructor

Parameters:
other other object to copy


Member Function Documentation

const char * Name  )  const
 

Returns the name of the response.

Returns:
name of the response

Response & operator= const Response other  )  [protected]
 

Assignment operator.

Parameters:
other other object to copy
Returns:
*this

Response::TypeCode Type  )  const
 

Returns the type of the response as an enumerated value.

Returns:
type of the response

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