//---------------------------------------------------------------------------
//
//	Parse one line from the method's section.  This should consist of a
//	parameter type (BSTR, long, etc), and a value ( example : BSTR="Hello" ).
//	For a property's return value it should have the word return.
//	(example : LONG=return).
//
//---------------------------------------------------------------------------
bool
CMethod::ParseParam(
	LPCTSTR	szParam )
{
	bool rc = false;

	CString strParam = szParam;
	int pos = strParam.Find( _T('=') );
	if ( pos != -1 )
	{
		CString strType = strParam.Left( pos );
		strType.TrimRight();
		VARIANT vt;
		vt.vt = StringToType( strType );
		if ( vt.vt != VT_EMPTY )
		{
			CString strVal = strParam.Right( strParam.GetLength() - (pos+1) );
			strVal.TrimLeft();
			if ( strVal.CompareNoCase( _T("return") ) != 0 )
			{
				if ( StringToVal( strVal, vt ) )
				{
					rc = true;
					m_params.push_back( vt );
				}
			
			}
			else
			{
				// this is the return value
			}
		}
	}
	return rc;
}
Example #2
0
 Server::Server ( Config *config )
 {
     /* stub function */
     // Get the server port.
     StringToVal ( config->GetProperty ( "network_server_port" ), &this->port );
 }