Back to index

lightning-sunbird  0.9+nobinonly
Static Public Member Functions
AEListUtils Class Reference

#include <nsAEUtils.h>

List of all members.

Static Public Member Functions

static Boolean TokenContainsTokenList (const AEDesc *token)
static OSErr GetFirstNonListToken (const AEDesc *token, AEDesc *result)
static OSErr FlattenAEList (AEDescList *deepList, AEDescList *flatList)

Detailed Description

Definition at line 257 of file nsAEUtils.h.


Member Function Documentation

OSErr AEListUtils::FlattenAEList ( AEDescList *  deepList,
AEDescList *  flatList 
) [static]

Definition at line 499 of file nsAEUtils.cpp.

{
       OSErr         err = noErr;
       AEDesc        item   = {typeNull, nil};
       AEKeyword     keyword;
       long                 itemNum;
       long                 numItems;

       err = AECountItems(deepList, &numItems);
       if (err != noErr)
              goto CleanUp;
       
       for (itemNum = 1; itemNum <= numItems; itemNum++)
       {
              err = AEGetNthDesc(deepList, itemNum, typeWildCard, &keyword, &item);
              if (err != noErr)
                     goto CleanUp;
                     
              if (item.descriptorType == typeAEList)
                     err = FlattenAEList(&item, flatList);
              else
                     err = AEPutDesc(flatList, 0L, &item);
              
              if (err != noErr)
                     goto CleanUp;
                     
              AEDisposeDesc(&item);
       }

CleanUp:
       if (err != noErr)
              AEDisposeDesc(flatList);

       AEDisposeDesc(&item);
       
       return err;
}

Here is the call graph for this function:

OSErr AEListUtils::GetFirstNonListToken ( const AEDesc *  token,
AEDesc *  result 
) [static]

Definition at line 454 of file nsAEUtils.cpp.

{
       OSErr         err = noErr;
       AEDesc               tempToken = { typeNull, nil };
       AEKeyword     keyword;
       long                 numItems;
       long                 itemNum;
       
       if (result->descriptorType == typeNull)
       {
              if (TokenContainsTokenList(token) == false)
              {
                     err = AEDuplicateDesc(token, result);
              }
              else
              {
                     err = AECountItems(token, &numItems);
                     
                     for (itemNum = 1; itemNum <= numItems; itemNum++)
                     {
                            err = AEGetNthDesc((AEDescList *)token, itemNum, typeWildCard, &keyword, &tempToken);
                            if (err != noErr)
                                   goto CleanUp;
                                   
                            err = GetFirstNonListToken(&tempToken, result);                       
                            if ((err != noErr) || (result->descriptorType != typeNull))
                                   break;
                                   
                            AEDisposeDesc(&tempToken);
                     }
              }
       }
       
CleanUp:
       if (err != noErr)
              AEDisposeDesc(result);
              
       AEDisposeDesc(&tempToken);
       return err;
}

Here is the call graph for this function:

static Boolean AEListUtils::TokenContainsTokenList ( const AEDesc *  token) [inline, static]

Definition at line 261 of file nsAEUtils.h.

{ return (token->descriptorType == typeAEList); }

Here is the caller graph for this function:


The documentation for this class was generated from the following files: