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


C++ CCommsDbTableView::ReadTextL方法代码示例

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


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

示例1: TPtrC

TInt CCommDbTest036_03::executeStepL()
	{
	CCommsDbTemplateRecord* templateRecord = CCommsDbTemplateRecord::NewL(iTheDb, TPtrC(MODEM_BEARER));
	CleanupStack::PushL(templateRecord);
	
	User::LeaveIfError(templateRecord->Modify());

	TBufC<KCommsDbSvrMaxFieldLength> inputString = _L("string");
	templateRecord->WriteTextL(TPtrC(COMMDB_NAME), _L("DummyName"));
	templateRecord->WriteTextL(TPtrC(MODEM_PORT_NAME), inputString);
	User::LeaveIfError(templateRecord->StoreModifications());

	CleanupStack::PopAndDestroy(templateRecord);

	//Create a view on the modem table, make a new record and check the value is the one set for the template

	CCommsDbTableView* tableView = iTheDb->OpenTableLC(TPtrC(MODEM_BEARER));
	TUint32 dummyId;
	//Create a new record, so we can be sure it is the same as the templated one
	User::LeaveIfError(tableView->InsertRecord(dummyId));
	tableView->WriteTextL(TPtrC(COMMDB_NAME), _L("NewModem"));
	User::LeaveIfError(tableView->PutRecordChanges());

	//Retrieve the string we set for the template
	TBuf<KCommsDbSvrMaxFieldLength> retrievedString;
	tableView->ReadTextL(TPtrC(MODEM_PORT_NAME), retrievedString);
	CleanupStack::PopAndDestroy(tableView);

	if(retrievedString!=inputString)
		return KErrGeneral;

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

示例2: SetLocalIpAddrL

/**
 * Function that takes an IP address from user input, accesses the
 * Bluetooth PAN Profile table in the CommDb and updates the IpAddr
 * field with the supplied address.
 */		
void CPanConnections::SetLocalIpAddrL(TUint32 addr)
	{
	iLocalIpAddr = addr;
	iSrcAddr.SetAddress(iLocalIpAddr);
	CCommsDatabase* db = CCommsDatabase::NewL();
	CleanupStack::PushL(db);
	// Get the LAN service table
	CCommsDbTableView* tableView = db->OpenTableLC(TPtrC(LAN_SERVICE));

	TBuf<KMaxBufferSize> tableName;
	TInt err = tableView->GotoFirstRecord();
	if(err == KErrNone)
		{
		// Get the name of the table
		tableView->ReadTextL(TPtrC(COMMDB_NAME), tableName);
		if(tableName == TPtrC(_S("BluetoothPANProfile")))
			{
			TInetAddr tempAddr;
			TBuf<KMaxBufferSize> dispBuf;
			tempAddr.SetAddress(iLocalIpAddr);
			tempAddr.Output(dispBuf);
			
			User::LeaveIfError(tableView->UpdateRecord());	
			tableView->WriteTextL(_L("IpAddr"), dispBuf);
		
			User::LeaveIfError(tableView->PutRecordChanges());
			User::LeaveIfError(db->CommitTransaction());	
			}
		}
	else
		{
		User::Leave(KErrNotFound);
		}
	CleanupStack::PopAndDestroy(2);//db & tableView 
	}
开发者ID:huellif,项目名称:symbian-example,代码行数:40,代码来源:panconnection.cpp

示例3: ResolveIapL

// ---------------------------------------------------------------------------
// TIap::ResolveIapL
// ---------------------------------------------------------------------------
//  
TInt TIap::ResolveIapL( RArray<TIap>& aIapArray )
    {
    RDebug::Print( _L("TEST PRINT: CTestAppConsole::ResolveIapL -start\n") );
    
    TBuf<40> name;
    TUint32 iapid;

    CCommsDatabase* db = CCommsDatabase::NewL( EDatabaseTypeIAP );
    CleanupStack::PushL( db );
    CCommsDbTableView* view = db->OpenTableLC( TPtrC( IAP ) );

    TInt res = view->GotoFirstRecord();
    
    if ( res != KErrNone )
        {
        CleanupStack::PopAndDestroy( 2 ); // db, view
        RDebug::Print( _L("TEST PRINT: CTestAppConsole::ResolveIapL -end err: %d\n"), res );
        return res;
        }
    while ( res == KErrNone )  
        {
        view->ReadTextL( TPtrC( COMMDB_NAME ), name );
        view->ReadUintL( TPtrC( COMMDB_ID ), iapid );
        aIapArray.AppendL( TIap( iapid, name ) );
        res = view->GotoNextRecord();
        }
    CleanupStack::PopAndDestroy( 2 ); // db, view

    RDebug::Print( _L("TEST PRINT: CTestAppConsole::ResolveIapL -end" ) );
    return KErrNone;
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:35,代码来源:iap.cpp

示例4: GetGPRSIAPsFromIAPTableL

void CSymTorrentIAPSelectView::GetGPRSIAPsFromIAPTableL()
{ 
	TBuf<52> iapfromtable;
	TBuf<53> listItem;
	TInt err = KErrNone;
	
	CCommsDatabase* commsDB = CCommsDatabase::NewL(EDatabaseTypeIAP);
	CleanupStack::PushL(commsDB);

	// Open IAP table using the GPRS as the bearer.
	CCommsDbTableView* gprsTable = commsDB->OpenIAPTableViewMatchingBearerSetLC(ECommDbBearerGPRS,
		ECommDbConnectionDirectionOutgoing);
	// Point to the first entry
	User::LeaveIfError(gprsTable->GotoFirstRecord());
	gprsTable->ReadTextL(TPtrC(COMMDB_NAME), iapfromtable);
	listItem.SetLength(0);
	listItem.Append(_L("\t"));
	listItem.Append(iapfromtable);
	iContainer->AppendItemL(listItem);	
	
	TUint32 id;
	gprsTable->ReadUintL(TPtrC(COMMDB_ID), id);
	User::LeaveIfError(iIAPIDs.Append(id));

	while (err = gprsTable->GotoNextRecord(), err == KErrNone)
	{
		gprsTable->ReadTextL(TPtrC(COMMDB_NAME), iapfromtable);
		listItem.SetLength(0);
		listItem.Append(_L("\t"));
		listItem.Append(iapfromtable);
		iContainer->AppendItemL(listItem);
			
		TUint32 id;
		gprsTable->ReadUintL(TPtrC(COMMDB_ID), id);
		User::LeaveIfError(iIAPIDs.Append(id));
	}

	CleanupStack::PopAndDestroy(); // gprsTable
	CleanupStack::PopAndDestroy(); // commsDB
}
开发者ID:Nokia700,项目名称:SymTorrent,代码行数:40,代码来源:SymTorrentIAPSelectView.cpp

示例5: UpdateIAPListL

EXPORT_C void CPodcastModel::UpdateIAPListL()
	{
	iIapNameArray->Reset();
	iIapIdArray.Reset();	   

	CCommsDbTableView* table = iCommDB->OpenTableLC (TPtrC (IAP)); 
	TInt ret = table->GotoFirstRecord ();
	TPodcastIAPItem IAPItem;
	TBuf <KCommsDbSvrMaxFieldLength> bufName;
	while (ret == KErrNone) // There was a first record
		{
		table->ReadUintL(TPtrC(COMMDB_ID), IAPItem.iIapId);
		table->ReadTextL (TPtrC(COMMDB_NAME), bufName);
		table->ReadTextL (TPtrC(IAP_BEARER_TYPE), IAPItem.iBearerType);
		table->ReadTextL (TPtrC(IAP_SERVICE_TYPE), IAPItem.iServiceType);

		iIapIdArray.Append(IAPItem);
		iIapNameArray->AppendL(bufName); 		 
		ret = table->GotoNextRecord();
		}
	CleanupStack::PopAndDestroy(); // Close table
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:22,代码来源:PodcastModel.cpp

示例6: LockWLANAccessPointsL

// -----------------------------------------------------------------------------
// CCommsDatEnforcement::LockWLANAccessPointsL()
// -----------------------------------------------------------------------------
//
void CCommsDatEnforcement::LockWLANAccessPointsL( TBool aLockValue )
	{
	RDEBUG_2("CCommsDatEnforcement::LockAccessPoint( %d )", aLockValue );
	
	//Get WLAN service table and get ServiceID--> which is nothing but IAP ID and lock that record

	//TBool ret = EFalse;
	TUint32 apIAPID = 0;
		
    CCommsDbTableView*  checkView;
	CCommsDatabase* commsDataBase = CCommsDatabase::NewL();
	CleanupStack::PushL( commsDataBase );
    checkView = commsDataBase->OpenTableLC(TPtrC(IAP));
   	RDEBUG("		-> After opening IAP table ");
   	TBuf<KCommsDbSvrMaxFieldLength> serviceType;
    TInt error = checkView->GotoFirstRecord();
    RDEBUG("		-> After going to first record ");
    while (error == KErrNone)
        {
        RDEBUG("		-> KERRNONE ");
       		// Get the ID and check for service type
       	checkView->ReadTextL(TPtrC(IAP_SERVICE_TYPE), serviceType);
        if(serviceType == TPtrC(LAN_SERVICE))
            {
               	checkView->ReadUintL(TPtrC(COMMDB_ID), apIAPID);
               		RDEBUG_2("	->found %d WLAN AP. being protected or unprotected", apIAPID );
               	if(aLockValue)
               	{
               	((CCommsDbProtectTableView*)checkView)->ProtectRecord();
               	RDEBUG("		-> WLAN AP protected successfully!");	
               	}
               	else
               	{
               		((CCommsDbProtectTableView*)checkView)->UnprotectRecord();
               		RDEBUG("		-> WLAN AP UN protected successfully!");
               	}
               	
            }
            error = checkView->GotoNextRecord();
            
        }
    CleanupStack::PopAndDestroy(); // checkView

    CleanupStack::PopAndDestroy( commsDataBase );	


	}	
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:51,代码来源:CommsDatEnforcement.cpp

示例7: ConfigureIAPL

/**
 * Function that accesses the PAN Service Table in the CommsDb and configures
 * the IAP to the required settings.
 */		
void CPanConnections::ConfigureIAPL(TBool aIsListening, TBTDevAddr* aDevAddr, TBool aUsePANNotifier)
	{
	// Open CommDb and get a view of the PAN service extentions table.
	CCommsDatabase* db = CCommsDatabase::NewL();
	CleanupStack::PushL(db);
	CCommsDbTableView* tableView = db->OpenTableLC(TPtrC(PAN_SERVICE_EXTENSIONS));

	TBuf<KMaxBufferSize> tableName;
	TInt err = tableView->GotoFirstRecord();
	if(err == KErrNone)
		{
		tableView->ReadTextL(TPtrC(COMMDB_NAME), tableName);
		if(tableName == TPtrC(_S("PANServiceExtensionsTable1")))
			{
			
			User::LeaveIfError(tableView->UpdateRecord());// Start update
			//enable listening mode	
			tableView->WriteBoolL(TPtrC(PAN_ALLOW_INCOMING),aIsListening);
			tableView->WriteBoolL(TPtrC(PAN_DISABLE_SDP_QUERY), 0);

			tableView->WriteBoolL(TPtrC(PAN_PROMPT_FOR_REMOTE_DEVICES), aUsePANNotifier);

			if(aDevAddr)
				{
				TBuf<KMaxBufferSize> buf;
				aDevAddr->GetReadable(buf);

				tableView->WriteTextL(TPtrC(PAN_PEER_MAC_ADDRESSES), buf);
				}
			else
				{
				tableView->WriteTextL(TPtrC(PAN_PEER_MAC_ADDRESSES), _L(""));
				}
			// Finalise changes made.
			User::LeaveIfError(tableView->PutRecordChanges());// Finish update
			User::LeaveIfError(db->CommitTransaction());

			CleanupStack::PopAndDestroy(2); // db & tableView
			return;
			}
		}
	User::Leave(KErrNotFound);
	}
开发者ID:huellif,项目名称:symbian-example,代码行数:47,代码来源:panconnection.cpp

示例8: PrintIAPL

/**
 * Function that will access the PAN service table in the CommDb
 * and use the values contained to printout the current state.
 */		
void CPanConnections::PrintIAPL()
	{
	CCommsDatabase* db = CCommsDatabase::NewL();
	CleanupStack::PushL(db);
	CCommsDbTableView* tableView = db->OpenTableLC(TPtrC(PAN_SERVICE_EXTENSIONS));

	TInt err = tableView->GotoFirstRecord();
	
	if(err == KErrNone)
		{
		// Print the IAP
		TUint32 uVal;
		TBool bVal;
		TBuf<KMaxBufferSize> sVal;
	

		iConsole.Printf(_L("------------------- CURRENT IAP ------------------\n"));
		
		tableView->ReadUintL(TPtrC(PAN_LOCAL_ROLE), uVal);
		iConsole.Printf(_L("Local Role: %d, "), uVal);			
		tableView->ReadUintL(TPtrC(PAN_PEER_ROLE), uVal);
		iConsole.Printf(_L("Peer Role: %d\n"), uVal);
		tableView->ReadBoolL(TPtrC(PAN_PROMPT_FOR_REMOTE_DEVICES), bVal);
		iConsole.Printf(_L("Peer Prompt: %d, "), bVal);			
		tableView->ReadBoolL(TPtrC(PAN_DISABLE_SDP_QUERY), bVal);
		iConsole.Printf(_L("Disable SDP: %d, "), bVal);			
		tableView->ReadBoolL(TPtrC(PAN_ALLOW_INCOMING), bVal);
		iConsole.Printf(_L("Listening: %d\n"), bVal);			
		tableView->ReadTextL(TPtrC(PAN_PEER_MAC_ADDRESSES), sVal);
		iConsole.Printf(_L("Peer MAC Addr: %S\n"), &sVal);

		iConsole.Printf(_L("--------------------------------------------------\n"));
		CleanupStack::PopAndDestroy(2);
		return;
		}
	User::Leave(KErrNotFound);
	}
开发者ID:huellif,项目名称:symbian-example,代码行数:41,代码来源:panconnection.cpp

示例9: SetFixedRoleL

/**
 * Function that accesses the PAN Service table in the CommDb 
 * and applies the appropriate role, this function will be used for
 * local or peer as well as the PAN role (U or Gn).
 */	
void CPanConnections::SetFixedRoleL(TSide aSide, TUint aRole)
	{
	if (aSide == ELocalRole)
		iLocalRole = aRole;
	else
		iPeerRole = aRole;
	
	CCommsDatabase* db = CCommsDatabase::NewL();
	CleanupStack::PushL(db);
	CCommsDbTableView* tableView = db->OpenTableLC(TPtrC(PAN_SERVICE_EXTENSIONS));

	TBuf<KMaxBufferSize> tableName;
	TInt err = tableView->GotoFirstRecord();
	if(err == KErrNone)
		{
		tableView->ReadTextL(TPtrC(COMMDB_NAME), tableName);
		if(tableName == TPtrC(_S("PANServiceExtensionsTable1")))
			{
			User::LeaveIfError(tableView->UpdateRecord());	
			if(aSide == ELocalRole)
				{
				tableView->WriteBoolL(TPtrC(PAN_LOCAL_ROLE), aRole);
				}
			else 
				{
				tableView->WriteBoolL(TPtrC(PAN_PEER_ROLE), aRole);
				}
			User::LeaveIfError(tableView->PutRecordChanges());
			User::LeaveIfError(db->CommitTransaction());

			CleanupStack::PopAndDestroy(2);
			return;
			}
		}
	User::Leave(KErrNotFound);
	}
开发者ID:huellif,项目名称:symbian-example,代码行数:41,代码来源:panconnection.cpp

示例10: SelectIAP

TInt CConnectionManager::SelectIAP()
{
	CArrayFixFlat<TIapData>* iEApList=new (ELeave) CArrayFixFlat<TIapData>(2) ;
	TInt stack=0;
	// Make listitems. and PUSH it
	CAknSinglePopupMenuStyleListBox* list = new(ELeave) CAknSinglePopupMenuStyleListBox;
	CleanupStack::PushL(list);
	stack++; 
 
	// Create popup list and PUSH it.
	CAknPopupList* popupList = CAknPopupList::NewL(list,
		R_AVKON_SOFTKEYS_OK_CANCEL, AknPopupLayouts::EMenuWindow);
	CleanupStack::PushL(popupList);stack++; 
 
	CDesCArrayFlat* items = new (ELeave) CDesCArrayFlat(5);
	CleanupStack::PushL(items);stack++; 
	// initialize listbox.
	list->ConstructL(popupList, CEikListBox::ELeftDownInViewRect);
	list->CreateScrollBarFrameL(ETrue);
	list->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,
		CEikScrollBarFrame::EAuto);
 
 
	TBuf<52> iapfromtable;
	TInt err = KErrNone;
 
	CCommsDatabase* iCommsDB=CCommsDatabase::NewL(EDatabaseTypeIAP);
	CleanupStack::PushL(iCommsDB);stack++; 
#ifdef __SERIES60_3X__
	CCommsDbTableView* gprsTable = iCommsDB->OpenIAPTableViewMatchingBearerSetLC(
			iBearerFilter == EApBearerTypeWLAN 
				? ECommDbBearerWLAN 
				: ECommDbBearerGPRS|ECommDbBearerWLAN|ECommDbBearerVirtual,
		ECommDbConnectionDirectionOutgoing); 
#else
	CCommsDbTableView* gprsTable = iCommsDB->OpenIAPTableViewMatchingBearerSetLC(
		ECommDbBearerGPRS|ECommDbBearerVirtual,
		ECommDbConnectionDirectionOutgoing); 
#endif
	User::LeaveIfError(gprsTable->GotoFirstRecord());
	TInt i=0;
	TUint32 id;
	TIapData eap;	
 
	TInt cur =0; //current value
	do
	{
		gprsTable->ReadTextL(TPtrC(COMMDB_NAME), iapfromtable);
		gprsTable->ReadUintL(TPtrC(COMMDB_ID), id);
		items->AppendL(iapfromtable);
		eap.iIap = id;
		eap.iName.Copy(iapfromtable);
		iEApList->AppendL(eap);
 
		err = gprsTable->GotoNextRecord();
		i++;
	}
	while (err == KErrNone);
	CleanupStack::PopAndDestroy(2); stack--; 
 
	// Set listitems.
	CTextListBoxModel* model = list->Model();
	model->SetItemTextArray(items);
	model->SetOwnershipType(ELbmOwnsItemArray);
	CleanupStack::Pop();    
 
	popupList->SetTitleL(_L("Access Point"));
	list->SetListBoxObserver(popupList);
	TInt popupOk = popupList->ExecuteLD();
	CleanupStack::Pop();    
	TInt iap=0;
	if (popupOk)
	{	
		TInt index = list->CurrentItemIndex();
		iap=(*iEApList)[index].iIap;
 
	}
	CleanupStack::PopAndDestroy();  
	iEApList->Reset();
	delete iEApList;
	return iap;
}
开发者ID:addame,项目名称:rhodes,代码行数:82,代码来源:ConnectionManager.cpp


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