CResponse Class Reference

List of all members.

Public Types

enum  TResponseState { ENotComplete, EComplete, EError }
enum  TResponseType { ELoadTasks = 0, ETaskComplete }

Public Member Functions

 ~CResponse ()
void ParseDataL (TDesC &aData)
TBool HasError () const
TBuf< KMaxError > Error () const
TInt TaskCount () const
TBuf< KMaxTaskLength > TaskDescription (const TInt &aIndex) const
TInt TaskId (const TInt &aIndex) const
TResponseType ResponseType () const
void InputDataL (const TDesC8 &aData)
TResponseState GetState () const

Static Public Member Functions

static CResponseNewL ()
static CResponseNewLC ()

Detailed Description

A wrapper class for handling responses from the server.

Definition at line 25 of file Response.h.


Member Enumeration Documentation

Enum for following the class' state.

Definition at line 32 of file Response.h.

Determines what type of response is in question.

Definition at line 57 of file Response.h.


Constructor & Destructor Documentation

CResponse::~CResponse (  ) 

Destructor

Definition at line 30 of file Response.cpp.


Member Function Documentation

CResponse * CResponse::NewL (  )  [static]

Two-phased constructor.

Definition at line 42 of file Response.cpp.

CResponse * CResponse::NewLC (  )  [static]

Two-phased constructor.

Definition at line 54 of file Response.cpp.

void CResponse::ParseDataL ( TDesC &  aData  ) 

Constructs this response object from the data received from the server.

Parameters:
aData the data that was received from the server

Definition at line 81 of file Response.cpp.

TBool CResponse::HasError (  )  const

Returns whether errors occurred in the server side.

Returns:
ETrue if response consist errors, EFalse if not.

Definition at line 150 of file Response.cpp.

TBuf< KMaxError > CResponse::Error (  )  const

Returns the error description.

Returns:
the error description.

Definition at line 165 of file Response.cpp.

TInt CResponse::TaskCount (  )  const

Returns the number of tasks received from the server.

Returns:
the number of tasks received from the server.

Definition at line 175 of file Response.cpp.

TBuf< KMaxTaskLength > CResponse::TaskDescription ( const TInt &  aIndex  )  const

Returns the task description.

Parameters:
aIndex the index of the description.
Returns:
the task description.

Definition at line 185 of file Response.cpp.

TInt CResponse::TaskId ( const TInt &  aIndex  )  const

Returns the task id.

Returns:
the task id.

Definition at line 200 of file Response.cpp.

CResponse::TResponseType CResponse::ResponseType (  )  const

Returns the type of this response.

Returns:
the type of this response.

Definition at line 215 of file Response.cpp.

void CResponse::InputDataL ( const TDesC8 &  aData  ) 

Takes in a part of the server message.

Parameters:
aData part of the message

Definition at line 226 of file Response.cpp.

CResponse::TResponseState CResponse::GetState (  )  const

Returns whether the entire message has been given to CResponse. This function is used specifically by the engine to determine whether or not continue reading from the socket.

Returns:
ETrue if message is complete, EFalse if not.

Definition at line 294 of file Response.cpp.


Generated by  doxygen 1.6.2