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


C++ TDesC16::Ptr方法代码示例

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


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

示例1: Set

/** Sets an existing descriptor setting to a new value or creates a new setting
with a descriptor value if it doesn't exist.
@param aKey Key of setting to be written to.
@param aValue Value to be written.
@return
	KErrNone if successful,
	KErrArgument if aValue is longer than KMaxUnicodeStringLength or
	the setting exists but is not a descriptor,
	plus other system-wide error codes.
@post
	Transactions fail on all error conditions.
	Outside transactions: on success the new value is persistent,
	on failure the repository is unmodified.
@capability Dependent Caller must satisfy the write access policy of that key in the repository.
*/
EXPORT_C TInt CRepository::Set(TUint32 aKey, const TDesC16& aValue)
	{
	if (aValue.Length()>KMaxUnicodeStringLength)
		return KErrArgument;	
	TPtrC8 pVal((const TUint8*)aValue.Ptr(), aValue.Length()*2);
	return Set(aKey,pVal);
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:22,代码来源:pccenrep.cpp

示例2: ActivateViewL

void CTestVwAppUi::ActivateViewL(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC16& aCustomMessage)
	{
	HBufC8* narrowMessage=HBufC8::NewLC(aCustomMessage.Size());
	TPtr8 ptr=narrowMessage->Des();
	ptr.Copy((TUint8*)aCustomMessage.Ptr(),aCustomMessage.Size());

	CCoeAppUi::ActivateViewL(aViewId,aCustomMessageId,*narrowMessage);
	CleanupStack::PopAndDestroy(); // narrowMessage.
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:9,代码来源:tvwappui.CPP

示例3: FindNeqL

/** Finds all the settings that match the specification given by aPartialKey
and aMask, but are either not string values or do not match the given string.
@param aPartialKey
	Contains a bit pattern that all the keys returned must at least partially
	match.
@param aMask
	Has bits set for all the bits in aPartialKey that must match the returned
	keys.
@param aValue
	Settings for the keys found will be settings that either contain values
	that are not strings or strings with value other than aValue.
@param aFoundKeys All the keys found.
	For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and
	the setting with key k is either not a string value or a string value not
	equal to aValue.
@see FindL()
@return
	KErrNone if successful,
	KErrNotFound if capability check passed but no non-matching items are found,
	plus other system-wide error codes.
@post Transactions fail only on those "other system-wide error codes".
@capability Dependent Caller must satisfy the read policies of all settings found in the source range.
*/
EXPORT_C TInt CRepository::FindNeqL(TUint32 aPartialKey, TUint32 aMask,
	const TDesC16& aValue, RArray<TUint32>& aFoundKeys)
	{
	TPtrC8 pVal((const TUint8*)aValue.Ptr(), aValue.Length()*2);	
	TRAPD(ret,iImpl->FindSettingsComparisonL(aPartialKey,aMask,pVal,ENotEqual,aFoundKeys));
	if (ret==KErrNoMemory)
		User::LeaveNoMemory();
	return ret;
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:32,代码来源:pccenrep.cpp

示例4:

void TDes8::Copy(const TDesC16 &aDes)
{
	TInt len=aDes.Length();
	SetLength(len);
	const TUint16 *pS=aDes.Ptr();
	const TUint16 *pE=pS+len;
	TUint8 *pT=const_cast<TUint8 *>(Ptr());
	while (pS<pE)
		{
		TUint c=(*pS++);
		if (c>=0x100)
			c=1;
		*pT++=(TUint8)c;
		}
}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:15,代码来源:e32base.cpp

示例5: if

EXPORT_C int Tlitc16ToChar(const TDesC16& aSrc, char* aDes, int& n_size)
{
    unsigned int ilen = 0;
    int retval = ESuccess;
    ilen = aSrc.Length();
    wchar_t* temp16String = NULL;
    int minusone = -1;
    
    if (0 == ilen )
    {
    	return EDescriptorNoData;
    }
    else if ( !aDes )
    {
        return EInvalidPointer;
    }
    else if (n_size < ilen*2 +1)
    {
    	n_size = ilen*2 + 1;
    	return EInvalidSize;
    }
      
  	
  	temp16String = new wchar_t [ilen+1];
	if (!temp16String)
	{
		return EInsufficientSystemMemory;
	}
	
	wmemcpy(temp16String, (const wchar_t*)aSrc.Ptr(), ilen);
	temp16String[ilen] = L'\0'; 
	
    if(minusone != wcstombs(aDes, temp16String, ilen*2))
	{
	     aDes[ilen*2] = '\0';    
	}
	else 
	{
		retval = EInvalidWCSSequence;
	}
	
	delete []temp16String;
	return retval;
}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:44,代码来源:descriptor16tochar.cpp

示例6: NtPasswordHashL

inline void CPppMsChap::NtPasswordHashL(const TDesC16& aPassword,
					TDes8& aPasswordHash)
/**
   Computes the hash of the Microsoft Windows NT password using MD4.
   @param aPassword [in] The Microsoft Windows NT password (0 to 256
   Unicode char).
   @param aPasswordHash [out] The MD4 hash of the Microsoft Windows NT
   password (16 octets).
   @note This function implements the NtPasswordHash routine specified
   in RFC 2433.
   @internalComponent
*/
	{
	ASSERT(aPassword.Length() <= KPppMsChapMaxNTPasswordLength);
	ASSERT(aPasswordHash.Length() == KPppMsChapHashSize);

// The following code does not use the Symbian Security subsystem
// components, because they do not provide a MD4 implementation yet.
// This is a provisional solution until the Symbian Security subsystem
// components will provide a MD4 implementation.

	CMd4* md4 = CMd4::NewL();
	CleanupStack::PushL(md4);


// The following code assumes that the data in TDesC16 descriptors is
// stored in little endian byte order, which is currently a
// characteristic of Symbian OS, so the reinterpret_cast is assumed to
// be safe here.
	md4->Input(TPtrC8(reinterpret_cast<const TUint8*>(
			aPassword.Ptr()),
		aPassword.Size()));
	md4->Output(aPasswordHash);

	CleanupStack::PopAndDestroy(md4);

	ASSERT(aPasswordHash.Length() == KPppMsChapHashSize);
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:38,代码来源:MSCHAP.CPP

示例7:

 /**
   * Converts a descriptor of type TLitc16 to Wstring
   *
   * @param aSrc is the descriptor to be converted , aDes is the 
   * reference to the Wstring array where the result of conversion 
   * is stored  
   * @return Status code (0 is ESuccess, -1 is EInsufficientMemory, 
   * -5 is EDescriptorNoData)
   */
EXPORT_C int Tlitc16ToWstring(TDesC16& aSrc, wstring& aDes)
{	
 
    unsigned int ilen =  aSrc.Length();	
   	if (0 == ilen)
    {
    	return EDescriptorNoData;
    }		
	
	wchar_t* wcharString = new wchar_t[ilen+1];
	if (!wcharString)
	{
		return EInsufficientSystemMemory;
	}
	
	wmemcpy((wchar_t*)wcharString, (const wchar_t*)aSrc.Ptr(), ilen);
	wcharString[ilen] = L'\0';
	
	aDes.assign(wcharString);
	
	delete []wcharString;
	return ESuccess;
}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:32,代码来源:descriptor16towstring.cpp

示例8: OstTrace

/**
Outputs a trace packet containing variable length data.

If the specified data is too big to fit into a single
trace record a multipart trace is generated.

@deprecated

@param aContext 	Attributes of the trace point.
@param aTraceId	    The trace point identifier as specified by @see TTraceId
@param aData		Additional data to add to trace packet.
					Must be word aligned, i.e. a multiple of 4.

@return 			The trace packet was/was not logged.

@See BTrace::TMultipart
*/
EXPORT_C TBool OstTrace(const TTraceContext& aContext, const TTraceId aTraceId, const TDesC16& aData)
	{
	if(IsTraceActive(aContext))
		{
		GET_PC(pc);
		return OST_SECONDARY_ANY(aContext.GroupId(), aContext.ComponentId(), aContext.HasThreadIdentification(), aContext.HasProgramCounter(), pc, aTraceId, aData.Ptr(), aData.Size());
		}
	return EFalse;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:26,代码来源:ost.cpp

示例9: OstPrint

/**
Prints a string by outputting a trace packet with the Trace ID KFormatPrintfUnicode

If the specified string is too long to fit into a single trace packet
a multipart trace is generated.

@deprecated

@param aContext 	The trace packet context. @see TTraceContext
@param aDes			The string. This must not be longer than 256 characters.

@return 			The trace packet was/was not output.

@See BTrace::TMultipart
*/
EXPORT_C TBool OstPrint(const TTraceContext& aContext, const TDesC16& aDes)
	{
	if(IsTraceActive(aContext))
		{
		GET_PC(pc);
		return OST_SECONDARY_ANY(aContext.GroupId(), aContext.ComponentId(), aContext.HasThreadIdentification(), aContext.HasProgramCounter(), pc, KFormatPrintfUnicode, aDes.Ptr(), aDes.Size());
		}
	return EFalse;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:24,代码来源:ost.cpp

示例10: SetL

EXPORT_C void TDbColumn::SetL(const TDesC16& aValue)
	{
	SetL(aValue.Ptr(),aValue.Length()<<1);
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:4,代码来源:UD_ROW.CPP

示例11: Write

// ---------------------------------------------------------
// RUnicodeFile::Write
// ---------------------------------------------------------
//
TInt RUnicodeFile::Write( const TDesC16& aDes )
    {
    return iFile.Write ( TPtrC8( (const TUint8*)aDes.Ptr(), aDes.Size() ) );
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:8,代码来源:UnicodeFile.cpp


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