TBool assert_equals_des16(CTestExecuteLogger& aLogger, const TText8* aFile, TInt aLine, TInt aSeverity,
	const TDesC& aRes, const TDesC& aExp, const TDesC& aMsg)
	{
	if(aRes != aExp)
		{
		TPtrC exp;
		TPtrC res;
		
		exp.Set(aExp.Ptr(), aExp.Length());
		res.Set(aRes.Ptr(), aRes.Length());
		
		//truncate to 20 characters, to avoid logging too big strings
		if(exp.Length() > KMaxLogCharLength)
			{
			exp.Set(exp.Ptr(), KMaxLogCharLength);
			}
		
		if(res.Length() > KMaxLogCharLength)
			{
			res.Set(res.Ptr(), KMaxLogCharLength);
			}
		
		aLogger.LogExtra(aFile, aLine, aSeverity, KAssertErrorEqualsTextDes, &res, &exp, &aMsg);
		return EFalse;
		}
	return ETrue;
	}
// -----------------------------------------------------------------------------
// CAMMSEqualizerControl::SetPresetL
// Sets the effect according to the given preset.
// -----------------------------------------------------------------------------
//
void CAMMSEqualizerControl::SetPresetL(const TDesC& aPreset)
{
    LOG1( EJavaAMMS, EInfo, "AMMS::CAMMSEqualizerControl::SetPresetL \"%S\"", aPreset.Ptr());

    const CDesCArray& presetNames = PresetNamesL();

    TInt presetPosition = 0;
    TInt findPreset = presetNames.Find(aPreset, presetPosition);
    if (findPreset == 0)  // Find returns zero, if a matching element is found.
    {
        // This supposes that the indexing of the presets starts at zero.
        iEqualizerUtility->GetPresetL(presetPosition);

        // Set the base class audio effect as the new CAudioEqualizer
        // that is set with the previous GetPresetL method.
        iAudioEffect = &(iEqualizerUtility->Equalizer());
        iCurrentPreset = presetPosition;

        LOG1( EJavaAMMS, EInfo, "AMMS::CAMMSEqualizerControl::SetPresetL \"%S\" GetPresetL OK",
                  aPreset.Ptr());
    }
    else
    {
        User::Leave(KErrArgument);
    }
}
Q_CORE_EXPORT QString qt_TDesC2QString(const TDesC& aDescriptor)
{
#ifdef QT_NO_UNICODE
    return QString::fromLocal8Bit(aDescriptor.Ptr(), aDescriptor.Length());
#else
    return QString::fromUtf16(aDescriptor.Ptr(), aDescriptor.Length());
#endif
}
Пример #4
0
Q_CORE_EXPORT QString qt_TDesC2QString(const TDesC& aDescriptor)
{
#ifdef QT_NO_UNICODE
    return QString::fromLocal8Bit(aDescriptor.Ptr(), aDescriptor.Length());
#else
    return QString(reinterpret_cast<const QChar *>(aDescriptor.Ptr()), aDescriptor.Length());
#endif
}
Пример #5
0
void PlayerController::TrackInfoChanged(const TDesC &aTitle, const TDesC &aArtist)
{
QString name=QString::fromRawData(reinterpret_cast<const QChar*>(aTitle.Ptr()),aTitle.Length());
QString artist=QString::fromRawData(reinterpret_cast<const QChar*>(aArtist.Ptr()),aArtist.Length());
qDebug()<<"TrackInfoChanged"<<name<<artist;
if (name.length()>15){name=name.left(12)+"...";}
if (artist.length()>40){artist=artist.left(37)+"...";}
//if (artist.length()==0){artist=QString::fromUtf8("Unknown aritst");}
emit changeTrackInfo(artist,name);
}
// -----------------------------------------------------------------------------
// BuildTraceFunc
// -----------------------------------------------------------------------------
void BuildTraceFunc( const TDesC& aPrefix ) // aPrefix is the component name (from developer)
    {

    __TRACE_PRINTF( ( _T("%s: Compiled=%s - %s"), aPrefix.Ptr(), __DATE__, __TIME__ ) );
    __TRACE_PRINTF( ( _T("%s: Possible flags are: { __WINS__ | _DEBUG | COMPONENT_TRACE_FLAG | API_TRACE_FLAG | EXTENDED_TRACE_FLAG }"), aPrefix.Ptr() ) );
	__TRACE_PRINTF( ( _T("%s: Following flags are supported" ), aPrefix.Ptr() ) );

#ifdef __WINS__
	__TRACE_PRINTF( ( _T( "%s:     __WINS__" ), aPrefix.Ptr() ) );
#endif

#ifdef _DEBUG
	__TRACE_PRINTF( ( _T( "%s:     _DEBUG" ), aPrefix.Ptr() ) );
#endif

#ifdef COMPONENT_TRACE_FLAG
	__TRACE_PRINTF( ( _T( "%s:     COMPONENT_TRACE_FLAG" ), aPrefix.Ptr() ) );
#endif

#ifdef API_TRACE_FLAG
	__TRACE_PRINTF( ( _T( "%s:     API_TRACE_FLAG" ), aPrefix.Ptr() ) );
#endif

#ifdef EXTENDED_TRACE_FLAG    
	__TRACE_PRINTF( ( _T( "%s:     EXTENDED_TRACE_FLAG" ), aPrefix.Ptr() ) );
#endif

    __TRACE_PRINTF( ( _T( "%s: End of Flags supported " ), aPrefix.Ptr() ) );

// and so on .. Define all important flags for this component and print them here!!!

    }
// -----------------------------------------------------------------------------
// CWidgetUiObserver::IsFileScheme
// -----------------------------------------------------------------------------
//
TBool CWidgetUiObserver::IsFileScheme( const TDesC& aFileName )
    {
    if ( aFileName.Length()> 0 && aFileName.Ptr() )
        {
        if ( aFileName.FindF(KFileScheme) == 0 )
            {
            return ETrue;
            }
        else
            {//Check for paths are that not URI, but of the form..
             // c:/dir/foo.txt. This is to accomodate browser engine inconsistencies. 
            TUriParser16 parser;
            if( parser.Parse( aFileName ) == KErrNone )
                {
                TPtrC16 scheme = parser.Extract( EUriScheme );
                // As per the URI RFC, the part before : is the Scheme
                if ( scheme.Length() == (KMaxDriveName-1) ) 
                    {
                    return ETrue;
                    }
                }
            }
        }

    return EFalse;
    }
void TSymbian_ua_guiSettingItemListSettings::SetEd_user(const TDesC& aValue)
	{
	if ( aValue.Length() < KEd_userMaxLength)
		iEd_user.Copy( aValue );
	else
		iEd_user.Copy( aValue.Ptr(), KEd_userMaxLength);
	}
Пример #9
0
void TDesWrite::WriteL(const TDesC& aDes)
	{
	WriteL(aDes.Length());
	if (iDes.Size() & 1) iDes.AppendL('.'); // Pad so the desc is 2-byte aligned
	TPtrC8 ptr((TUint8*)aDes.Ptr(), aDes.Size());
	iDes.AppendL(ptr);
	}
Пример #10
0
TUint32 CMTPDeviceDataProvider::AddEntryL( const TDesC& aPath, TUint32 aParentHandle, TUint32 aStorageId, CMTPObjectMetaData& aObjectInfo  )
    {
    OstTraceFunctionEntry0( CMTPDEVICEDATAPROVIDER_ADDENTRYL_ENTRY );
    
    TBool isFolder( EFalse );
    BaflUtils::IsFolder( Framework().Fs(), aPath, isFolder );
    
    __ASSERT_ALWAYS( isFolder, User::Leave( KErrArgument ));
    __ASSERT_ALWAYS( aParentHandle != KMTPHandleNone, User::Leave( KErrArgument ));
    __ASSERT_ALWAYS( Framework().StorageMgr().ValidStorageId( aStorageId ), User::Leave( KErrArgument ));

    OstTraceExt1(TRACE_NORMAL, CMTPDEVICEDATAPROVIDER_ADDENTRYL, "Add Entry for Path:%S", aPath);
    aObjectInfo.SetUint( CMTPObjectMetaData::EDataProviderId, Framework().DataProviderId() );
    aObjectInfo.SetUint( CMTPObjectMetaData::EFormatCode, EMTPFormatCodeAssociation );
    aObjectInfo.SetUint( CMTPObjectMetaData::EStorageId, aStorageId );
    aObjectInfo.SetDesCL( CMTPObjectMetaData::ESuid, aPath );
    aObjectInfo.SetUint( CMTPObjectMetaData::EFormatSubCode, EMTPAssociationTypeGenericFolder );
    aObjectInfo.SetUint( CMTPObjectMetaData::EParentHandle, aParentHandle );
    aObjectInfo.SetUint( CMTPObjectMetaData::ENonConsumable, EMTPConsumable );
    
    //For example 
    //C:\\Documents\\Sample\\Sample1\\
    //Then "Sample1" is inserted into folderObjects
    TUint length = aPath.Length()-1;//remove '\'
    TPtrC tailFolder( aPath.Ptr(), length );
    TInt pos = tailFolder.LocateReverse( KPathDelimiter ) + 1;
    tailFolder.Set( tailFolder.Right(length - pos));

    aObjectInfo.SetDesCL( CMTPObjectMetaData::EName, tailFolder );
    
    Framework().ObjectMgr().InsertObjectL( aObjectInfo );
    OstTraceFunctionExit0( CMTPDEVICEDATAPROVIDER_ADDENTRYL_EXIT );
    return aObjectInfo.Uint( CMTPObjectMetaData::EHandle );
    }
// ---------------------------------------------------------------------------
// CVoiceMailboxEntry::SetVmbxNumber
// Set number or address of the entry instance
// ---------------------------------------------------------------------------
//
TInt CVoiceMailboxEntry::SetVmbxNumber( const TDesC& aVmbxNumber )
    {
    qDebug("DummyVoiceMailboxEntry::SetVmbxNumber >");
    globalNumber = QString::fromUtf16(aVmbxNumber.Ptr(), aVmbxNumber.Length());
    qDebug("DummyVoiceMailboxEntry::SetVmbxNumber %d", globalExpRet);
    return globalExpRet;
    }
EXPORT_C void CMTPTypeObjectPropListElement::SetArrayL(TInt aElementId, const TDesC& aString)
    {
    if(EValue != aElementId)
        {
        User::Leave(KErrArgument);
        }
    
    TUint32 len = aString.Length() + 1;
    
    SetDataType(EMTPTypeAUINT16);

    iValueSize = sizeof(TUint32) + len * sizeof(TUint16);
    
    TUint pageIndex = iPageIndex;
    TUint bufIndex = iBufIndex;
    // Copy string length
    iPropList->IncreaseIndexL(pageIndex, bufIndex, KPropElemHeaderSize, ETrue);
    iPropList->MemoryCopyL(pageIndex, bufIndex, &len, sizeof(TUint32));
    // Copy string data
    iPropList->IncreaseIndexL(pageIndex, bufIndex, sizeof(TUint32), ETrue);
    iPropList->MemoryCopyL(pageIndex, bufIndex, aString.Ptr(), (len - 1) * sizeof(TUint16));
    // Append terminator
    iPropList->IncreaseIndexL(pageIndex, bufIndex, (len - 1) * sizeof(TUint16), ETrue);
    iPropList->MemoryCopyL(pageIndex, bufIndex, KMtpStringTerminator().Ptr(), 2);
        
    iArrayBuffered = EFalse;
     }
EXPORT_C void CMTPTypeObjectPropListElement::SetStringL(TInt aElementId, const TDesC& aString)
    {
    if(EValue != aElementId || aString.Length() > KMaxStringSize)
        {
        User::Leave(KErrArgument);
        }
    
    TUint8 len = aString.Length() + 1;

    // For string which length is 255, truncate the last character to handle the file name of 255
    if (aString.Length() == KMaxStringSize)
        {
        len = KMaxStringSize;
        }
    
    SetDataType(EMTPTypeString);


    iValueSize = 1 + len * sizeof(TUint16);
    TUint pageIndex = iPageIndex;
    TUint bufIndex = iBufIndex;
    // Copy string length
    iPropList->IncreaseIndexL(pageIndex, bufIndex, KPropElemHeaderSize, ETrue);
    iPropList->MemoryCopyL(pageIndex, bufIndex, &len, sizeof(TUint8));
    // Copy string data
    iPropList->IncreaseIndexL(pageIndex, bufIndex, sizeof(TUint8), ETrue);
    iPropList->MemoryCopyL(pageIndex, bufIndex, aString.Ptr(), (len - 1) * sizeof(TUint16));
    // Append terminator
    iPropList->IncreaseIndexL(pageIndex, bufIndex, (len - 1) * sizeof(TUint16), ETrue);
    iPropList->MemoryCopyL(pageIndex, bufIndex, KMtpStringTerminator().Ptr(), 2);
        
    iArrayBuffered = EFalse;
    }
void TCalendarManagerSettingItemListSettings::SetSchedule_Content(const TDesC& aValue)
	{
	if ( aValue.Length() < KSchedule_ContentMaxLength)
		iSchedule_Content.Copy( aValue );
	else
		iSchedule_Content.Copy( aValue.Ptr(), KSchedule_ContentMaxLength);
	}
// ------------------------------------------------------------------------------------------------
// CNSmlDsProvisioningAdapter::CombineURILC()
// Combines address and port to URI 
// ------------------------------------------------------------------------------------------------
TInt CNSmlDsProvisioningAdapter::CombineURILC( const TDesC& aAddr, const TDesC& aPort, HBufC*& aRealURI )
	{
	TInt offset = 0;
	TInt i = 0;
	if( aAddr.Find( KNSmlDsProvisioningHTTP ) == 0 )
		{
		offset = KNSmlDsProvisioningHTTP().Length();
		}
	else if( aAddr.Find( KNSmlDsProvisioningHTTPS ) == 0 )
		{
		offset = KNSmlDsProvisioningHTTPS().Length();
		}
		
	// after skipping double slashes seek next single slash
	for( i = offset; i < aAddr.Length(); i++ )
		{
		if( aAddr[i] == KNSmlDMUriSeparator )
			{
			break;
			}
		}
	
	aRealURI = HBufC::NewLC( aAddr.Length() + aPort.Length() + 1 );
	TPtr uriPtr = aRealURI->Des();

	uriPtr.Copy( aAddr.Ptr(), i );
	uriPtr.Append( KNSmlDMColon );
	uriPtr.Append( aPort );
	uriPtr.Append( aAddr.Right( aAddr.Length() - i ) );
		
	return KErrNone;
	}
Пример #16
0
TInt StopModeDebug::CopyAndExpandDes(const TDesC& aSrc, TDes& aDest)
	{
	//check bounds
	if(aSrc.Length() * 2 > aDest.MaxLength())
		{
		return KErrArgument;
		}

	//get a pointer to the start of the destination descriptor
	TUint16* destPtr = (TUint16*)aDest.Ptr();

	//get pointers to the start and end of the aSrc descriptor
	const TUint8* srcPtr = aSrc.Ptr();
	const TUint8* srcEnd = srcPtr + aSrc.Length();

	//copy the characters from aSrc into aDest, expanding to make them 16-bit characters
	while(srcPtr < srcEnd)
		{
		*destPtr = (TUint16)*srcPtr;
		destPtr++;
		srcPtr++;
		}

	//set aDest's length to reflect the new contents
	aDest.SetLength(2*aSrc.Length());
	return KErrNone;
	}
Пример #17
0
// -----------------------------------------------------------------------------
// CPKIDialog::?member_function
// ?implementation_description
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//    
void CPKIDialog::UserAuthenticationText( 
    const TDesC& aTextToSign,
    const RArray<TCTTokenObjectHandle>& aCertHandleList, 
    TCTTokenObjectHandle& aCertHandle,
    TRequestStatus& aStatus )
    {
    iCurrentOperation = EUserAuthenticationText;
	InitClientStatus( aStatus );

	TInt textSize = aTextToSign.Size();
	TSignInput signInput;
	signInput.iOperation = EUserAuthenticationText;
	signInput.iVariableDataSize = textSize;
	signInput.iCertHandleArrayTotal = aCertHandleList.Count();
	TPckgC<TSignInput> signInputBufPtr( signInput );
	// iSignInputBuf is persistent because further input processing occurs in the AO before
	// calling the notifier.
	iSignInputBuf.Copy( signInputBufPtr );
	const TUint8* textToSignPtr = reinterpret_cast<const TUint8*>( aTextToSign.Ptr() );
	iVariableDataPtr.Set( textToSignPtr, textSize );

	iClientCertInfoHandlePtr = &aCertHandle;

	iRequester->RequestVariableBufferDialog( iSignInputBuf, iVariableDataPtr,
											aCertHandleList, iCertInfoHandleBuf );
    }
Пример #18
0
// Return an offset of the real subject. Skips Re: Fwd: etc.
// The string to skip is in the class instance iSubjectSkipString.
// Returns a valid offset or KErrNotFound
TInt CMsvEntryArray::FindSubjectStart(const TDesC& aSubject, const TDesC& aSubjectSkipString) const
	{
	// Set up temporary's for more readable code
	// current moves along the descriptor
	// offset is the index into the descriptor of the real subject. (Can be KErrNotFound)
	TPtrC ptr(aSubject);
	TInt offset(0);
	TInt current(0);
	TInt skipLength = aSubjectSkipString.Length();
	do
		{
		current = ptr.FindF(aSubjectSkipString);
		if(current != KErrNotFound)
			{
			// Found a match so increment past the skip string instance. (Could be more)
			offset+= current + skipLength;
			ptr.Set(aSubject.Ptr()+offset,aSubject.Length()-offset);
			}
		else if(offset == 0)
			{
			// None found
			offset = KErrNotFound;
			}
		}while(current != KErrNotFound);
	return offset;
	}
/**
 * Launch a process
 * @param aProcess the RProcess object used for creating the process
 * @param aExeName the name of the executable to run 
 * @param aCommandLine command line parameters to pass when creating the process 
 * @return KErrNone on success, or one of the other system wide error codes
 */
TInt LaunchProcess(RProcess& aProcess, TDesC& aExeName, TDesC& aCommandLine )    
	{
	LOG_MSG("ENTER: t_multi_agent_launcher: launchProcess"); 

	LOG_MSG2("aExeName %S ", &TPtr8((TUint8*)aExeName.Ptr(), 2*aExeName.Length(), 2*aExeName.Length()));
	LOG_MSG2("aCommandLine %S", &TPtr8((TUint8*)aCommandLine.Ptr(), 2*aCommandLine.Length(), 2*aCommandLine.Length()));

	TInt err = aProcess.Create( aExeName, aCommandLine );
	LOG_MSG2("t_multi_agent_launcher launchProcess, aProcess.Create err = %d", err); 

	// check that there was no error raised
	if(err != KErrNone)
		{
		return err;
		}

	// rendezvous with process
	TRequestStatus status = KRequestPending;
	aProcess.Rendezvous(status);

	if(KRequestPending != status.Int())
		{
		// startup failed so kill the process
		LOG_MSG2("t_multi_agent_launcher: launchProcess: RProcess Rendezvous() failed with %d. Killing process", status.Int());
		aProcess.Kill(KErrNone);
		return status.Int();
		}
	else
		{
		aProcess.Resume();
		User::WaitForRequest(status);

		LOG_MSG2("t_multi_agent_launcher: launchProcess: RProcess Resume() Rendezvous successful %d: ", status.Int());

		if(KErrNone != status.Int())
			{
			LOG_MSG2("t_multi_agent_launcher: RProcess Resume() failed with %d. Killing process", status.Int());
			aProcess.Kill(KErrNone);
			}

		LOG_MSG("EXIT: t_multi_agent_launcher launchProcess");
		return status.Int();
		}
	}
Пример #20
0
EXPORT_C TInt Kern::ValidateName(const TDesC& aName)
	{
	CHECK_PRECONDITIONS(MASK_THREAD_STANDARD,"Kern::ValidateName");	
	TUint8*	pName = const_cast<TUint8*>(aName.Ptr());
	TInt	pNameLen = aName.Length();
	for(;pNameLen;pName++,pNameLen--)
		if(*pName>0x7e || *pName<0x20 || *pName=='*' || *pName=='?' || *pName==':')
			return KErrBadName;
	return KErrNone;
	}
TBool CPerformanceFunctionalityBase::StringComparisonTestPrint(	const TDesC &aCompareL,
                												const TText *aCompareOperator,
                												const TDesC &aCompareR,
                												const TBool aResult,
                												const TInt 	aIteration,
                												const TInt 	aSubIteration,
                												const TInt 	aLine,
                												const TText *aFile)
	{
	_LIT(KComparePrint, "%s %s %s: failed on subiteration %d of iteration %d");
	_LIT(KFilePrint, "In file: %s at line: %d");
	if( !aResult )
		{
		ERR_PRINTF6( KComparePrint, (TText*)aCompareL.Ptr(), aCompareOperator, (TText*)aCompareR.Ptr(), aSubIteration, aIteration);
		ERR_PRINTF3( KFilePrint, aFile, aLine );
		TEST1( EFalse , ETrue );

		}
	return aResult;
	}
Пример #22
0
QT_BEGIN_NAMESPACE

bool qt_symbian_isLinkedFont(const TDesC &typefaceName) // Also used in qfont_s60.cpp
{
    bool isLinkedFont = false;
#ifdef SYMBIAN_LINKEDFONTS_SUPPORTED
    const QString name((const QChar*)typefaceName.Ptr(), typefaceName.Length());
    isLinkedFont = name.endsWith(QLatin1String("LF")) && name == name.toUpper();
#endif // SYMBIAN_LINKEDFONTS_SUPPORTED
    return isLinkedFont;
}
TBool CBrCtlApiTestObserver::IsFileScheme(const TDesC& aFileName)
    {
    _LIT(KFileScheme, "file://");
    if (aFileName.Length() > 0 && aFileName.Ptr() != NULL)
        {
        if (aFileName.FindF(KFileScheme) == 0)
            {
            return ETrue;
            }
        }
    return EFalse;
    }
	void Write(const TDesC& str) {
		if (cons) {
			
			cons->Write(str);
		}
		if (foutput.SubSessionHandle()!=0) {
			TInt len=str.Length()*2;
			TPtrC8 p( (const TUint8*)str.Ptr(), len );
			foutput.Write(p);
			foutput.Flush();
		}
	}
Пример #25
0
TBool CCommonUtils::HexToDec(const TDesC& aHexDes,TInt& aDec)
{
	TInt i,mid; 
	TInt len = aHexDes.Length();//lstrlen( aHexDes ); 

	//if( len > 9 )//#00ff00ff? 
	//	return EFalse; 

	mid = 0; aDec = 0; 
	for( i = 0;i < len; i++ ) 
	{ 
		if( (aHexDes.Ptr())[i]>='0' && (aHexDes.Ptr())[i]<='9' ) 
		{
			mid = (aHexDes.Ptr())[i]-'0'; 
		}
		else if( (aHexDes.Ptr())[i]>='a'&& (aHexDes.Ptr())[i]<='f' ) 
		{
			mid = (aHexDes.Ptr())[i] -'a' +10; 
		}
		else if( (aHexDes.Ptr())[i]>='A'&& (aHexDes.Ptr())[i]<='F' ) 
		{
			mid = (aHexDes.Ptr())[i] -'A' +10;
		}
		else if ((aHexDes.Ptr())[i] == '#') 
		{
			continue;
		}
		else
		{
			return EFalse; 
		}

		mid <<= ((len-i-1)<<2); 
		aDec |= mid; 

	} 
	return ETrue; 


}
Пример #26
0
// ---------------------------------------------------------
// TCodParser::ParseL()
// ---------------------------------------------------------
//
void TCodParser::ParseL( const TDesC& aBuf, CCodData& aData )
    {
    CLOG(( EParse, 2, _L("-> TCodParser::ParseL") ));
    CDUMP(( EParse, 2, _S("Buf:"), _S("    "), \
        (const TUint8*)aBuf.Ptr(), aBuf.Size() ));
    iError = KErrNone;
    iData = &aData;
    iBuf = &aBuf;
    iCurP = iBuf->Ptr();
    iEndP = iCurP + iBuf->Length();
    CMediaObjectData *mediaObject = CMediaObjectData::NewL();
    // Processing lines (attribute and value) until there is more lines to read.
    while ( AttrLineL(mediaObject) )
        {
        // Some compilers require empty controlled statement block instead of
        // just a semicolon.
        }
    iData->AppendMediaObjectL( mediaObject );   
#ifdef __TEST_COD_LOG
    TPtrC ptr16;
    TPtrC8 ptr8;
    CLOG(( EParse, 3, _L("TCodParser::ParseL data:") ));
    ptr16.Set( aData.Name() );
    CLOG(( EParse, 3, _L("  Name<%S>"), &ptr16 ));
    ptr16.Set( aData.Vendor() );
    CLOG(( EParse, 3, _L("  Vendor<%S>"), &ptr16 ));
    ptr16.Set( aData.Description() );
    CLOG(( EParse, 3, _L("  Desc<%S>"), &ptr16 ));
    CLOG(( EParse, 3, _L("  Size(%d)"), aData.Size() ));
    ptr8.Set( aData.InstallNotify() );
    CLOG(( EParse, 3, _L8("  InstNotif<%S>"), &ptr8 ));
    ptr8.Set( aData.NextUrl() );
    CLOG(( EParse, 3, _L8("  NextUrl<%S>"), &ptr8 ));
    ptr8.Set( aData.NextUrlAtError() );
    CLOG(( EParse, 3, _L8("  NextUrlAtErr<%S>"), &ptr8 ));
    ptr8.Set( aData.InfoUrl() );
    CLOG(( EParse, 3, _L8("  InfoUrl<%S>"), &ptr8 ));
    ptr16.Set( aData.Price() );
    CLOG(( EParse, 3, _L("  Price<%S>"), &ptr16 ));
    ptr8.Set( aData.Icon() );
    CLOG(( EParse, 3, _L8("  Icon<%S>"), &ptr8 ));
#endif /* def __TEST_COD_LOG */

    // NULL data for clarity. These are never used later, but don't keep
    // pointers to objects which are out of reach.
    iBuf = NULL;
    iData = NULL;
    iCurP = NULL;
    iEndP = NULL;
    User::LeaveIfError( iError );
    CLOG(( EParse, 2, _L("<- TCodParser::ParseL") ));
    }
// ---------------------------------------------------------
// CBrCtlSampleAppLinkResolver::IsFileScheme
// ---------------------------------------------------------
//
TBool 
CBrCtlSampleAppLinkResolver::IsFileScheme(const TDesC& aFileName)
    {
    _LIT(KFileScheme, "file://");
    if (aFileName.Length() > 0 && aFileName.Ptr() != NULL)
        {
        if (aFileName.FindF(KFileScheme) == 0)
            {
            return ETrue;
            }
        }
    return EFalse;
    }
Пример #28
0
EXPORT_C TInt RSoundPlugIn::Load(const TDesC& aFileName)
/** Loads a new plug-in, replacing the existing one, if any. 

This function always causes a flush of the window server buffer.

@param aFileName The filename of the plug-in DLL to load.
@return KErrNone if the function was successful. KErrNotSupported if the currently 
loaded plug-in could not be unloaded or aFileName does not refer to a loadable plug-in.
@capability WriteDeviceData */
	{
	TInt length=aFileName.Length();
	return WriteReply(&length,sizeof(length),aFileName.Ptr(),aFileName.Size(),EWsClickOpLoad);
	}
Пример #29
0
// ---------------------------------------------------------------------------
// 
// ---------------------------------------------------------------------------
//
void CAlfGc::DrawText(const TDesC& aText, const TAlfRealRect& aDestinationRect)
    {
        TPtrC8 ptr(reinterpret_cast<const TUint8 *>(aText.Ptr()), aText.Length()*2);                
        AppendCommand( EAlfCanvasPrepareDrawText, ptr );
        
        const TAlfCanvasDrawTextParams params = { 
            aDestinationRect.iTl.iX,
            aDestinationRect.iTl.iY,
            aDestinationRect.iBr.iX,
            aDestinationRect.iBr.iY
            };
        TPckgC<TAlfCanvasDrawTextParams> paramsPckg( params );                    
        AppendCommand( EAlfCanvasDrawText, paramsPckg );        
    }
// -----------------------------------------------------------------------------
// CWidgetUiObserver::NewDownloadL
// -----------------------------------------------------------------------------
//
TBool CWidgetUiObserver::NewDownloadL( TUint aTransactionID,
                                     const TDesC& aFileName,
                                     const TDesC& aContentType,
                                     const TDesC& aUrl )
    {
    (void)aTransactionID;
    (void)aFileName;
    (void)aContentType;
    (void)aUrl;
#ifdef _DEBUG
    _LIT(KNewDownload1L, "New Download with Trans ID %d, Local filename :%s:");
    _LIT(KNewDownload2L, "New Download with Trans ID %d, Content Type :%s:");
    _LIT(KNewDownload3L, "New Download with Trans ID %d, URL :%s:");

    if ( iCanLog )
        {
        iFileLogger.WriteFormat( KNewDownload1L, aTransactionID, aFileName.Ptr() );
        iFileLogger.WriteFormat( KNewDownload2L, aTransactionID, aContentType.Ptr() );
        iFileLogger.WriteFormat( KNewDownload3L, aTransactionID, aUrl.Ptr() );
        }
#endif

    return ETrue;
    }