///////////////////////////////////////////////////////////////////////////////
///
///	Encapsulates a list of function parameters
///
///////////////////////////////////////////////////////////////////////////////
class CParamList
{
public:
	CParamList(void);
	~CParamList(void);

	///////////////////////////////////////////////////////////////////////////////
	///
	///	Assignment operator
	/// 
	/// \param	[IN] sParamList
	///			Parameter list to copy from
	/// 
	/// \return	Instance of itself
	///
	///////////////////////////////////////////////////////////////////////////////
	CParamList & operator= (CParamList & sParamList);

	///////////////////////////////////////////////////////////////////////////////
	///
	///	Get the total number of parameters
	/// 
	/// \param	None
	/// 
	/// \return	Total number of parameters in list
	///
	///////////////////////////////////////////////////////////////////////////////
	INT_PTR GetCount() { return m_lstParams.GetCount(); }

	///////////////////////////////////////////////////////////////////////////////
	///
	///	Add a parameter to list.  Duplicate parameter names are not allowed.
	/// If a duplicate name is found, the item is updated with the new value.
	/// 
	/// \param	[IN] szLabel
	///			Name of parameter
	/// 
	/// \param	[IN] szValue
	///			Value of the parameter.  Note that the value is only stored as a
	///			string.  Conversion has to be handled by the caller if another
	///			type is required.	
	/// 
	/// \return	TRUE if parameter successfully added to list, FALSE otherwise
	///
	///////////////////////////////////////////////////////////////////////////////
	BOOL Add(CString szLabel, CString szValue);

	///////////////////////////////////////////////////////////////////////////////
	///
	///	Retrieve the value of the specified label.  If label not found, NULL string
	/// is returned.
	/// 
	/// \param	[IN] szLabel
	///			Label of parameter to search for
	/// 
	/// \return	Value of parameter associated with the specified label.  NULL
	///			string is returned if specified label not found.
	///
	///////////////////////////////////////////////////////////////////////////////
	CString GetValue(CString szLabel);

	///////////////////////////////////////////////////////////////////////////////
	///
	///	Get the function parameter at the specified index.
	/// 
	/// \param	[IN] iIndex
	///			Index of function parameter in the list.
	/// 
	/// \param	[OUT] szLabel
	///			Name of parameter
	/// 
	/// \param	[OUT] szValue
	///			Value of parameter
	/// 
	/// \return	TRUE if parameter successfully retrieved, FALSE otherwise
	///
	///////////////////////////////////////////////////////////////////////////////
	BOOL GetAt(UINT iIndex, CString &szLabel, CString &szValue);

protected:
	///////////////////////////////////////////////////////////////////////////////
	///
	///	Each function parameter consists of a label and a value
	/// 
	/// \param	szLabel
	///			Name of the parameter
	/// 
	/// \param	szValue
	///			Value of the parameter.  Note that the value is only stored as a
	///			string.  Conversion has to be handled by the caller if another
	///			type is required.	
	///
	///////////////////////////////////////////////////////////////////////////////
	struct STRUCT_FuncParam
	{
		CString szLabel;
		CString szValue;

		// comparison operator
		BOOL operator== (const STRUCT_FuncParam & sFuncParam) const
		{ return (0 == szLabel.Compare(sFuncParam.szLabel))?TRUE:FALSE; }
	};

	// List of function parameters
	CList <STRUCT_FuncParam, STRUCT_FuncParam&> m_lstParams;
};
