本文整理汇总了C++中CCommsDbTableView::ReadLongTextLC方法的典型用法代码示例。如果您正苦于以下问题:C++ CCommsDbTableView::ReadLongTextLC方法的具体用法?C++ CCommsDbTableView::ReadLongTextLC怎么用?C++ CCommsDbTableView::ReadLongTextLC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCommsDbTableView
的用法示例。
在下文中一共展示了CCommsDbTableView::ReadLongTextLC方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetProxyInformationForConnectionL
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);
}
示例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: 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;
}
示例4: GetProxy
bool GetProxy( char*& aHost, uint32& aPort, const int32 aIAP )
{
# ifdef NAV2_CLIENT_SERIES60_V2
CCommsDatabase * comdb = CCommsDatabase::NewL();
# else
CCommsDatabase * comdb = CCommsDatabase::NewL( EDatabaseTypeUnspecified );
# endif
CleanupStack::PushL( comdb );
// First get the IAP
CCommsDbTableView* iaptable = comdb->OpenViewMatchingUintLC( TPtrC( IAP ),
TPtrC( COMMDB_ID ), aIAP );
TInt iapres = iaptable->GotoFirstRecord();
bool found = false;
if ( iapres == KErrNone ) {
HBufC* iap_name = iaptable->ReadLongTextLC( TPtrC( COMMDB_NAME) );
uint32 iap_service = 0;
iaptable->ReadUintL( TPtrC( IAP_SERVICE ), iap_service );
// The current IAP exists!
HBufC* iap_type = iaptable->ReadLongTextLC( TPtrC( IAP_SERVICE_TYPE ) );
// Find Proxy for ISP (and same service type)
CCommsDbTableView* proxytable = comdb->OpenViewMatchingUintLC( TPtrC( PROXIES ),
TPtrC( PROXY_ISP ), iap_service );
TInt dretval= proxytable->GotoFirstRecord();
while ( dretval == KErrNone && !found ) {
// Check if matching proxy service type
HBufC* proxy_service_type = proxytable->ReadLongTextLC( TPtrC( PROXY_SERVICE_TYPE ) );
if ( proxy_service_type != NULL &&
proxy_service_type->CompareC( *iap_type ) == 0 )
{
// Match!
// PROXY_USE_PROXY_SERVER
TBool proxy_use_proxy_server = 0;
proxytable->ReadBoolL( TPtrC( PROXY_USE_PROXY_SERVER ), proxy_use_proxy_server );
# ifdef NAV2_CLIENT_SERIES60_V2
if ( proxy_use_proxy_server ) {
# endif
// PROXY_SERVER_NAME - Name of the proxy server
HBufC* proxy_server_name = proxytable->ReadLongTextLC(
TPtrC( PROXY_SERVER_NAME ) );
if ( proxy_server_name ) {
found = true;
// Convert to something we can use.
aHost = WFTextUtil::TDesCToUtf8L( proxy_server_name->Des() );
proxytable->ReadUintL( TPtrC( PROXY_PORT_NUMBER ), aPort );
// Sanity on port
if ( aPort == 9201 ) {
// We don't talk wap
// XXX: Or no proxy at all?
aPort = 8080;
} else if ( aPort == 0 ) {
// Not valid => no proxy
found = false;
delete [] aHost;
aHost = NULL;
}
} // End if have proxy_server_name
CleanupStack::PopAndDestroy( proxy_server_name );
# ifdef NAV2_CLIENT_SERIES60_V2
} // End if proxy_use_proxy_server is true
# endif
} // End if service type matches
CleanupStack::PopAndDestroy( proxy_service_type );
dretval = proxytable->GotoNextRecord(); // next proxy
} // End while all proxies
// XXX: Perhaps "IAP_SERVICE_TYPE" table -> [GPRS|ISP]_IP_GATEWAY
// especially in s60v1
CleanupStack::PopAndDestroy( proxytable );
CleanupStack::PopAndDestroy( iap_type );
CleanupStack::PopAndDestroy( iap_name );
} // End if the current IAP is found
CleanupStack::PopAndDestroy( iaptable );
CleanupStack::PopAndDestroy( comdb );
return found;
}
示例5: CompleteConstructionL
void CIAPSettingItem::CompleteConstructionL()
{
_LIT(KmRouter, "mroute");
CArrayPtr<CAknEnumeratedText> * iaps = new(ELeave) CArrayPtrSeg<CAknEnumeratedText>(10);
CleanupStack::PushL(iaps);
CArrayPtr<HBufC> * poppedUp = new(ELeave) CArrayPtrSeg<HBufC>(10);
CleanupStack::PushL(poppedUp);
CAknEnumeratedTextPopupSettingItem::CompleteConstructionL();
// The selection of IAP that indicates "always ask"
HBufC * buf;
buf = CEikonEnv::Static()->AllocReadResourceL( R_SETTINGS_IAP_ALWAYS_ASK );
iaps->AppendL(new(ELeave) CAknEnumeratedText(-1, buf ));
// The selection of IAP that indicates "system default is only shown in
// development mode, not in release mode.
if ( ! iRelease ) {
buf = CEikonEnv::Static()->AllocReadResourceL( R_SETTINGS_IAP_SYSTEM_DEFAULT );
iaps->AppendL(new(ELeave) CAknEnumeratedText(-2, buf ));
}
#ifdef NAV2_CLIENT_SERIES60_V2
CCommsDatabase * comdb = CCommsDatabase::NewL();
#else
CCommsDatabase * comdb = CCommsDatabase::NewL(EDatabaseTypeUnspecified);
#endif
CleanupStack::PushL(comdb);
CCommsDbTableView * iaptable = comdb->OpenTableLC( TPtrC( IAP ) );
TInt retval;
retval = iaptable->GotoFirstRecord();
// display all IAPs except mrouter
while (retval == KErrNone) {
HBufC * iap_name = iaptable->ReadLongTextLC( TPtrC( COMMDB_NAME) );
if ( KErrNotFound == iap_name->FindF(KmRouter) ) {
TUint32 iap_id;
iaptable->ReadUintL( TPtrC( COMMDB_ID), iap_id );
iaps->AppendL(new(ELeave) CAknEnumeratedText(iap_id, iap_name ));
}
CleanupStack::Pop(iap_name); // FIXME - Is this right? Does AppendL take over ownership of the iap name?
retval = iaptable->GotoNextRecord();
}
CleanupStack::PopAndDestroy(iaptable);
CleanupStack::PopAndDestroy(comdb);
SetEnumeratedTextArrays(iaps, poppedUp);
CleanupStack::Pop(poppedUp);
CleanupStack::Pop(iaps);
// Does the (old) specified iap still exist? Default to
// "always ask" otherwise.
if (IndexFromValue(ExternalValue()) < 0) {
SetInternalValue(-1);
SetExternalValue(-1);
}
}