本文整理汇总了C++中CDesCArray::AppendL方法的典型用法代码示例。如果您正苦于以下问题:C++ CDesCArray::AppendL方法的具体用法?C++ CDesCArray::AppendL怎么用?C++ CDesCArray::AppendL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDesCArray
的用法示例。
在下文中一共展示了CDesCArray::AppendL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SplitText
CDesCArray* CCommonUtils::SplitText(const TDesC& aText,const char& aSplitChar)
{
CDesCArray* tmpArray = new(ELeave) CDesCArrayFlat(5);
CleanupStack::PushL(tmpArray);
TInt len = aText.Length();
TBuf<100> tmp;
for ( TInt i = 0; i < len ; i ++)
{
if(aText[i] == aSplitChar)
{
tmp.TrimAll();
tmpArray->AppendL(tmp);
tmp.Zero();
}
else
tmp.Append(aText[i]);
}
if (tmp.Length() > 0 )
{
tmp.TrimAll();
tmpArray->AppendL(tmp);
}
CleanupStack::Pop(tmpArray);
return tmpArray;
}
示例2: ShowSpreadWayfinderOptionsDialogL
void CSpreadWFDialogs::ShowSpreadWayfinderOptionsDialogL()
{
//Dialog that lets the user chose between contact bk search
//and entering a number manually.
CDesCArray* optionArray = new (ELeave) CDesCArrayFlat(2);
HBufC* option = CCoeEnv::Static()->AllocReadResourceLC(R_WF_OPTION_CONTACTS);
optionArray->AppendL(*option);
CleanupStack::PopAndDestroy(option);
option = CCoeEnv::Static()->AllocReadResourceLC(R_WF_OPTION_MANUALLY);
optionArray->AppendL(*option);
CleanupStack::PopAndDestroy(option);
TInt preSelIndex = iOptionsIndex;
typedef TCallBackEvent<CSpreadWFDialogs, TSpreadWFEvent> cb_t;
typedef CCallBackListDialog<cb_t> cbd_t;
cbd_t::RunDlgLD(cb_t(this,
ESpreadWFEventOptionsOk,
ESpreadWFEventOptionsCancel),
iOptionsIndex,
R_WF_SHARE_WAYFINDER,
optionArray,
R_WAYFINDER_CALLBACK_SINGLE_LIST_QUERY_OK_BACK,
EFalse,
preSelIndex);
}
示例3: AddItemL
void CMainMenuGridContainer::AddItemL(TInt aBitmapId, TInt aMaskId,
TInt aIndex)
{
CArrayPtr<CGulIcon>* icons =
iGrid->ItemDrawer()->FormattedCellData()->IconArray();
if (!icons) {
icons = new ( ELeave ) CAknIconArray(9);
iGrid->ItemDrawer()->FormattedCellData()->SetIconArrayL(icons);
}
CleanupStack::PushL(icons);
CFbsBitmap* bitmap;
CFbsBitmap* mask;
#ifdef NAV2_CLIENT_SERIES60_V3
AknIconUtils::CreateIconL(bitmap, mask, iView->GetMbmName(),
aBitmapId, aMaskId);
AknIconUtils::SetSize(bitmap, iIconRect.Size(),
EAspectRatioPreservedAndUnusedSpaceRemoved);
#else
bitmap = iEikonEnv->CreateBitmapL(iView->GetMbmName(), aBitmapId);
mask = iEikonEnv->CreateBitmapL(iView->GetMbmName(), aMaskId);
#endif
CleanupStack::PushL(bitmap);
CleanupStack::PushL(mask);
if (aIndex >= 0 && aIndex < icons->Count()) {
icons->InsertL(aIndex, CGulIcon::NewL(bitmap, mask));
} else {
icons->AppendL(CGulIcon::NewL(bitmap, mask));
}
CleanupStack::Pop(mask);
CleanupStack::Pop(bitmap);
CleanupStack::Pop(icons);
_LIT(KItem, "%d\t\t0");
TBuf<8> buf;
MDesCArray* array = iGrid->Model()->ItemTextArray();
CDesCArray* cArray = (CDesCArray*)array;
if (aIndex >= 0 && aIndex < icons->Count()) {
buf.Format(KItem, aIndex);
cArray->InsertL(aIndex, buf);
aIndex++;
//We need to delete and re-index the array since we inserted
//a new icon in the icon array.
cArray->Delete(aIndex, icons->Count() - aIndex);
for (TInt i = aIndex; i < icons->Count(); i++) {
buf.Format(KItem, i);
cArray->AppendL(buf);
}
} else {
buf.Format(KItem, (icons->Count() - 1));
cArray->AppendL(buf);
}
//Inform list box that data was added.
iGrid->HandleItemAdditionL();
}
示例4: ConstructL
void CCalendarSettingsQuery::ConstructL()
{
CALLSTACKITEM_N(_CL("CCalendarSettingsQuery"), _CL("ConstructL"));
iSelections = new (ELeave) CDesCArrayFlat(10);
auto_ptr<HBufC> text1( StringLoader::LoadL( R_TEXT_WELCOME_SHOW_TITLE_OF_EVENT ) );
auto_ptr<HBufC> text2( StringLoader::LoadL( R_TEXT_WELCOME_SHOW_BUSY_INSTEAD ) );
auto_ptr<HBufC> text3( StringLoader::LoadL( R_TEXT_WELCOME_DONT_SHARE_EVENTS ) );
iSelections->AppendL( *text1 );
iSelections->AppendL( *text2 );
iSelections->AppendL( *text3 );
}
示例5: doCreateDefaultCDesCArrayL
CDesCArray* CPackagerCntFactory::doCreateDefaultCDesCArrayL() const
/** Implementation method for constructing a new default CDesCArray object.
@return a Pointer to the CDesCArray object. */
{
CDesCArray* theTestArray = new(ELeave) CDesCArrayFlat(5);
CleanupStack::PushL(theTestArray);
theTestArray->AppendL(KContactItemCompanyName);
theTestArray->AppendL(KContactItemFamilyName);
theTestArray->AppendL(KContactItemGivenName);
theTestArray->AppendL(KContactItemFirstPhoneNumber);
theTestArray->AppendL(KContactItemSecondPhoneNumber);
CleanupStack::Pop(theTestArray);
return theTestArray;
}
示例6: AddFormattedListBoxItemL
void CSearchableListBoxContainer::AddFormattedListBoxItemL( const TDesC& aString )
{
CTextListBoxModel* model = iListBox->Model();
CDesCArray* itemArray = static_cast< CDesCArray* > ( model->ItemTextArray() );
itemArray->AppendL( aString );
iListBox->HandleItemAdditionL();
}
示例7: GetFreeTextForObjectL
void CMdSFindSequence::GetFreeTextForObjectL( CDesCArray& aResultWordBuffer,
TDefId aNamespaceDefId, TItemId aObjectId )
{
_LIT( KMdSFindSeqWords, "SELECT Word FROM TextSearch%u AS ts, TextSearchDictionary%u AS tsd ON tsd.WordId = ts.WordId WHERE ObjectId = ? ORDER BY Position ASC;" );
CMdsClauseBuffer* buffer = CMdsClauseBuffer::NewLC( KMdSFindSeqWords.iTypeLength + 20 ); // two int
buffer->BufferL().Format( KMdSFindSeqWords, aNamespaceDefId, aNamespaceDefId );
CMdSSqLiteConnection& connection = MMdSDbConnectionPool::GetDefaultDBL();
RRowData data;
CleanupClosePushL( data );
data.AppendL( TColumn( aObjectId ) );
RMdsStatement query;
CleanupClosePushL( query );
connection.ExecuteQueryL( buffer->ConstBufferL(), query, data );
TPtrC16 word;
data.Column(0).Set( word );
while (connection.NextRowL(query, data))
{
data.Column(0).Get( word );
aResultWordBuffer.AppendL( word );
data.Free();
}
CleanupStack::PopAndDestroy( 3, buffer ); // query, data, buffer
}
示例8: GetTestCaseNames
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
TInt CSymbianUnitTestLddCtl::GetTestCaseNames(CDesCArray& aTestCaseNames)
{
TInt ret = iLddconn.Open(*iDriverName);
if (ret != KErrNone)
{
return ret;
}
SUT_LOG_DEBUG("open ldd");
TInt count;
ret = iLddconn.GetTestCaseCount(&count);
SUT_LOG_DEBUGF(_L("user space, test case count:%d"), count);
if (ret != KErrNone)
{
return ret;
}
for (TInt i = 0; i < count; i++)
{
TBuf8<KTestCaseNameLength> testCaseName;
ret = iLddconn.GetTestCaseName(&i, (TAny*) &testCaseName);
if (ret != KErrNone)
{
return ret;
}
TBuf<KTestCaseNameLength> testCaseName16;
testCaseName16.Copy(testCaseName);
aTestCaseNames.AppendL(testCaseName16);
}
iLddconn.Close();
SUT_LOG_DEBUG("close ldd");
return KErrNone;
}
示例9: GetAllRulesL
// ---------------------------------------------------------------------------
// CPresenceXDM::GetAllRulesL()
// ---------------------------------------------------------------------------
//
EXPORT_C void CPresenceXDM::GetAllRulesL(CDesCArray& aRuleIds)
{
OPENG_DP(D_OPENG_LIT( "CPresenceXDM::GetAllRulesL" ) );
CXdmDocumentNode* myRootNode = iPresDocument->DocumentRoot();
if (!myRootNode)
return;
RPointerArray<CXdmDocumentNode> nodes;
CXdmNodeAttribute* idAttribute(NULL);
// Find all rules under root
if ((myRootNode->Find(KXdmRule, nodes)) == KErrNone)
{ // go through all found rules
TInt ruleCountInNode = nodes.Count();
OPENG_DP(D_OPENG_LIT( " ruleCountInNode = %d" ),ruleCountInNode );
for (TInt i=0;i<ruleCountInNode;i++)
{ // get the id attribute
idAttribute = (nodes[i])->Attribute(KXdmId);
// push it to given discriptor array
aRuleIds.AppendL(idAttribute->AttributeValue());
}
}
nodes.Close();
return;
}
示例10: AddToTheListL
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CCrashContainer::AddToTheListL(const TDesC& aName,const TExitType& aExitType,const TInt& aExitReason,const TDesC& aExitCategory,CDesCArray& aItemArray)
{
TBuf<500> AddBuffer(_L("\t"));
AddBuffer.Append(aName);
AddBuffer.Append(_L("\t"));
switch(aExitType)
{
case EExitKill:
AddBuffer.Append(_L("Kill: "));
break;
case EExitTerminate:
AddBuffer.Append(_L("Terminate: "));
break;
case EExitPanic:
AddBuffer.Append(_L("Panic: "));
break;
case EExitPending:
AddBuffer.Append(_L("Pend: "));
break;
}
AddBuffer.AppendNum(aExitReason);
AddBuffer.Append(_L(","));
AddBuffer.Append(aExitCategory);
aItemArray.AppendL(AddBuffer);
}
示例11: Show
TInt CFileSelectDialog::Show()
{
_LOG(_L("CFileSelectDialog::Show()"));
TInt sel=0;
CDesCArray* itemList = new (ELeave) CDesCArrayFlat(3);
if (iCurrentPath.Compare(_L(""))!=0){if (iType==EFolder){iArray->InsertL(0,_L("Select folder"));}iArray->InsertL(0,_L("..."));}
_LOGDATA(_L("Length of array: %d"),iArray->Count());
for (TInt i=0;i<iArray->Count();i++)
{
TBuf<255> ItemTxt;
ItemTxt.Copy(_L("0\t"));
ItemTxt.Append(iArray->MdcaPoint(i));
ItemTxt.Append(_L("\t\t"));
itemList->AppendL(ItemTxt);
_LOGDATA(_L("Item: %S"),&iArray->MdcaPoint(i));
}
_LOG(_L("Will create dialog"));
SetItemTextArray(itemList);
ListBox()->HandleItemAdditionL();
Layout();
ListBox()->SetCurrentItemIndex(0);
ListBox()->DrawNow();
DrawDeferred();
}
示例12: GetManyIdentityElementsL
// ---------------------------------------------------------------------------
// TPresCondIdentityMany::GetManyIdentityElementsL()
// ---------------------------------------------------------------------------
//
EXPORT_C TInt TPresCondIdentityMany::GetManyIdentityElementsL(const TDesC& aRuleID,
CDesCArray& aDomains)
{
OPENG_DP(D_OPENG_LIT( "TPresCondIdentityMany::GetManyIdentityElementsL()" ) );
OPENG_DP(D_OPENG_LIT( " aRuleID = %S" ),&aRuleID);
__ASSERT_ALWAYS(iPresXDM, User::Leave(KErrNotReady));
CXdmDocumentNode* identityNode = iPresXDM->GetConditionChildNodeL(aRuleID,
KXdmIdentity, EFalse);
if(identityNode==NULL)
return 0;
RPointerArray<CXdmDocumentNode> nodes;
CXdmNodeAttribute* domainAttr(NULL);
// finding 'many' nodes
TInt err = identityNode->Find(KXdmMany, nodes);
// extracting entities from id nodes
TInt manyCountInNode = nodes.Count();
OPENG_DP(D_OPENG_LIT( " manyCountInNode = %d" ),manyCountInNode);
for (TInt i=0; i<manyCountInNode; i++)
{ // get the domain attribute
domainAttr = (nodes[i])->Attribute(KXdmDomain);
if(domainAttr)
// push it to given discriptor array
aDomains.AppendL(domainAttr->AttributeValue());
}
nodes.Close();
return manyCountInNode;
}
示例13: GetAvailableHeightsInTwipsAndPointsL
EXPORT_C TInt FontUtils::GetAvailableHeightsInTwipsAndPointsL(const CGraphicsDevice& aDevice,const TDesC& aTypefaceName,CArrayFix<TInt>& aTwipsList,CDesCArray& aPointsList)
/** Gets a list of all heights in twips, available for the named typeface and the
graphics device specified.
Also gets a list of heights in points, represented as character strings.
@param aDevice The graphics device.
@param aTypefaceName The name of the typeface.
@param aTwipsList On return, contains all available heights for the typeface,
in twips.
@param aPointsList On return, the heights in points, represented as character
strings.
@return KErrNotSupported if the named typeface is not supported by the graphics
device, otherwise KErrNone. */
{ // static
aTwipsList.Reset();
aPointsList.Reset();
TInt err=GetAvailableHeightsInTwipsL(aDevice,aTypefaceName,aTwipsList);
if (err==KErrNotSupported)
return err;
const TInt count=aTwipsList.Count();
for (TInt ii=0;ii<count;ii++)
{
const TInt points=PointsFromTwips(aTwipsList[ii]);
if (points<EMinFontHeight)
continue;
TBuf<8> num;
num.Num(points);
aPointsList.AppendL(num);
}
return KErrNone;
}
示例14: ListDatabasesLC
// ---------------------------------------------------------
// CPosLmDatabaseManagerImpl::ListDatabasesLC
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
CDesCArray* CPosLmDatabaseManagerImpl::ListDatabasesLC(
const TDesC& aProtocol)
{
CDesCArray* resultList = NULL;
if (aProtocol == KNullDesC)
{
TInt pluginCount = iPlugins->NumberOfInstances();
for (TInt i = 0; i < pluginCount; i++)
{
if (i == 0)
{
resultList = iPlugins->GetInstanceAt(i)->ListDatabasesLC();
}
else
{
CDesCArray* dbList =
iPlugins->GetInstanceAt(i)->ListDatabasesLC();
TInt dbCount = dbList->Count();
for (TInt j = 0; j < dbCount; j++)
{
resultList->AppendL((*dbList)[j]);
}
CleanupStack::PopAndDestroy(dbList);
}
}
}
else
{
CPosLmDatabaseManagerPluginBase* plugin =
iPlugins->GetInstanceL(aProtocol);
resultList = plugin->ListDatabasesLC();
}
return resultList;
}
示例15: GetAvailableFontsL
EXPORT_C void FontUtils::GetAvailableFontsL(const CGraphicsDevice& aDevice, CDesCArray& aFontNameList,TInt aFonts)
/** Gets the list of typeface names available for the graphics device.
@param aDevice The graphics device.
@param aFontNameList On return, contains the list of typeface names.
@param aFonts Can be used to specify which sorts of typefaces are required.
For possible values, see the flags defined in gulftflg.hrh
beginning with EGulAllFonts. */
{ // static
aFontNameList.Reset();
const TInt numTypefaces=aDevice.NumTypefaces();
TTypefaceSupport typefaceInfo;
for (TInt ii=0;ii<numTypefaces;ii++)
{
aDevice.TypefaceSupport(typefaceInfo,ii);
if (typefaceInfo.iTypeface.IsProportional())
{
if (aFonts==EGulMonospaceFontsOnly)
continue;
}
else if (aFonts==EGulNoMonospaceFonts || aFonts==EGulNoMonospaceOrSymbolFonts)
continue;
if (typefaceInfo.iTypeface.IsSymbol())
{
if (aFonts==EGulNoSymbolFonts || aFonts==EGulNoMonospaceOrSymbolFonts || aFonts==EGulMonospaceFontsOnly)
continue;
}
else if (aFonts==EGulSymbolFontsOnly)
continue;
aFontNameList.AppendL(typefaceInfo.iTypeface.iName);
}
}