本文整理汇总了C++中KNullDesC函数的典型用法代码示例。如果您正苦于以下问题:C++ KNullDesC函数的具体用法?C++ KNullDesC怎么用?C++ KNullDesC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了KNullDesC函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: type
EXPORT_C const TPtrC CUrl::Component(TComponent aType) const
{
TInt start = KCUrlInvalidCharPos;
TInt end = KCUrlInvalidCharPos;
TComponent type(aType);
if (aType == EUrlFileName)
type = EUrlPath;
Part(type, *iUrlDes, start,end);
if (start == KCUrlInvalidCharPos || end == KCUrlInvalidCharPos)
return KNullDesC();
TInt length = end - start +1;
if (end == (*iUrlDes).Length())
length--;
TPtrC component((*iUrlDes).Mid(start, length));
if (aType == EUrlFileName)
{
TInt slashPos = component.LocateReverse('/');
if (slashPos == KErrNotFound)
return KNullDesC();
else
component.Set(component.Right(component.Length() - (slashPos +1)));
}
return component;
}
示例2: _LIT
void UT_CPELogEvent::T_CPELogEvent_SaveL4L( )
{
TLogString test;
_LIT( KVoipAddress, "[email protected]" );
iMockContext->ExpectCallL( "CPELogInfo::CallState" ).
ReturnsL<TPEState>( EPEStateIdle );
iMockContext->ExpectCallL( "CPELogHandling::LogStringDelivery" ).
ReturnsL( test );
iMockContext->ExpectCallL( "CPELogHandling::LogStringMissed" ).
ReturnsL( test );
iMockContext->ExpectCallL( "CPELogInfo::PhoneNumberId" ).
ReturnsL( EPEUnknownNumber );
iMockContext->ExpectCallL( "CPELogInfo::EventType" ).
ReturnsL( CPELogInfo::EPEVideoCallEvent );
iMockContext->ExpectCallL( "CPELogInfo::CurrentLine" ).
ReturnsL( CCCECallParameters::ECCELineTypeAux );
iMockContext->ExpectCallL( "CPELogInfo::CallDirection" ).
ReturnsL( RMobileCall::EMobileTerminated ).
TimesL( 2 );
iMockContext->ExpectCallL( "CPELogInfo::Name" ).
ReturnsL( KNullDesC() );
iMockContext->ExpectCallL( "CPELogInfo::PhoneNumber" ).
ReturnsL( KNullDesC() );
iMockContext->ExpectCallL( "CPELogInfo::VoipAddress" ).
ReturnsL( KVoipAddress()).
TimesL( 2 );
iMockContext->ExpectCallL( "CPELogInfo::MyAddress" ).
ReturnsL( KNullDesC());
iMockContext->ExpectCallL( "CPELogInfo::Duration" ).
ReturnsL( 0 );
iMockContext->ExpectCallL( "CPELogInfo::ContactLink").
ReturnsL( KNullDesC() ).
TimesL( 4 );
iMockContext->ExpectCallL( "CPELogInfo::CallState" ).
ReturnsL<TPEState>( EPEStateIdle ).
TimesL( 2 );
iMockContext->ExpectCallL( "CPELogInfo::MissedCall" ).
ReturnsL( ETrue );
iMockContext->ExpectCallL( "CPELogHandlingCommand::AddEvent");
iCPELogEvent->SaveL();
EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() );
}
示例3: pLocation
void CEmTubePlaylistEntry::ImportL( RFileReadStream& aStream )
{
TInt l = aStream.ReadInt32L();
if( l )
{
iLocation = HBufC::NewL( l );
TPtr pLocation( iLocation->Des() );
aStream.ReadL( pLocation, l );
}
else
{
iLocation = KNullDesC().AllocL();
}
l = aStream.ReadInt32L();
if( l )
{
iName = HBufC::NewL( l );
TPtr pName( iName->Des() );
aStream.ReadL( pName, l );
}
else
{
iName = KNullDesC().AllocL();
}
iPlayCount = aStream.ReadInt32L();
iType = (TEmTubePlaylistEntryType)aStream.ReadInt32L();
TReal t = aStream.ReadReal64L();
iTime = TTime( Int64( t ) );
}
示例4: JELOG2
// -----------------------------------------------------------------------------
// CPIMAgnToDoAdapter::ExportItemL
// (other items were commented in a header)
// -----------------------------------------------------------------------------
//
void CPIMAgnToDoAdapter::ExportItemL(const MPIMToDoItem& aItem,
CCalEntry& aEntry, TBool aResetEntry)
{
JELOG2(EPim);
if (aResetEntry)
{
// Reset native entry for exporting new data
aEntry.SetSummaryL(KNullDesC());
aEntry.SetDescriptionL(KNullDesC());
aEntry.SetPriorityL(0);
aEntry.SetCompletedL(EFalse, aEntry.CompletedTimeL());
}
// Export item data to the native ToDo calendar entry
const MPIMItemData& itemData = aItem.ItemData();
CArrayFix<TPIMField>* fields = itemData.FieldsLC();
// Add default values to the calendar entry
AddDefaultValuesToEntryL(itemData, aEntry);
// Convert each field to the native ToDo calendar entry
TInt count = fields->Count();
for (TInt i = 0; i < count; i++)
{
TPIMToDoField field = static_cast<TPIMToDoField>(fields->At(i));
ConvertToAgnL(field, aEntry, itemData);
}
CleanupStack::PopAndDestroy(fields);
}
示例5: DLTRACEIN
void CNcdExtendedInstallInfo::ConstructL()
{
DLTRACEIN((""));
CNcdPurchaseInstallInfo::BaseConstructL();
iMimeType = KNullDesC().AllocL();
iParameter = KNullDesC().AllocL();
}
示例6: KNullDesC
// -----------------------------------------------------------------------------
// CProfileExtraTonesImpl::ConstructL
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CProfileExtraTonesImpl::ConstructL()
{
iIMMessageAlertTone = KNullDesC().AllocL();
iEmailAlertTone = KNullDesC().AllocL();
iVideoCallRingingTone = KNullDesC().AllocL();
iReminderTone = KNullDesC().AllocL();
iClockAlarmTone = KNullDesC().AllocL();
}
示例7: KNullDesC
void CBaseMrInfoObject::ConstructL()
{
iSubject = KNullDesC().AllocL();
iDescription = KNullDesC().AllocL();
iLocation = KNullDesC().AllocL();
iUid = KNullDesC().AllocL();
iOrganizer = CBaseMrAttendee::NewL();
}
示例8: KNullDesC
void CNcdNodeLink::ConstructL()
{
iParentIdentifier = CNcdNodeIdentifier::NewL();
iRequestParentIdentifier = CNcdNodeIdentifier::NewL();
iMetaDataIdentifier = CNcdNodeIdentifier::NewL();
iTimeStamp = KNullDesC().AllocL();
iCatalogsSourceName = KNullDesC().AllocL();
iServerUri = KNullDesC().AllocL();
iRemoteUri = KNullDesC().AllocL();
iMetadataTimeStamp = KNullDesC().AllocL();
}
示例9: RDEBUG
// ----------------------------------------------------------------------------------------
// CTerminalControlServer::StartProcessByFullNameL
// ----------------------------------------------------------------------------------------
void CTerminalControlServer::StartProcessByFullNameL ( const TDesC8& aName )
{
RDEBUG("CTerminalControlServer::StartProcessByFullNameL");
// 8bit to 16bit string
//
HBufC* fileNameBuf = HBufC::NewLC( aName.Length() );
TPtr fileName(fileNameBuf->Des());
fileName.Copy( aName );
// Connect to application architecture server
//
RApaLsSession apaLs;
User::LeaveIfError( apaLs.Connect() );
CleanupClosePushL( apaLs );
// Create command line for process
//
CApaCommandLine* cmd = CApaCommandLine::NewLC();
cmd->SetExecutableNameL( fileName );
cmd->SetDocumentNameL( KNullDesC() );
cmd->SetCommandL( EApaCommandRun );
// Start application
//
User::LeaveIfError( apaLs.StartApp( *cmd ) );
CleanupStack::PopAndDestroy( cmd );
CleanupStack::PopAndDestroy( &apaLs );
CleanupStack::PopAndDestroy( fileNameBuf );
}
示例10: _LIT
// -----------------------------------------------------------------------------
// CLibxml2Tester::CompressBufferGZIPL
// test GZIP Compress to buffer
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
TInt CLibxml2Tester::CompressBufferGZIPL(CStifItemParser& aItem)
{
_LIT(tem,"Error in code");
// resize heap
he = UserHeap::ChunkHeap(&KNullDesC(), 0, 20000000);
if(!he)
{
User::Leave(100);
}
oldHeap = User::SwitchHeap(he);// Change heaps
cleanup=CTrapCleanup::New();
//--
TInt trapResult;
// start trap
TRAP(trapResult,
TPtrC pInput;
aItem.GetNextString( pInput );
TPtrC pOutput;
aItem.GetNextString( pOutput );
HBufC8* bufferOutput = CnvUtfConverter::ConvertFromUnicodeToUtf8L(pOutput);
CleanupStack::PushL( bufferOutput );
TPtr8 pOutput8 = bufferOutput->Des();
HBufC8* buffer = ReadFileToBufferL( pInput );
CleanupStack::PushL( buffer );
// CVtcpBufferManager::NewL( in.Ptr() ,in.Length());
CTestBufferManager* bm = CTestBufferManager::NewLC( buffer->Ptr(), buffer->Size() );
CEZCompressor* compressor = CEZCompressor::NewLC( *bm );
// decompressor->DecompressL( pOutput8, buffer->Des() );
while ( compressor->DeflateL() )
{
/* empty */
}
TPtrC8 out=bm->OutputData();
RFs aRFs;
User::LeaveIfError(aRFs.Connect());
CleanupClosePushL(aRFs);
RFile fOut;
User::LeaveIfError ( fOut.Replace( aRFs, pOutput, EFileWrite ) );
CleanupClosePushL( fOut );
User::LeaveIfError ( fOut.Write(out ) );
//WriteFileFromBufferL(pOutput,out)
CleanupStack::PopAndDestroy( 6 );
);
示例11: TRAP
void T_CntImageRescaler::testEmptyArgs()
{
test.Next(_L("Empty arguments"));
TPath path;
TInt err;
TRAP(err, iRescaler->ResizeImageL(KNullDesC(), path));
test(err == KErrArgument);
TRAP(err, iRescaler->ResizeImageL(path, KNullDesC()));
test(err == KErrArgument);
TRAP(err, iRescaler->ResizeImageL(path, path));
test(err == KErrArgument);
}
示例12: iName
// ---------------------------------------------------------------------------
// Constructor
// ---------------------------------------------------------------------------
//
CConnMonWlanNetwork::CConnMonWlanNetwork(
const TBuf<KMaxNameLength>& aName,
TUint aConnectionMode,
TUint aSignalStrength,
TUint aSecurityMode,
TUint aSecurityModeV2,
TUint aProtectedSetupSupport,
const TBuf8<KWlanBssId>& aBssId,
const TDesC& aVendorData )
:
iName( aName ),
iConnectionMode( aConnectionMode ),
iSignalStrength( aSignalStrength ),
iSecurityMode( aSecurityMode ),
iWlanBssId( aBssId ),
iVendorData( NULL ),
iSecurityModeV2( aSecurityModeV2 ),
iProtectedSetupSupport( aProtectedSetupSupport )
{
if ( aVendorData != KNullDesC() && aVendorData.Length() > 0 )
{
// Can't leave here, copy contents only if enough memory
iVendorData = HBufC::New( aVendorData.Length() );
if ( iVendorData )
{
iVendorData->Des().Copy( aVendorData );
}
}
}
示例13: KNullDesC
TPtrC CPosLmNameIndex::CIndexItem::Name() const
{
if ( iName )
return *iName;
else
return KNullDesC();
}
示例14: DLTRACEIN
void CNcdNodeFolderProxy::InternalizeNodeSeenFolderL()
{
DLTRACEIN((""));
if ( iNodeSeenFolder )
{
iNodeSeenFolder->InternalizeL();
}
else
{
// Create the object.
// Get the handle at first.
TInt handle( 0 );
User::LeaveIfError(
ClientServerSession().SendSync(
NcdNodeFunctionIds::ENcdNodeSeenFolderHandle,
KNullDesC(),
handle,
Handle() ) );
DLINFO(( "handle: %d", handle ));
iNodeSeenFolder = CNcdNodeSeenFolderProxy::NewL(
ClientServerSession(), handle, *this );
}
}
示例15: new
// ---------------------------------------------------------------------------
// Copy Constructor
// ---------------------------------------------------------------------------
//
EXPORT_C CConnMonWlanNetwork* CConnMonWlanNetwork::NewL(
CConnMonWlanNetwork& aConnMonWlanNetwork )
{
CConnMonWlanNetwork* wlanNet;
if ( aConnMonWlanNetwork.iVendorData )
{
wlanNet = new( ELeave ) CConnMonWlanNetwork(
aConnMonWlanNetwork.iName,
aConnMonWlanNetwork.iConnectionMode,
aConnMonWlanNetwork.iSignalStrength,
aConnMonWlanNetwork.iSecurityMode,
aConnMonWlanNetwork.iSecurityModeV2,
aConnMonWlanNetwork.iProtectedSetupSupport,
aConnMonWlanNetwork.iWlanBssId,
aConnMonWlanNetwork.iVendorData->Des() );
}
else
{
wlanNet = new( ELeave ) CConnMonWlanNetwork(
aConnMonWlanNetwork.iName,
aConnMonWlanNetwork.iConnectionMode,
aConnMonWlanNetwork.iSignalStrength,
aConnMonWlanNetwork.iSecurityMode,
aConnMonWlanNetwork.iSecurityModeV2,
aConnMonWlanNetwork.iProtectedSetupSupport,
aConnMonWlanNetwork.iWlanBssId,
KNullDesC() );
}
return wlanNet;
}