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


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

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


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

示例1: TPtrC

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

	TUint32 inputInt = RMobileCall::KCapsSpeed32000;
	templateRecord->WriteTextL(TPtrC(COMMDB_NAME), _L("Name"));
	templateRecord->WriteTextL(TPtrC(ISP_IP_NAME_SERVER1),_L("MyDnsServer"));
	templateRecord->WriteBoolL(TPtrC(ISP_IP_ADDR_FROM_SERVER), ETrue);
	templateRecord->WriteBoolL(TPtrC(ISP_IP_DNS_ADDR_FROM_SERVER), ETrue);
	templateRecord->WriteBoolL(TPtrC(ISP_IP6_DNS_ADDR_FROM_SERVER), ETrue);
	templateRecord->WriteUintL(TPtrC(ISP_BEARER_SPEED), inputInt);
	User::LeaveIfError(templateRecord->StoreModifications());

	CleanupStack::PopAndDestroy(templateRecord);

	//Create a view on the DialInISP table, make a new record and change the value we set in the template
	CCommsDbTableView* tableView = iTheDb->OpenTableLC(TPtrC(DIAL_IN_ISP));
	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("Test ISP"));
	tableView->WriteBoolL(TPtrC(ISP_IP_ADDR_FROM_SERVER), EFalse);
	tableView->WriteBoolL(TPtrC(ISP_IP_DNS_ADDR_FROM_SERVER), EFalse);
	tableView->WriteBoolL(TPtrC(ISP_IP6_DNS_ADDR_FROM_SERVER), EFalse);
	//Overwrite value we set in the template
	TUint32 overwriteInt = RMobileCall::KCapsSpeed64000;
	tableView->WriteUintL(TPtrC(ISP_BEARER_SPEED), overwriteInt);
	User::LeaveIfError(tableView->PutRecordChanges());

	//Retrieve the TUint32 we just set
	TUint32 retrievedInt;
	tableView->ReadUintL(TPtrC(ISP_BEARER_SPEED), retrievedInt);

	TBuf16<KCommsDbSvrMaxFieldLength> ifAuthName(_L16("Invalid"));
	tableView->ReadTextL(TPtrC(ISP_IP_NAME_SERVER1), ifAuthName);
	if(ifAuthName.Compare(_L16("MyDnsServer")))
		{
		User::Leave(KErrGeneral);
		}

	CleanupStack::PopAndDestroy(tableView);

	if(retrievedInt!=overwriteInt)
		return KErrGeneral;

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

示例2: ret

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

	TBufC<KCommsDbSvrMaxFieldLength> inputString = _L("test string");
	templateRecord->WriteTextL(TPtrC(COMMDB_NAME), _L("Name"));
//	templateRecord->WriteTextL(TPtrC(ISP_IF_NAME), _L("SLIP"));
	templateRecord->WriteBoolL(TPtrC(ISP_IP_ADDR_FROM_SERVER), ETrue);
	templateRecord->WriteBoolL(TPtrC(ISP_IP_DNS_ADDR_FROM_SERVER), ETrue);
	templateRecord->WriteBoolL(TPtrC(ISP_IP6_DNS_ADDR_FROM_SERVER), ETrue);
	templateRecord->WriteLongTextL(TPtrC(ISP_LOGIN_SCRIPT), inputString);
	User::LeaveIfError(templateRecord->StoreModifications());

	CleanupStack::PopAndDestroy(templateRecord);

	//Create a view on the DialInISP table, make a new record and change the value we set int he template

	CCommsDbTableView* tableView = iTheDb->OpenTableLC(TPtrC(DIAL_IN_ISP));
	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("Test ISP"));
//	tableView->WriteTextL(TPtrC(ISP_IF_NAME), _L("Test If"));
	tableView->WriteBoolL(TPtrC(ISP_IP_ADDR_FROM_SERVER), EFalse);
	tableView->WriteBoolL(TPtrC(ISP_IP_DNS_ADDR_FROM_SERVER), EFalse);
	tableView->WriteBoolL(TPtrC(ISP_IP6_DNS_ADDR_FROM_SERVER), EFalse);
	//Overwrite value set above in template
	TBufC<KCommsDbSvrMaxFieldLength> overwriteString = _L("new string");
	tableView->WriteLongTextL(TPtrC(ISP_LOGIN_SCRIPT), overwriteString);
	User::LeaveIfError(tableView->PutRecordChanges());

	//Retrieve the string we just set
	HBufC* retrievedString = tableView->ReadLongTextLC(TPtrC(ISP_LOGIN_SCRIPT));

	TInt ret(KErrNone);
	if(*retrievedString!=overwriteString)
		ret= KErrGeneral;

	CleanupStack::PopAndDestroy();	//retrievedString
	CleanupStack::PopAndDestroy(tableView);

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

示例3: 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

示例4: 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


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