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


C++ UnicodeString::CString方法代码示例

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


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

示例1: NotifyAlarm

// notify the alarm if it exists
STATUS DdmSSAPIDriver::NotifyAlarm(void *pAlarmContext_)
{
	TRACE_ENTRY(DdmSSAPIDriver::NotifyAlarm(void*));

	AlarmList *pAL = pALhead->Find(pAlarmContext_);
	STATUS erc = OK;
	if (pAL)
	{
		AMSTR_CMND_INFO* pCmdInfo;
		AMSTR_CMND_PARAMETERS* pCmdParams;
		UnicodeString notes = UnicodeString(StringClass("this is an notify string"));
		UnicodeString userName = UnicodeString(StringClass("toehler"));
	
		pCmdInfo = (AMSTR_CMND_INFO *)new char[sizeof(AMSTR_CMND_INFO)];
		memset(pCmdInfo,0,sizeof(AMSTR_CMND_INFO));

		pCmdInfo->opcode = AMSTR_CMND_NOTIFY_ALARM;
		pCmdParams = (AMSTR_CMND_PARAMETERS *) (&pCmdInfo->cmdParams);
	
		pCmdParams->rid = pAL->GetRowId();
		notes.CString(pCmdParams->notes, sizeof(pCmdParams->notes));
		userName.CString(pCmdParams->userName, sizeof(pCmdParams->userName));

		m_pCmdSender->csndrExecute(pCmdInfo, 
						   (pCmdCompletionCallback_t)&DdmSSAPIDriver::
						   amstrCommandCompletionReply,
						   NULL);
	}
	else
		erc = ERR;
	return erc;
}
开发者ID:JoeAltmaier,项目名称:Odyssey,代码行数:33,代码来源:DdmSSAPIDriver.cpp

示例2: RemitAlarmFromUser

STATUS DdmSSAPIDriver::RemitAlarmFromUser(rowID rid, UnicodeString userName)
{
	TRACE_ENTRY(DdmSSAPIDriver::RemitAlarmFromUser(void*));

	AMSTR_CMND_INFO* pCmdInfo;
	AMSTR_CMND_PARAMETERS* pCmdParams;
	
	pCmdInfo = (AMSTR_CMND_INFO *)new char[sizeof(AMSTR_CMND_INFO)];
	memset(pCmdInfo,0,sizeof(AMSTR_CMND_INFO));

	pCmdInfo->opcode = AMSTR_CMND_REMIT_ALARM_FROM_USER;
	pCmdParams = (AMSTR_CMND_PARAMETERS *) (&pCmdInfo->cmdParams);

	pCmdParams->rid = rid;
	userName.CString(pCmdParams->userName, sizeof(pCmdParams->userName));

	m_pCmdSender->csndrExecute(pCmdInfo, 
					   (pCmdCompletionCallback_t)&DdmSSAPIDriver::
					   amstrCommandCompletionReply,
					   NULL);
	return OK;
}
开发者ID:JoeAltmaier,项目名称:Odyssey,代码行数:22,代码来源:DdmSSAPIDriver.cpp

示例3: UnicodeString

//////////////////////////////////////////////////////////////////////
//
//	Change Array Name Reply Handler
//
//////////////////////////////////////////////////////////////////////
STATUS DdmRAIDMstr::
ProcessChangeArrayNameReply(void *_pCmdContext, STATUS status)
{
	RMSTR_CHANGE_ARRAY_NAME_INFO	*pChangeArrayNameInfo = NULL;
	RMSTR_CMND_INFO					*pCmdInfo = NULL;
	RMSTR_CMND_PARAMETERS			*pCmdParams = NULL;
	STATUS							rc = RMSTR_SUCCESS;
	BOOL							cmdComplete = false;	
	CONTEXT							*pCmdContext = NULL;
	RAID_ARRAY_DESCRIPTOR			*pADTRecord = NULL;
	RMSTR_EVT_ARRAY_NAME_CHANGED_STATUS	*pEvtArrayNameChanged = NULL;
	UnicodeString					ucNewArrayName;



	pCmdContext				= (CONTEXT *)_pCmdContext;
	pCmdInfo				= (RMSTR_CMND_INFO *)pCmdContext->pData;
	pCmdParams				= &pCmdInfo->cmdParams;
	pChangeArrayNameInfo		=
		(RMSTR_CHANGE_ARRAY_NAME_INFO *)&pCmdParams->changeArrayNameInfo;
	pADTRecord = (RAID_ARRAY_DESCRIPTOR *)pCmdContext->pData1;

	if (status != OS_DETAIL_STATUS_SUCCESS){
		rc = RMSTR_ERR_INVALID_COMMAND;
		cmdComplete = true;
	} else {
		switch(pCmdContext->state){

		case CHANGE_NAME_ARRAY_NAME_READ:
			// old array name is read into m_ucArrayName
			
			// Delete the old name from the table
			pCmdContext->state = CHANGE_NAME_OLD_NAME_DELETED;
			m_pStringResourceManager->DeleteString(
						RowId(pADTRecord->arrayNameRID),
						(pTSCallback_t)&DdmRAIDMstr::ProcessChangeArrayNameReply,
						pCmdContext);
			break;

		case CHANGE_NAME_OLD_NAME_DELETED:
			// Now write the new array name into the table
			ucNewArrayName = UnicodeString(
									pChangeArrayNameInfo->newName);
			pCmdContext->state = CHANGE_NAME_NEW_NAME_WRITTEN;
			m_pStringResourceManager->WriteString(
						ucNewArrayName,
						&pADTRecord->arrayNameRID,
						(pTSCallback_t)&DdmRAIDMstr::ProcessChangeArrayNameReply,
						pCmdContext);
			break;

		case CHANGE_NAME_NEW_NAME_WRITTEN:
			pCmdContext->state = CHANGE_NAME_ADT_RECORD_UPDATED;
			status = m_pTableServices->TableServiceModifyRow(
						RAID_ARRAY_DESCRIPTOR_TABLE,
						&pADTRecord->thisRID,	// row id to modify
						pADTRecord,
						sizeof(RAID_ARRAY_DESCRIPTOR),
						&pADTRecord->thisRID,
						(pTSCallback_t)&DdmRAIDMstr::ProcessChangeArrayNameReply,
						pCmdContext);
			break;

		case CHANGE_NAME_ADT_RECORD_UPDATED:
			// cmd is complete, report the status and generate event
			ModifyRmstrData(
				RAID_ARRAY,
				&pADTRecord->thisRID,
				pADTRecord);
			cmdComplete = true;
			break;

		default:
			break;
		}
	}
	if (cmdComplete){
		// Report the status of the change array name
		m_pCmdServer->csrvReportCmdStatus(
			pCmdContext->cmdHandle,		// handle
			rc,							// completion code
			NULL,						// result Data
			(void *)pCmdInfo);			// Orig cmd info

		if (rc == RMSTR_SUCCESS){
			// Generate event for Array Name Changed
			pEvtArrayNameChanged = new RMSTR_EVT_ARRAY_NAME_CHANGED_STATUS;
			memset(pEvtArrayNameChanged,0,sizeof(RMSTR_EVT_ARRAY_NAME_CHANGED_STATUS));

			pEvtArrayNameChanged->arrayRowId = pChangeArrayNameInfo->arrayRowId;

			// Copy the old and new name back to the event
			// Copy the Array Name back in the event
			m_ucArrayName.CString(
					pEvtArrayNameChanged->oldName, 
//.........这里部分代码省略.........
开发者ID:JoeAltmaier,项目名称:Odyssey,代码行数:101,代码来源:RmstrChangeArrayName.cpp


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