servicediscoveryandcontrol/pnp/test/upnp/upnpmessage/inc/CRequest.h
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __CREQUEST_H__
       
    17 #define __CREQUEST_H__
       
    18 
       
    19 #include <stringpool.h>
       
    20 
       
    21 #include "rrequest.h"
       
    22 #include "CMessage.h"
       
    23 
       
    24 /** An HTTP Request.  Provides the real implementation of a request,
       
    25 	as proxied in the public API by RRequest.
       
    26 	@see RRequest
       
    27 */
       
    28 class CRequest : public CMessage
       
    29 	{
       
    30 public:
       
    31 
       
    32 	/** Constructs a request
       
    33 	*/
       
    34 	IMPORT_C static CRequest* NewL(CHeaderCodec& aCodec, RStringPool& aStringPool);
       
    35 	/** Destructor
       
    36 	*/
       
    37 	IMPORT_C ~CRequest();
       
    38 
       
    39 	/** Returns the method
       
    40 	*/
       
    41 	const RStringF& Method() const;
       
    42 
       
    43 	/** Returns the method (as a reference so you can set it)
       
    44 	*/
       
    45 	RStringF& Method();
       
    46 
       
    47 	/** Returns the URI (as a reference so you can set it)
       
    48 	*/
       
    49 	CUri8*& URI();
       
    50 
       
    51 	/** Obtain a handle for this request that can be used by the client.
       
    52 	*/
       
    53 	inline RRequest Handle();
       
    54 
       
    55 	/** Returns the string pool.
       
    56 	*/
       
    57 	RStringPool& StringPool();
       
    58 	
       
    59 	/** Returns the string pool
       
    60 	*/
       
    61 	const RStringPool& StringPool() const;
       
    62 	
       
    63 	/** Returns ETrue if the HTTP protocol version is 1.0
       
    64 	 */
       
    65 	inline TBool IsHTTP10() const;
       
    66 	
       
    67   	/** Returns the HTTP version (returned as a reference, which you can set)
       
    68   	*/
       
    69   	inline TVersion& Version();
       
    70   	
       
    71   	/** Resets the request object.
       
    72   	 */
       
    73   	inline void Reset();
       
    74 
       
    75 private:
       
    76 
       
    77 	/** Constructor
       
    78 	*/
       
    79 	CRequest(RStringPool& aStringPool);
       
    80 
       
    81 private:
       
    82 
       
    83 	/** The URI
       
    84 	*/
       
    85 	CUri8* iURI;
       
    86 
       
    87 	/** The method
       
    88 	*/
       
    89 	RStringF iMethod;
       
    90 	
       
    91 	/** The string pool
       
    92 	*/
       
    93 	RStringPool& iStringPool;
       
    94 	
       
    95 	/** The HTTP version number (major/minor) obtained from the HTTP server's response
       
    96 	*/
       
    97 	TVersion iVersion;
       
    98 	
       
    99 	};
       
   100 
       
   101 #include "CRequest.inl"
       
   102 
       
   103 #endif // __CREQUEST_H__