本文整理汇总了C++中nsVoidArray::AppendElement方法的典型用法代码示例。如果您正苦于以下问题:C++ nsVoidArray::AppendElement方法的具体用法?C++ nsVoidArray::AppendElement怎么用?C++ nsVoidArray::AppendElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsVoidArray
的用法示例。
在下文中一共展示了nsVoidArray::AppendElement方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResolveEntries
void nsEudoraAddress::ResolveEntries( nsCString& name, nsVoidArray& list,
nsVoidArray& result, PRBool addResolvedEntries,
PRBool wasResolved, PRInt32& numResolved)
{
/* a safe-guard against recursive entries */
if (result.Count() > m_alias.Count())
return;
PRInt32 max = list.Count();
PRInt32 i;
CAliasData * pData;
CAliasEntry * pEntry;
for (i = 0; i < max; i++) {
pData = (CAliasData *)list.ElementAt( i);
// resolve the email to an existing alias!
if ( !name.Equals(pData->m_email, nsCaseInsensitiveCStringComparator()) &&
((pEntry = ResolveAlias( pData->m_fullEntry)) != nsnull) ) {
// This new entry has all of the entries for this puppie.
// Resolve all of it's entries!
numResolved++; // Track the number of entries resolved
// We pass in PR_TRUE for the 5th parameter so that we know that we're
// calling ourselves recursively.
ResolveEntries( pEntry->m_name, pEntry->m_list, result, addResolvedEntries, PR_TRUE, numResolved);
}
else if (addResolvedEntries || !wasResolved) {
// This is either an ordinary entry (i.e. just contains the info) or we were told
// to add resolved alias entries.
result.AppendElement( pData);
}
}
}
示例2: ResolveEntries
void nsEudoraAddress::ResolveEntries( nsCString& name, nsVoidArray& list, nsVoidArray& result)
{
/* a safe-guard against recursive entries */
if (result.Count() > m_alias.Count())
return;
PRInt32 max = list.Count();
PRInt32 i;
CAliasData * pData;
CAliasEntry * pEntry;
for (i = 0; i < max; i++) {
pData = (CAliasData *)list.ElementAt( i);
// resolve the email to an existing alias!
if (!name.Equals( pData->m_email,
nsCaseInsensitiveCStringComparator()) &&
((pEntry = ResolveAlias( pData->m_email)) != nsnull)) {
// This new entry has all of the entries for this puppie.
// Resolve all of it's entries!
ResolveEntries( pEntry->m_name, pEntry->m_list, result);
}
else {
result.AppendElement( pData);
}
}
}
示例3: PRUnichar
// helper function to perform an in-place split of a space-delimited string,
// and return an array of pointers for the beginning of each segment, i.e.,
// aOffset[0] is the first string, aOffset[1] is the second string, etc.
// Used to parse attributes like columnalign='left right', rowalign='top bottom'
static void
SplitString(nsString& aString, // [IN/OUT]
nsVoidArray& aOffset) // [OUT]
{
static const PRUnichar kNullCh = PRUnichar('\0');
aString.Append(kNullCh); // put an extra null at the end
PRUnichar* start = aString.BeginWriting();
PRUnichar* end = start;
while (kNullCh != *start) {
while ((kNullCh != *start) && nsCRT::IsAsciiSpace(*start)) { // skip leading space
start++;
}
end = start;
while ((kNullCh != *end) && (PR_FALSE == nsCRT::IsAsciiSpace(*end))) { // look for space or end
end++;
}
*end = kNullCh; // end string here
if (start < end) {
aOffset.AppendElement(start); // record the beginning of this segment
}
start = ++end;
}
}
示例4: WillModify
void
nsSVGPathSegList::AppendElement(nsIDOMSVGPathSeg* aElement)
{
WillModify();
NS_ADDREF(aElement);
mSegments.AppendElement((void*)aElement);
nsCOMPtr<nsISVGValue> val = do_QueryInterface(aElement);
if (val)
val->AddObserver(this);
DidModify();
}
示例5: RememberGroupMembers
//
// Since there is no way to check if a card for a given email address already exists,
// elements in 'membersArray' are make unique. So for each email address in 'emailList'
// we check it in 'membersArray' and if it's not there then we add it to 'membersArray'.
//
void nsEudoraAddress::RememberGroupMembers(nsVoidArray &membersArray, nsVoidArray &emailList)
{
PRInt32 cnt = emailList.Count();
CAliasData *pData;
for (PRInt32 i = 0; i < cnt; i++)
{
pData = (CAliasData *)emailList.ElementAt(i);
if (!pData)
continue;
PRInt32 memberCnt = membersArray.Count();
PRInt32 j = 0;
for (j = 0; j < memberCnt; j++)
{
if (pData == membersArray.ElementAt(j))
break;
}
if (j >= memberCnt)
membersArray.AppendElement(pData); // add to member list
}
}