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


C++ CArrayFixFlat类代码示例

本文整理汇总了C++中CArrayFixFlat的典型用法代码示例。如果您正苦于以下问题:C++ CArrayFixFlat类的具体用法?C++ CArrayFixFlat怎么用?C++ CArrayFixFlat使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: INFO_PRINTF1

/**
   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery5L
  
   @SYMPREQ 538
  
   @SYMTestCaseDesc Test the functionality of GetAppServicesL which gets all the service uids of a particular app 
   
   @SYMTestPriority 
  
   @SYMTestStatus Implemented
   
   @SYMTestActions Call GetAppServicesL with two parameters: the app uid and an array to put in the uid of the services 
   on z: drive.\n
   API Calls:\n	
   RApaLsSession::GetAppServicesL(TUid aAppUid, CArrayFixFlat<TUid>& aServiceUids) const
   
   @SYMTestExpectedResults Populates the array with the uids of the services offered by this particular app. 
   The returned data should be the same as that defined in the registration files. 
    
 */
void CT_ServicesTestStep::TestServiceDiscovery5L()
	{
	INFO_PRINTF1(_L("TestServiceDiscovery5 about to start..."));
	const TUid KUidServerApp = {0x10004c56};
	const TUid KUidService1234 = {0x01020304};
	const TUid KUidService2345 = {0x02030405};
	const TUid KUidService5678 = {0x05060708};
	const TUid KUidService = {0x01020333};
	// get UIDs of all services implemented by an app
	CArrayFixFlat<TUid>* uidArray = new(ELeave) CArrayFixFlat<TUid>(4);
	CleanupStack::PushL(uidArray);
	iApaLsSession.GetAppServicesL(KUidServerApp,*uidArray);
	TInt count = uidArray->Count();
	TUid uid;
	if(count>0)
		{
		TEST(count==6);	// Takes into account the open service
		uid = (*uidArray)[0];
		TEST(uid==KUidService);
		uid = (*uidArray)[1];
		TEST(uid==KUidService5678);
		uid = (*uidArray)[2];
		TEST(uid==KUidService5678);
		uid = (*uidArray)[3];
		TEST(uid==KUidService2345);
		uid = (*uidArray)[4];
		TEST(uid==KUidService1234);
		}
	CleanupStack::PopAndDestroy(uidArray);
	uidArray = NULL;
	}
开发者ID:fedor4ever,项目名称:default,代码行数:51,代码来源:T_ServicesStep.cpp

示例2: selectedOption

// -----------------------------------------------------------------------------
// CTestSDKQueries::TestLqdlgPublishDialogL
// -----------------------------------------------------------------------------
//
TInt CTestSDKQueries::TestLqdlgPublishDialogL( CStifItemParser& /*aItem*/ )
    {
    TInt selectedOption( KZero );
    
    CDesCArrayFlat* mArray = new (ELeave) CDesCArrayFlat(KTen);
    CleanupStack::PushL( mArray );
     
    TBuf< KTen > palabra;
    for (TInt num = KZero; num< KTen; num++)
        {
       palabra.Format(_L("option %d"), num);
       mArray->AppendL(palabra);
        }
     
    CAknListQueryDialog* dlg = new( ELeave ) CAknListQueryDialog( &selectedOption );
    dlg->PrepareLC( R_UPDATE_QUERY_MSG_DIALOG );
    dlg->SetItemTextArray( mArray );
    dlg->SetOwnershipType( ELbmDoesNotOwnItemArray );
    
    CArrayFixFlat< TInt >* selArray = new( ELeave )CArrayFixFlat< TInt >( KFive );
    CleanupStack::PushL( selArray );
    selArray->AppendL( KOne );
    selArray->AppendL( KThree );
    
    TInt err = KErrNone;
    TRAP( err, dlg->PublishDialogL( KOne, KNullUid, selArray ));
    
    CleanupStack::Pop( KOne );
    CleanupStack::PopAndDestroy( KTwo );
    return KErrNone;
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:35,代码来源:testsdkqueriesblockslistquerydlg.cpp

示例3: if

TUint32 CIkev2NatT::CheckPeerNotifysL(const CArrayFixFlat<TNotifPayloadIkev2*>& aNotifys, 
                                      const TInetAddr& aLocalAddr, const  TInetAddr& aRemoteAddr, TUint16 aPort, 
									  const TDesC8& aInitiatorSpi, const TDesC8& aResponderSpi, TBool& aSupported)
{    
  //
  // Check does there exists NAT_DETECTION_SOURCE_IP and NAT_DETECTION_DESTINATION_IP
  // Notify payload. If found compare payload data to local end NAT
  // traversal data as follows:
  // -- NAT_DETECTION_SOURCE_IP Notifys are examined against local Notify
  //    payload iDstIdentiy data: If no match found
  //    ==> Peer is behind  NAT
  // -- NAT_DETECTION_DESTINATION_IP Notify is examined against local Notify
  //    payload iSrcIdentiy data: If no match found
  //    ==> Local end behind NAT
  //
    aSupported = EFalse;
	TInt Count = aNotifys.Count();

	CIkev2NatT* RefObj = CIkev2NatT::NewL(aLocalAddr, aRemoteAddr, aPort, 
                                          aInitiatorSpi, aResponderSpi);
	 
	TNotifPayloadIkev2* PeerNotify;
	TUint32 PeerLth;
	TBool SrcMatch   = EFalse;
	TBool DstMatch   = EFalse;	
    TUint32 NatFlags = 0;
    TInt i = 0;

	while ( i < Count )
	{
		PeerNotify = aNotifys.At(i);
		if ( (PeerNotify->GetMsgType() == NAT_DETECTION_SOURCE_IP) && !SrcMatch )
		{
			NatFlags |= REMOTE_END_NAT;
			PeerLth = TPayloadIkev2::Cast(PeerNotify)->GetLength() - (TUint32)(PeerNotify->Size() + PeerNotify->GetSPISize());
			const TPtrC8 peerNotify(PeerNotify->NotifData(), PeerLth);
			if ( RefObj->DestinNofify().Compare(peerNotify) == 0)
			{
				SrcMatch  = ETrue;
				NatFlags &= ~REMOTE_END_NAT;
			}	
		}
		else if ( (PeerNotify->GetMsgType() == NAT_DETECTION_DESTINATION_IP) && !DstMatch )
		{
			aSupported = ETrue;						
			NatFlags  |= LOCAL_END_NAT;
			PeerLth = TPayloadIkev2::Cast(PeerNotify)->GetLength() - (TUint32)(PeerNotify->Size() + PeerNotify->GetSPISize()); 
			const TPtrC8 peerNotify(PeerNotify->NotifData(), PeerLth);
			if ( RefObj->SourceNofify().Compare(peerNotify) == 0 )
			{
				DstMatch  = ETrue;							
				NatFlags &= ~LOCAL_END_NAT;
			}	
		}			
	    i ++;
    }

	delete RefObj;	
    return NatFlags;     
}
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:60,代码来源:ikev2natt.cpp

示例4: LOG

TCertStatus CPolicyStore::PolicyCertificateStatusL(CIkeData* aIkeData) const
    {
    LOG(Log::Printf(_L("-> CPolicyStore::PolicyCertificateStatusL()")));
    TCertStatus status = ECertValid;

    CArrayFixFlat<TCertInfo*> *cAList = aIkeData->iCAList;
    if ((cAList == NULL || cAList->Count() == 0) && 
        !aIkeData->iOwnCert.iOwnCertExists)
        {
        status = ECertNotNeeded;
        }
    else
        {        
        RPKIServiceAPI pkiService;
        User::LeaveIfError(pkiService.Connect());
        CleanupClosePushL(pkiService);

        pkiService.SetInformational(ETrue);
                    
        CDesC8ArrayFlat* caSubjectNameArray = new (ELeave) CDesC8ArrayFlat(2);
        CleanupStack::PushL(caSubjectNameArray);                        
            
        if (cAList != NULL && cAList->Count() > 0)
            {                    
            status = PkiUtil::GetValidCaCertSubjectNameListL(pkiService, *cAList,
                                                             *caSubjectNameArray);        
            }
            
        if (status == ECertValid)
            {
			// Set store type to device store,
			// if Own_cert_type is defined as "DEVICE"            
			if ( aIkeData->iClientCertType != NULL )
			  	{
				TPtrC16 certStoreType = aIkeData->iClientCertType->GetData();
				if ( certStoreType.CompareF(_L("DEVICE")) == 0 )
					{
					LOG(Log::Printf(_L("Set store type to STORETYPE_DEVICE")));    
					pkiService.SetStoreType(EPkiStoreTypeDevice);            
					}
                else
                    {
					LOG(Log::Printf(_L("Set store type to STORETYPE_USER")));    
					pkiService.SetStoreType(EPkiStoreTypeUser);                                
                    }
				}
            else
                {
				LOG(Log::Printf(_L("Set store type to STORETYPE_USER")));    
				pkiService.SetStoreType(EPkiStoreTypeUser);                                                
                }
            status = PkiUtil::CheckUserCertValidityL(pkiService, *caSubjectNameArray,
                                                     aIkeData->iOwnCert);
            }
        CleanupStack::PopAndDestroy(caSubjectNameArray);
        CleanupStack::PopAndDestroy(); //pkiService            
        }
	LOG(Log::Printf(_L("<- CPolicyStore::PolicyCertificateStatusL()")));        
    return status;
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:60,代码来源:policystore.cpp

示例5: _LIT

// -----------------------------------------------------------------------------
// CTestSDKLists::TestSTXLBGetColorUseListL
// -----------------------------------------------------------------------------
//
TInt CTestSDKLists::TestSTXLBGetColorUseListL( CStifItemParser& /*aItem*/ )
    {
    // Print to UI
    _LIT( KTestModule, "EIKTXLBXTestModule" );
    _LIT( KTestEIKTXLBX, "In TestSTXLBGetColorUseListL" );
    TestModuleIf().Printf( 0, KTestModule, KTestEIKTXLBX );
    // Print to log file
    iLog->Log( KTestEIKTXLBX );

    TInt flags = CEikListBox::EIncrementalMatching |  EAknListBoxSelectionList | 
        EAknListBoxViewerFlags | CEikListBox::ELeftDownInViewRect;
    CDesCArray* textArray = iEikonEnvPointer->ReadDesCArrayResourceL( 
            R_TESTLIST_ITEM_SETTING );
    CleanupStack::PushL( textArray );

    CEikSnakingTextListBox* list = new( ELeave ) CEikSnakingTextListBox();
    CleanupStack::PushL( list );
    list->ConstructL( iContainer, flags );
    list->Model()->SetItemTextArray( textArray );
    list->Model()->SetOwnershipType( ELbmOwnsItemArray );
    iContainer->SetControlL( list );

    CArrayFixFlat<TCoeColorUse>* colorUseList = new( ELeave ) 
        CArrayFixFlat<TCoeColorUse>( KFour );
    CleanupStack::PushL( colorUseList );
    list->GetColorUseListL( *colorUseList );
    colorUseList->Reset();    
    CleanupStack::PopAndDestroy( colorUseList );

    iContainer->ResetControl();
    CleanupStack::Pop( 2 );

    return KErrNone;
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:38,代码来源:testsdklistsblockseiktxlbx.cpp

示例6: new

CGulIcon* CTap2MenuAppUi::LoadAppIconHard(TUid aUid)
	{
	RApaLsSession ls;
	ls.Connect();
	CGulIcon *retval = NULL;
	CArrayFixFlat<TSize> *array = new CArrayFixFlat<TSize>(3);
	CleanupStack::PushL(array);
	TInt err = ls.GetAppIconSizes(aUid, *array);
	if(err == KErrNone && array->Count() > 0)
		{
		CApaMaskedBitmap *bitmap = CApaMaskedBitmap::NewLC();
		err = ls.GetAppIcon(aUid, (*array)[0], *bitmap);
		if(err == KErrNone)
			{
			CFbsBitmap* bmp = new (ELeave) CFbsBitmap();
			CleanupStack::PushL(bmp);
			CFbsBitmap* bmp_mask = new (ELeave) CFbsBitmap();
			CleanupStack::PushL(bmp_mask);
			User::LeaveIfError(bmp->Create(bitmap->SizeInPixels(), bitmap->DisplayMode()));
			User::LeaveIfError(bmp_mask->Create(bitmap->Mask()->SizeInPixels(), bitmap->Mask()->DisplayMode()));
			CopyBitmapL(bitmap, bmp);
			CopyBitmapL(bitmap->Mask(), bmp_mask);
			retval = CGulIcon::NewL(bmp, bmp_mask);
			CleanupStack::Pop(2); // bmp, bmp_mask
			}
			CleanupStack::PopAndDestroy(bitmap);
		}
		CleanupStack::PopAndDestroy(array);
		ls.Close();
		return retval;
	}
开发者ID:kolayuk,项目名称:Tap2Menu,代码行数:31,代码来源:Tap2MenuAppUi.cpp

示例7: new

void CBCTestPtiEngine::TestLanguageL()
    {
    CArrayFixFlat<TInt>* langs = new (ELeave) CArrayFixFlat<TInt>(100);
    CleanupStack::PushL(langs);
    iEngine->GetAvailableLanguagesL(langs);

    AssertTrueL(langs->Count()>0, _L("available languages got"));
    CleanupStack::PopAndDestroy( 1 ); // cores, langs

    RArray<TInt> langRefs;
    iEngine->GetAvailableLanguagesL(langRefs);
    AssertTrueL(langRefs.Count()>0, _L("available languages got into RArray"));

    //
    //activate
    //
    if(langRefs.Count())
        {
        MPtiLanguage *lan = iEngine->GetLanguage(langRefs[0]);
        if (lan->HasInputMode(EPtiEngineMultitapping))
            {
            iEngine->ActivateLanguageL(lan->LanguageCode(), EPtiEngineMultitapping);
            AssertTrueL( ETrue, _L("activate multitapping"));
            }
        else
            {
            iEngine->ActivateLanguageL(lan->LanguageCode(), EPtiEnginePredictive);
            AssertTrueL( ETrue, _L("activate predictive"));
            }
        }

    langRefs.Close();
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:33,代码来源:bctestptiengine.cpp

示例8: new

CArrayFix<TCoeHelpContext>* CMobileOfficeAppUi::HelpContextL() const
{
	CArrayFixFlat<TCoeHelpContext>* array = new(ELeave)CArrayFixFlat<TCoeHelpContext>(1);
	CleanupStack::PushL(array);
	array->AppendL(TCoeHelpContext(KUidMobileOffice, _L("Introduction")));
	CleanupStack::Pop(array);
	return array;
}
开发者ID:bohwaz,项目名称:officereader,代码行数:8,代码来源:MobileOfficeAppUi.cpp

示例9: FLOG

void CFMSServer::CreateScheduledReminderL()
    {
    FLOG(_L("CFMSServer::CreateScheduledReminderL ()"));
    _LIT(KFotaScheduleExe, "Z:\\sys\\bin\\fotaschedulehandler.exe");

    RScheduler scheduler;
    TTsTime startTime;
    TTime time;
    time.HomeTime();
    time = time + (TTimeIntervalHours(1));
    startTime.SetLocalTime(time);

    User::LeaveIfError(scheduler.Connect());
    CleanupClosePushL(scheduler);
    //Creating a persistent daily schedule
    
    TSchedulerItemRef persistentScheduleItem;
    CArrayFixFlat<TScheduleEntryInfo2>* entries = new CArrayFixFlat<TScheduleEntryInfo2> (1);
    CleanupStack::PushL(entries);
    persistentScheduleItem.iName = TUid::Uid(KFMSServerUid).Name();

    //TScheduleEntryInfo2 scentry1(startTime, EDaily, 1, 1);
    TScheduleEntryInfo2 scentry1;
    scentry1.SetStartTime(startTime);
    scentry1.SetInterval(1);
    scentry1.SetIntervalType(TIntervalType(EHourly));
    scentry1.SetValidityPeriod((TTimeIntervalMinutes) 1440); //1440 min = 24 hrs or 1 day
    
    entries->AppendL(scentry1);

    scheduler.Register(TFileName( KFotaScheduleExe ), 0 );
    TInt ret = scheduler.CreatePersistentSchedule(persistentScheduleItem, *entries);

    FLOG(_L("created schedule %d  %d:%d"), persistentScheduleItem.iHandle,
            time.DateTime().Hour(), time.DateTime().Minute());

    if (ret == KErrNone)
        {
        TTaskInfo taskInfo;
        taskInfo.iName = TUid::Uid(KFMSServerUid).Name();
        taskInfo.iRepeat = 1; //Repeat once
        taskInfo.iPriority = 1;

        TFotaScheduledUpdate fotareminder(-1, -1);
        TPckg<TFotaScheduledUpdate> fotareminderpkg(fotareminder);

        HBufC* data = HBufC::NewLC(fotareminderpkg.Length());
        data->Des().Copy(fotareminderpkg);

        TInt err = scheduler.ScheduleTask(taskInfo, *data,  persistentScheduleItem.iHandle);

        FLOG(_L("Schedule creation error %d"), err);

        CleanupStack::PopAndDestroy(data);
        }
    CleanupStack::PopAndDestroy(entries);
    CleanupStack::PopAndDestroy(&scheduler); // xx
    }
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:58,代码来源:fmsserver.cpp

示例10: GetImageQualityLevelsL

// ---------------------------------------------------------------------------
// Get an array of image quality levels that are in use with the current
// product with given Camera/Display ID. If the ID is zero, then all levels
// dispite of the ID value are returned.
// ---------------------------------------------------------------------------
//
TInt CImagingConfigManager::GetImageQualityLevelsL(
                                        CArrayFixFlat<TUint>& aLevels,
                                        TUint /*aCameraDisplayID*/ )
    {
    aLevels.Reset();
    for( TInt i = 0 ; i < NumberOfImageQualityLevels() ; i++ )
        {
        aLevels.AppendL(
                iImageQualitySets->At( i ).iImageQualitySetLevel );
        }
    return KErrNone;
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:18,代码来源:imagingconfigmanager.cpp

示例11: new

// -----------------------------------------------------------------------------
// CTestSDKQueries::TestLqdlgConstructorLL
// -----------------------------------------------------------------------------
//
TInt CTestSDKQueries::TestLqdlgConstructorLL( CStifItemParser& /*aItem*/ )
    {
    CArrayFixFlat< TInt >* selArray = new( ELeave )CArrayFixFlat< TInt >( KFive );
    CleanupStack::PushL( selArray );
    selArray->AppendL( KOne );
    selArray->AppendL( KThree );
    CAknListQueryDialog* dlg = new( ELeave ) CAknListQueryDialog( selArray );
    CleanupStack::PushL( dlg );
    STIF_ASSERT_NOT_NULL( dlg );
    CleanupStack::PopAndDestroy( dlg );
    CleanupStack::Pop( selArray );
    return KErrNone;
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:17,代码来源:testsdkqueriesblockslistquerydlg.cpp

示例12: CloseArrayOfCallObjects

LOCAL_C void CloseArrayOfCallObjects(TAny* aCallArray)
/**
Close and delete the call object array.
*/
	{
	CArrayFixFlat<RMobileCall>* callArray = reinterpret_cast<CArrayFixFlat<RMobileCall>*>(aCallArray);
	TInt count = callArray->Count();
	for (TInt i=count-1; i>=0; --i)
		{
		callArray->At(i).Close();
		}	
	delete callArray;
 	callArray = NULL; 	
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:14,代码来源:TelephonyFuncLine.cpp

示例13: new

CArrayFix<TCoeHelpContext>* CRhodesAppUi::HelpContextL() const
	{
#warning "Please see comment about help and UID3..."
	// Note: Help will not work if the application uid3 is not in the
	// protected range.  The default uid3 range for projects created
	// from this template (0xE0000000 - 0xEFFFFFFF) are not in the protected range so that they
	// can be self signed and installed on the device during testing.
	// Once you get your official uid3 from Symbian Ltd. and find/replace
	// all occurrences of uid3 in your project, the context help will
	// work.
	CArrayFixFlat<TCoeHelpContext>* array = new(ELeave)CArrayFixFlat<TCoeHelpContext>(1);
	CleanupStack::PushL(array);
	array->AppendL(TCoeHelpContext(KUidRhodesApp, KGeneral_Information));
	CleanupStack::Pop(array);
	return array;
	}
开发者ID:bijukrishna,项目名称:rhodes,代码行数:16,代码来源:rhodesAppUi.cpp

示例14: changeLanguage

/*!
    \brief Returns names and identifiers of supported languages in a phone.
 
    Language names are localized according the language's native presentation.
    Language ID's returned by this functions may be used as language parameter for changeLanguage(int language) function.
    Language IDs and names are OS specific and may vary across the platforms and releases.
    
    \attention Symbian specific API
    
    \deprecated HbLanguageUtil::supportedLanguages()
        is deprecated. Please use HbLocaleUtil::supportedLanguages() instead.
     
    \return Symbian - localized names and integer identifiers of languages supported in a device  
    \return other platforms - empty QHash    
*/
QHash<int, QString> HbLanguageUtil::supportedLanguages()
{
#if defined(Q_OS_SYMBIAN)   
    QHash<int, QString> languages; 
    
    QTranslator translator;
    QString path = "c:";
    path += QString(TRANSLATOR_PATH);
    if (!translator.load(path)) {
        path = "z:";
        path += QString(TRANSLATOR_PATH);
        if (!translator.load(path)) {
            return languages;
        } 
    } 

    QCoreApplication::installTranslator(&translator);
    QHash<int, QString> hashLanguageNames = readLanguageList();
 
    CArrayFixFlat<TInt>* systemEpocLanguageCodes = 0;
    TInt error = SysLangUtil::GetInstalledLanguages( systemEpocLanguageCodes );
    if ( error != KErrNone ) {
        delete systemEpocLanguageCodes;
        return languages;
    }
    
    for (int i = 0; i < systemEpocLanguageCodes->Count(); ++i) {
        int code = systemEpocLanguageCodes->At(i);
        QString id = QString(LANGUAGE_ID_PREFIX);
        id += QString::number(code);
        QString locName = hbTrId(id.toAscii().constData());
        if (locName.isEmpty() || locName == id) {
            locName = hashLanguageNames.value(code);
        }
        languages.insert(code, locName);
    }
    
    delete systemEpocLanguageCodes;
    return languages;
#else 
    QHash<int, QString> dummy;
    return dummy;
#endif
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:59,代码来源:hblanguageutil.cpp

示例15: new

CArrayFix<TCoeHelpContext>* CHelloS60AppUi::HelpContextL() const
{
#warning "Please see comment about help and UID3..."
    // Note: Help will not work if the application uid3 is not in the
    // protected range.  The default uid3 range for projects created
    // from this template (0xE0000000 - 0xEFFFFFFF) are not in the protected range so that they
    // can be self signed and installed on the device during testing.
    // Once you get your official uid3 from Symbian Ltd. and find/replace
    // all occurrences of uid3 in your project, the context help will
    // work. Alternatively, a patch now exists for the versions of
    // HTML help compiler in SDKs and can be found here along with an FAQ:
    // http://www3.symbian.com/faq.nsf/AllByDate/E9DF3257FD565A658025733900805EA2?OpenDocument
    CArrayFixFlat<TCoeHelpContext>* array = new (ELeave) CArrayFixFlat<
    TCoeHelpContext> (1);
    CleanupStack::PushL(array);
    array->AppendL(TCoeHelpContext(KUidHelloS60App, KGeneral_Information));
    CleanupStack::Pop(array);
    return array;
}
开发者ID:AzagraMac,项目名称:hello-s60,代码行数:19,代码来源:HelloS60AppUi.cpp


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