iapconnectdemosettings.h

来自「symbian关于Internet访问的代码」· C头文件 代码 · 共 89 行

H
89
字号
/*
* ============================================================================
*  Name     : CIAPConnectDemoSettings from IAPConnectDemoSettings.h
*  Part of  : Internet Access Points Example v2.0
*  Created  : 01.09.2006 by Forum Nokia
*  Version  : 2.0
*  Copyright: Forum Nokia
* ============================================================================
*/

#ifndef IAPCONNECTDEMOSETTINGS_H
#define IAPCONNECTDEMOSETTINGS_H

// INCLUDE FILES
#include <e32base.h>
#include <e32std.h>

// CLASS DECLARATION

/**
*  CIAPConnectDemoSettings
*  This class handles reading data from the socket.
*  In this implementation, any data read is simply displayed
*  as text on the console.
*/
class CIAPConnectDemoSettings : public CBase
	{
public: // Constructors and destructor

    /**
    * C++ default constructor.
    */
	CIAPConnectDemoSettings();
	
	/**
	* Destructor.
	*/
	~CIAPConnectDemoSettings();

public: // New functions

	/**
	* Add new key value pair to list
	* @param aKey key to value
	* @param aValue parameter is copied to HBuf
	*/
	void AddSettingL( const TInt& aKey, const TDesC& aValue );
	void AddSettingL( const TInt& aKey, const TInt& aValue );
	
	/**
	* Add new CIAPConnectDemoSettinsPair instance to list
	* @param aKey Key to value
	* @param aValue Key's value
	*/
	void AddPairL( const TInt& aKey, HBufC* aValue );

	/**
	* Return key's value in descriptor
	* @param aKey Asked key
	* @param aValue Reference parameter for descriptor
	* @return KErrNone if value found and it's valid, otherwise return errorcode
	*/
	TInt GetSetting( const TInt& aKey, TDesC& aValue ) const;
	TInt GetSetting( const TInt& aKey, TInt& aValue ) const;
	TInt GetSetting( const TInt& aKey, HBufC*& aValue) const;
				
private: // New functions
    struct TDemoSettingsPair {
        TInt    iKey;
        HBufC*  iValue;
    };

	/**
	* Search key's index in list
	* @param aKey Searched key
	* @param aIndex Reference value where index is
	* @return KErrNone if key found, otherwise return errorcode
	*/
	TInt KeyIndex( const TInt& aKey, TUint& index ) const;

private: // Data members

	RArray<TDemoSettingsPair> iSettings;
	};

#endif

// End of File

⌨️ 快捷键说明

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