当前位置: 首页>>代码示例>>C++>>正文


C++ Message::AddPointer方法代码示例

本文整理汇总了C++中Message::AddPointer方法的典型用法代码示例。如果您正苦于以下问题:C++ Message::AddPointer方法的具体用法?C++ Message::AddPointer怎么用?C++ Message::AddPointer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Message的用法示例。


在下文中一共展示了Message::AddPointer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AddMessage

status_t DbxImporter::AddMessage( String &cMessage, const String &cFolder )
{
	if( cMessage != "" )
	{
		/* Add an RFC2822 terminating sequence */
		cMessage += "\r\n.\r\n";

		/* Create a Mailmessage and send it back down to the application along with the relevent data */
		Mailmessage *pcImport = new Mailmessage( cMessage.c_str(), cMessage.size() );

		Message *pcImportMessage = new Message( M_IMPORT_NEW );
		pcImportMessage->AddPointer( "message", pcImport );
		pcImportMessage->AddString( "folder", cFolder );

		m_pcMessenger->SendMessage( pcImportMessage );

		/* Update the progress dialog & check if the user canceled */
		//float vProgress = ( (double)m_nBytes / (double)m_nSize );
		float vProgress = ( (double)m_nTotal / (double)m_nCount );

		char zMessage[64] = { '\0' };
		snprintf( zMessage, 64, "Importing message #%Ld", m_nTotal++ );

		m_pcDialog->Lock();
		m_pcDialog->SetMessage( zMessage );
		m_pcDialog->SetProgress( vProgress );
		m_bRun = !m_pcDialog->IsCancelled();
		m_pcDialog->Unlock();
	}

	cMessage = "";
	return EOK;
}
开发者ID:PyroOS,项目名称:Pyro,代码行数:33,代码来源:dbx.cpp

示例2: _Save

void SettingsWindow::_Save( int nCode )
{
	/* Collect the current information entered in all the views */
	Settings *pcSettings = new Settings();
	WebSettings *pcWebSettings = new WebSettings();
	std::vector<SettingsView*>::iterator i;
	for( i = m_vViews.begin(); i != m_vViews.end(); i++ )
		(*i)->Store( pcSettings, pcWebSettings );


	/* Pass the settings back to the application */
	Message *pcNewMessage = new Message( nCode );
	pcNewMessage->AddPointer( "settings", (void*)pcSettings );
	pcNewMessage->AddPointer( "web_settings", (void*)pcWebSettings );

	Messenger cMessenger( m_pcParent );
	cMessenger.SendMessage( pcNewMessage );

	_SaveGui();
	Close();
}
开发者ID:PyroOS,项目名称:Pyro,代码行数:21,代码来源:settings_window.cpp

示例3: AddMessage

status_t MboxImporter::AddMessage( os::String &cMessage )
{
	if( cMessage != "" )
	{
		if( m_bDoCrLf )
		{
			/* Convert linefeeds to CRLF pairs */
			const char *pStart, *pEnd;
			int nLf = 0;

			pStart = cMessage.c_str();
			while( ( pEnd = strchr( pStart, '\n' ) ) != NULL )
			{
				nLf++;
				pStart = pEnd + 1;
			}

			char *pMessage = (char*)calloc( 1, cMessage.size() + nLf + 1 );
			if( NULL == pMessage )
				return ENOMEM;

			const char *pIn;
			char *pOut;

			pIn = cMessage.c_str();
			pOut = pMessage;

			while( '\0' != *pIn )
			{
				if( '\n' == *pIn )
					*pOut++ = '\r';
				*pOut++ = *pIn++;
			}
			cMessage = pMessage;
			free( pMessage );
		}

		/* Add an RFC2822 terminating sequence */
		cMessage += "\r\n.\r\n";

		/* Create a Mailmessage and send it back down to the application along with the relevent data */
		Mailmessage *pcImport = new Mailmessage( cMessage.c_str(), cMessage.size() );

		Message *pcImportMessage = new Message( M_IMPORT_NEW );
		pcImportMessage->AddPointer( "message", pcImport );
		pcImportMessage->AddString( "folder", m_cFolder );

		m_pcMessenger->SendMessage( pcImportMessage );

		/* Update the progress dialog & check if the user canceled */
		float vProgress = ( (double)m_nBytes / (double)m_nSize );

		char zMessage[64] = { '\0' };
		snprintf( zMessage, 64, "Importing message #%Ld", m_nCount++ );

		m_pcDialog->Lock();
		m_pcDialog->SetMessage( zMessage );
		m_pcDialog->SetProgress( vProgress );
		m_bRun = !m_pcDialog->IsCancelled();
		m_pcDialog->Unlock();
	}

	cMessage = "";
	return EOK;
}
开发者ID:PyroOS,项目名称:Pyro,代码行数:65,代码来源:mbox.cpp


注:本文中的Message::AddPointer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。