Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_InternetResponse Class Reference

Base class to handle responses from internet servers. Each different protocol will have a specific class of this type to handle and format responses for that protocol.

Inheritance diagram for CP_InternetResponse:

CP_FTPResponse CP_POP3Response CP_SMTPResponse List of all members.

Getters

CP_String GetResponseString ()
CP_String GetBodyString ()
SInt32 GetResponseCode ()
virtual bool GetServerResponse ()

Public Member Functions

Constructor / Destructor
 CP_InternetResponse (CP_Socket *inSocket)
 Constructor.
 CP_InternetResponse (const CP_InternetResponse &inResponse)
virtual ~CP_InternetResponse () throw ()
 Destructor.

Protected Attributes

CP_String fServerResponseString
CP_String fServerBodyString
SInt32 fServerResponseCode
CP_SocketfSocketConnection

Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_InternetResponse::CP_InternetResponse CP_Socket inSocket  ) 
 

Constructor.

Exceptions:
none 

CP_InternetResponse::CP_InternetResponse const CP_InternetResponse inResponse  ) 
 

Copy constructor.

Parameters:
inResponse CP_InternetResponse object to copy the fields from.
Exceptions:
none 

CP_InternetResponse::~CP_InternetResponse  )  throw () [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

CP_String CP_InternetResponse::GetResponseString  ) 
 

Return the text of the response.

Exceptions:
none 
Returns:
CP_String The response string.

CP_String CP_InternetResponse::GetBodyString  ) 
 

Return the text of the response.

Exceptions:
none 
Returns:
CP_String The response string.

SInt32 CP_InternetResponse::GetResponseCode  ) 
 

Return the resonse code

Exceptions:
none 
Returns:
SInt32 The response code.

bool CP_InternetResponse::GetServerResponse  )  [virtual]
 

Handle replies from our server. Subclasses may need to override this depending on the particular server sends back responses.

Exceptions:
none 
Returns:
bool True if we received a valid response.

Reimplemented in CP_FTPResponse, CP_POP3Response, and CP_SMTPResponse.

void CP_InternetResponse::SetResponseString const CP_String inResponse  ) 
 

Sets the text of the response. This text comes from the server.

Parameters:
inResponse The servers response.
Exceptions:
none 
Returns:
void

void CP_InternetResponse::SetResponseCode SInt32  inResponseCode  ) 
 

Sets the response code. This text comes from the server.

Parameters:
inResponseCode The servers response code.
Exceptions:
none 
Returns:
void

void CP_InternetResponse::ResetResponse  ) 
 

Resets the fields of this response to initial or empty values.

Exceptions:
none 
Returns:
void

SInt32 CP_InternetResponse::ReadLine CP_Socket inSocket,
CP_String inOutResult
[protected]
 

Receive the next line from our server. We keep receiving until the end of line is reached.

Parameters:
inSocket The socket we communicate to the server with.
inOutResult Location to return the resulting text in.
Exceptions:
OSError exceptions
Returns:
SInt32 The result of reading from the server. It will either be CP_noErr or CP_Err_ReceivingFromSocket.


Member Data Documentation

CP_String CP_InternetResponse::fServerResponseString [protected]
 

CP_String CP_InternetResponse::fServerBodyString [protected]
 

CP_String containing the response from the server.

SInt32 CP_InternetResponse::fServerResponseCode [protected]
 

CP_String containing the body of the response from the server

CP_Socket* CP_InternetResponse::fSocketConnection [protected]
 

Any numeric response code from the server.


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:01:47 2005 for CPLAT by  doxygen 1.4.0