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


C++ TDes16::Copy方法代码示例

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


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

示例1: ReadDes

EXPORT_C TInt CLANLinkCommon::ReadDes(const TDesC& aField, TDes16& aValue)
{
	// Emulate reading of following parameters only:
	// LAN_BEARER\LAN_BEARER_LDD_FILENAME
	// LAN_BEARER\LAN_BEARER_LDD_NAME
	// LAN_BEARER\LAN_BEARER_PDD_FILENAME
	// LAN_BEARER\LAN_BEARER_PDD_NAME

	_LIT(KLanBearer, "LANBearer\\");
	const TInt KLanBearerTokenSize = 10;

	TPtrC field(aField.Left(KLanBearerTokenSize));	// "LANBearer"

	if (field.Compare(KLanBearer()) == 0)
		{
		_LIT(KLanBearerLddFilename, "LDDFilename");
		_LIT(KLanBearerLddName, "LDDName");
		_LIT(KLanBearerPddFilename, "PDDFilename");
		_LIT(KLanBearerPddName, "PDDName");

		field.Set(aField.Mid(KLanBearerTokenSize));	// skip "LANBearer\\"
		if (field.CompareF(KLanBearerLddFilename) == 0)
			{
			aValue.Copy(LinkProvision().LddFilename());
			}
		else
		if (field.CompareF(KLanBearerLddName) == 0)
			{
			aValue.Copy(LinkProvision().LddName());
			}
		else
		if (field.CompareF(KLanBearerPddFilename) == 0)
			{
			aValue.Copy(LinkProvision().PddFilename());
			}
		else
		if (field.CompareF(KLanBearerPddName) == 0)
			{
			aValue.Copy(LinkProvision().PddName());
			}
		else
			{
			return KErrNotSupported;
			}
		return KErrNone;
		}
	else
		{
		return KErrNotSupported;
		}
}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:51,代码来源:Ethbase.cpp

示例2: DoReadDes

TInt CDummyNifAgentRef::DoReadDes(const TDesC& aField, TDes16& aValue,const RMessagePtr2* /*aMessage*/)
{
	TInt result = KErrNotFound;
	if (ipIniFileReader !=0)
	{
		TPtrC value;
		if (ipIniFileReader->FindVar(iData.KCommDbSectionName,aField,value))
		{
			aValue.Copy(value);
			result=KErrNone;
		}
	}
	//use hardcoded only if the ini file read or search failed
	if (KErrNotFound==result)
	{
		result=KErrNone;
		//
		if (TPtrC(KCDTypeNameRecordName)==aField)
			aValue=iData.KPppCommdbName;
		else if (iData.KModemPortString==aField)
			aValue=iData.KPppPortString;
		else if (iData.KModemCsyString==aField)
			aValue=iData.KPppCsyString;
		else
			result=KErrNotFound;
	}
	//
	LOG_ERR_PRINTF4(_L("--------------- Config param used: %S = %S (err %d)"),&aField,&aValue,result);
	//
	return result;
}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:31,代码来源:DummyAgtRef.cpp

示例3: GetUpdatePackageIds

// ---------------------------------------------------------------------------
// RFotaEngineSession::GetUpdatePackageIds
// Gets ids of the update packages present in the system.
// ---------------------------------------------------------------------------
EXPORT_C TInt RFotaEngineSession::GetUpdatePackageIds(TDes16& aPackageIdList)
    {
    TInt err;
    FLOG(_L("RFotaEngineSession::GetUpdatePackageIds >>"));
    TBuf<10> b; b.Copy(_L("dkkd"));
    TPkgIdList                  pkgids;
    TPckg<TPkgIdList>           pkgids_pkg(pkgids);
    TIpcArgs                    args ( &pkgids_pkg);
    err = SendReceive ( EGetUpdatePackageIds, args);
    aPackageIdList.Copy(pkgids);
    FLOG(_L("RFotaEngineSession::GetUpdatePackageIds <<"));
    return err;
    }
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:17,代码来源:fotaengine.cpp

示例4: wcslen

EXPORT_C int WcharToTbuf16(const wchar_t* aSrc, TDes16& aDes)
{
    unsigned int ilen = 0;
	if ( !aSrc )
	{
		return EInvalidPointer;
	}
	else
	{
		ilen = wcslen(aSrc);
		if(ilen > aDes.MaxLength())
		{
			return EInsufficientMemory; 
		}	
	}
	
	aDes.Copy((const TUint16*)aSrc, ilen);
	return ESuccess;
}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:19,代码来源:wchartodescriptor16.cpp

示例5: wcslen

EXPORT_C int WstringToTbuf16(wstring& aSrc, TDes16& aDes)
{
    int retval = ESuccess;
    const wchar_t* wcharString = aSrc.c_str();
    
    if (L'\0' == wcharString[0])
    {
    	return EStringNoData;
    }
    
    int len= wcslen(wcharString);
    if ((wcslen(wcharString)) > aDes.MaxLength())
    if (len > aDes.MaxLength())
    {
    	return EInsufficientMemory;
    }
    
	aDes.Copy((const TUint16*)wcharString);
	
    return retval;	
}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:21,代码来源:wstringtodescriptor16.cpp

示例6: ConfigModemStringL

TInt CTsyConfig::ConfigModemStringL(const TDesC& aStringTag, TDes16& aString)
	{
	TInt r=KErrNone;
	for (TInt i=0;i<10;i++)
		{
		TRAP(r, GetCurrentTableViewsL()); // Place a cursor on the default modem record in comms database server
		if (r==KErrAccessDenied) // if we get access denied from DBMS, which is a timing thing, just re-post
			{
			User::After(1000000);
			continue;
			}
		else
			break;
		}
	if (r)
		{
		LOGTEXT(_L8("CommDB values seem to be corrupt"));
		ResetCurrentTableViews(); // clean up everything
		return (KErrEtelModemSettingsCorrupt);
		}

	CCDModemBearerRecord* modemRecord = static_cast<CCDModemBearerRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdModemBearerRecord));
	CleanupStack::PushL(modemRecord);
	modemRecord->SetRecordId(iModemBearer);
	modemRecord->LoadL(*iDbSession);

	
	TInt ret;
	TInt type(0);
	CMDBElement* baseField = NULL;
	TRAP(ret, baseField = modemRecord->GetFieldByNameL(aStringTag, type));
	if (ret == KErrNone)
		{
		// check for type
		switch(type)
			{
			case EMedText:
			case EText:
		
				{
				CMDBField<TDesC>* field = static_cast<CMDBField<TDesC>*>(baseField);
				aString = *field;
				ret = KErrNone;
				}
				break;
			case EDesC8:
				{
				// des16 needs to be cast to des8
				CMDBField<TDesC8>* field8 = static_cast<CMDBField<TDesC8>*>(baseField);
				const TDesC8& refField = *field8;
				aString.Copy(refField);
				ret = KErrNone;
				}
				break;
			default:
				ret = KErrNotFound;
			}
		}
	
	CleanupStack::PopAndDestroy(modemRecord);

	ResetCurrentTableViews(); // Clear location and modem table views and close handle to CCommsDatabase
	return ret;
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:64,代码来源:TSYCONFG.CPP


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