本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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);
}