httpconninfo.cpp

来自「symbian http/post引擎 xml引擎 支持IAP设置」· C++ 代码 · 共 162 行

CPP
162
字号
/*
* ============================================================================
*  Name     : TTaskManagerConnInfo from TaskManagerConnInfo.cpp
*  Part of  : TaskManager
*  Created  : 03/13/2005 by Forum Nokia
*  Version  : 1.2
*  Copyright: Nokia Corporation
* ============================================================================
*/

// INCLUDE FILES
#include "HttpConnInfo.h"
#include "TaskManager.pan"

// ================= MEMBER FUNCTIONS =======================

// constructor
THttpConnInfo::THttpConnInfo(): iPhp(ETrue), iIap(0)
	{
	// No implementation
	}

// ----------------------------------------------------------
// THttpConnInfo::SetServerAddress()
// Sets the server address.
// ----------------------------------------------------------
//
void THttpConnInfo::SetServerAddress( const TDesC& aAddress )
	{
	if( aAddress.Length() > KMaxServerNameLength )
		{
		Panic(ETaskManagerServerAddressTooLong);
		}
	iServerAddress.Copy( aAddress );
	}

// ----------------------------------------------------------
// THttpConnInfo::ServerAddress()
// Gets the server address.
// ----------------------------------------------------------
//
TBufC< KMaxServerNameLength > THttpConnInfo::ServerAddress() const
	{
	return iServerAddress;
	}

// ----------------------------------------------------------
// THttpConnInfo::SetPhp()
// Sets the server implementation type.
// ----------------------------------------------------------
//		
void THttpConnInfo::SetPhp( const TBool& aPhp)
	{
	iPhp = aPhp;
	}

// ----------------------------------------------------------
// THttpConnInfo::Php()
// Gets the server implementation type.
// ----------------------------------------------------------
//		
const TBool THttpConnInfo::Php() const
	{
	return iPhp;
	}
	
// ----------------------------------------------------------
// THttpConnInfo::SetUsername()
// Sets the username.
// ----------------------------------------------------------
//		
void THttpConnInfo::SetUsername( const TDesC& aUsername )
	{
	if( aUsername.Length() > KMaxUsernameLength )
		{
		Panic(ETaskManagerUsernameTooLong); 
		}
	iUsername.Copy( aUsername );
	}

// ----------------------------------------------------------
// THttpConnInfo::Username()
// Gets the username.
// ----------------------------------------------------------
//		
TBufC< KMaxUsernameLength > THttpConnInfo::Username() const
	{
	return iUsername;	
	}
	
// ----------------------------------------------------------
// THttpConnInfo::SetPassword()
// Sets the password.
// ----------------------------------------------------------
//			
void THttpConnInfo::SetPassword( const TDesC& aPassword )
	{
	if( aPassword.Length() > KMaxPasswordLength )
		{
		Panic(ETaskManagerPasswordTooLong);
		}
	iPassword.Copy( aPassword );
	}

// ----------------------------------------------------------
// THttpConnInfo::Password()
// Gets the password.
// ----------------------------------------------------------
//		
TBufC< KMaxPasswordLength > THttpConnInfo::Password() const
	{
	return iPassword;	
	}

// ----------------------------------------------------------
// THttpConnInfo::SetIap()
// Sets the IAP.
// ----------------------------------------------------------
//			
void THttpConnInfo::SetIap( const TUint32& aId)
	{
	iIap = aId;
	}

// ----------------------------------------------------------
// THttpConnInfo::Iap()
// Gets the IAP.
// ----------------------------------------------------------
//			
TUint32 THttpConnInfo::Iap() const
	{
	return iIap;
	}

// ----------------------------------------------------------
// THttpConnInfo::ExternalizeL()
// Saves the connection data to the given stream.
// ----------------------------------------------------------
//		
void THttpConnInfo::ExternalizeL(RWriteStream& aStream) const
	{
	aStream << iServerAddress;
	aStream << iUsername;
	aStream << iIap;
	aStream.WriteInt32L(iPhp);
	}

// ----------------------------------------------------------
// THttpConnInfo::InternalizeL()
// Reads the connections data from the given stream.
// ----------------------------------------------------------
//			
void THttpConnInfo::InternalizeL(RReadStream& aStream)
	{
	aStream >> iServerAddress;
	aStream >> iUsername;
	aStream >> iIap;
	iPhp = aStream.ReadInt32L();
	}
	
// End of file

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?