本文整理汇总了C++中CCommsDbTableView类的典型用法代码示例。如果您正苦于以下问题:C++ CCommsDbTableView类的具体用法?C++ CCommsDbTableView怎么用?C++ CCommsDbTableView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CCommsDbTableView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: DEBUG
// ---------------------------------------------------------
// RHssInterface::CheckBackgroundScanL
// ---------------------------------------------------------
//
EXPORT_C TUint32 RHssInterface::CheckBackgroundScanL()
{
DEBUG( "RHssInterface::CheckBackgroundScanL()" );
CCommsDatabase* commDB = NULL;
CCommsDbTableView* table = NULL;
// Open commDB
commDB = CCommsDatabase::NewL();
CleanupStack::PushL( commDB );
table = commDB->OpenViewMatchingUintLC( KHssWlanDeviceSettings,
KHssWlanDeviceSettingsType,
KHssWlanUserSettings );
TInt err = table->GotoFirstRecord();
if ( err )
{
User::Leave( err );
}
TUint32 scanInterval;
table->ReadUintL( KHssBgScanInterval, scanInterval );
// cleanup
CleanupStack::PopAndDestroy( table );
CleanupStack::PopAndDestroy( commDB );
return (scanInterval);
}
示例3: __ASSERT_DEBUG
TBool CDefaultRecordAccess::OpenRecordL(CCommsDatabase* aDb, TUint32 aId)
/**
Close the view if there is one already open. If this has been overriden then use
the original ID given to us, if not, then use the new one. Open the view on the
table and position to the correct record.
@return if the record ID has changed, to notify client.
*/
{
__ASSERT_DEBUG(iName.Length() > 0, AgentPanic(Agent::EUnknownTableName));
CloseTable();
TBool ret=ETrue;
if (iId==aId || iOverridden) // if the ID's happen to be the same or the record is already overridden
ret=EFalse;
if (!iOverridden)
iId=aId;
if (iId == 0)
User::Leave(KErrNetConDatabaseDefaultUndefined);
CCommsDbTableView* table = aDb->OpenViewMatchingUintLC(iName,TPtrC(COMMDB_ID),iId);
User::LeaveIfError(table->GotoFirstRecord());
CleanupStack::Pop(); // table
iTable = table;
return ret;
}
示例4: __LOG8_1
// --------------------------------------------------------------------------
// UPnPAppSettingItemHomeIAP::CheckAPSecurity
// Checks if selected access point is unsecured and shows warning note
// --------------------------------------------------------------------------
//
TInt UPnPAppSettingItemHomeIAP::CheckAPSecurityL(TInt aAccessPoint)
{
__LOG8_1( "%s begin.", __PRETTY_FUNCTION__ );
TUint32 serviceId = 0;
TUint32 securityMode = 0;
CCommsDatabase* db = CCommsDatabase::NewL( EDatabaseTypeIAP );
CleanupStack::PushL( db );
CCommsDbTableView* view = db->OpenViewMatchingUintLC(TPtrC(IAP),
TPtrC(COMMDB_ID), aAccessPoint);
TInt error = view->GotoFirstRecord();
if( error == KErrNone )
{
view->ReadUintL(TPtrC(IAP_SERVICE), serviceId);
}
CCommsDbTableView* wLanServiceTable = NULL;
TRAPD(err,
{// this leaves if the table is empty....
wLanServiceTable = db->OpenViewMatchingUintLC(
TPtrC( WLAN_SERVICE ),
TPtrC( WLAN_SERVICE_ID ),
serviceId );
CleanupStack::Pop( wLanServiceTable );
});
示例5: AccessPointIdL
//=====================================================
// CNSmlProfileContentHandler::AccessPointIdL()
//
//
//=====================================================
TInt CNSmlProfileContentHandler::AccessPointIdL(TDesC& aBuf)
{
const TInt defConn = -2;
if (aBuf == _L("-1"))
{
return defConn; // return default connection always
}
CCommsDatabase *database = CCommsDatabase::NewL();
TUint32 aId ;
TInt retVal;
CleanupStack::PushL(database);
CCommsDbTableView* checkView;
checkView = database->OpenViewMatchingTextLC(TPtrC(IAP),TPtrC(COMMDB_NAME), aBuf);
TInt error = checkView->GotoFirstRecord();
if (error == KErrNone)
{
//Get the IAP ID
checkView->ReadUintL(TPtrC(COMMDB_ID), aId);
retVal = aId;
}
else
{
retVal = defConn;
}
CleanupStack::PopAndDestroy(2);
return retVal;
}
示例6: _L
// ---------------------------------------------------------------------------
// 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;
}
示例7: GetIapId
void CPodcastModel::GetProxyInformationForConnectionL(TBool& aIsUsed, HBufC*& aProxyServerName, TUint32& aPort)
{
TInt iapId = GetIapId();
CCommsDbTableView* table = iCommDB->OpenViewMatchingUintLC(TPtrC(IAP), TPtrC(COMMDB_ID), iapId);
TUint32 iapService;
HBufC* iapServiceType;
table->ReadUintL(TPtrC(IAP_SERVICE), iapService);
iapServiceType = table->ReadLongTextLC(TPtrC(IAP_SERVICE_TYPE));
CCommsDbTableView* proxyTableView = iCommDB->OpenViewOnProxyRecordLC(iapService, *iapServiceType);
TInt err = proxyTableView->GotoFirstRecord();
if( err != KErrNone)
{
User::Leave(KErrNotFound);
}
proxyTableView->ReadBoolL(TPtrC(PROXY_USE_PROXY_SERVER), aIsUsed);
if(aIsUsed)
{
HBufC* serverName = proxyTableView->ReadLongTextLC(TPtrC(PROXY_SERVER_NAME));
proxyTableView->ReadUintL(TPtrC(PROXY_PORT_NUMBER), aPort);
aProxyServerName = serverName->AllocL();
CleanupStack::PopAndDestroy(serverName);
}
CleanupStack::PopAndDestroy(proxyTableView);
CleanupStack::PopAndDestroy(iapServiceType);
CleanupStack::PopAndDestroy(table);
}
示例8: RDEBUG_2
// -----------------------------------------------------------------------------
// 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 );
}
示例9: 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);
}
示例10: 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
}
示例11: TPtrC
// -------------------------------------------------------------------------------------
// CNSmlDsProvisioningAdapter::GetDefaultIAPL()
// Gets the default NAPId
// -------------------------------------------------------------------------------------
TInt CNSmlDsProvisioningAdapter::GetDefaultIAPL()
{
TInt iapId = KErrNotFound;
CCommsDatabase* database = CCommsDatabase::NewL();
CleanupStack::PushL( database );
CCommsDbTableView* tableView = database->OpenTableLC( TPtrC( IAP ) );
TInt errorCode = tableView->GotoFirstRecord();
if ( errorCode == KErrNone )
{
TUint32 value;
tableView->ReadUintL( TPtrC( COMMDB_ID ), value );
iapId = value;
}
CleanupStack::PopAndDestroy( 2 ); // database, tableView
return iapId;
}
示例12: while
QList<XQAccessPoint> XQAccessPointManagerPrivate::accessPointsL() const
{
QList<XQAccessPoint> aps;
XQAccessPoint ap;
//open internet accesspoint table
CCommsDbTableView* pDbTView = ipCommsDB->OpenTableLC(TPtrC(IAP));
// Loop through all IAPs
TUint32 apId = 0;
TInt retVal = pDbTView->GotoFirstRecord();
while (retVal == KErrNone) {
pDbTView->ReadUintL(TPtrC(COMMDB_ID), apId);
ap = accessPointById(apId);
if (!ap.isNull()) {
aps << ap;
}
retVal = pDbTView->GotoNextRecord();
}
CleanupStack::PopAndDestroy(pDbTView);
return aps;
}
示例13: ConvertIAPNameToIdL
// -----------------------------------------------------------------------------
// COMASuplSettings::ConvertIAPNameToIdL
//
// -----------------------------------------------------------------------------
TBool COMASuplSettings::ConvertIAPNameToIdL(const TDesC& aIAPName, TUint32& aIAPId)
{
TBool result = EFalse;
CCommsDatabase* commDb = CCommsDatabase::NewL(EDatabaseTypeIAP);
CleanupStack::PushL(commDb);
CCommsDbTableView* tableView = commDb->OpenIAPTableViewMatchingBearerSetLC(ECommDbBearerCSD|ECommDbBearerGPRS,
ECommDbConnectionDirectionOutgoing);
TInt retval = tableView->GotoFirstRecord();
while ((retval == KErrNone) && (!result))
{
HBufC * iap_name = tableView->ReadLongTextLC( TPtrC( COMMDB_NAME) );
if (iap_name && (iap_name->Compare(aIAPName) == 0))
{
tableView->ReadUintL(TPtrC(COMMDB_ID), aIAPId);
result = ETrue;
}
CleanupStack::PopAndDestroy(); // iap_name
retval = tableView->GotoNextRecord();
}
CleanupStack::PopAndDestroy(2);//delete tableView and commDb
return result;
}
示例14: 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);
}
示例15: 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
}