Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
nsAppleSingleEncoder.cpp File Reference
#include "nsAppleSingleEncoder.h"
#include <Files.h>
#include <OSUtils.h>
#include "nsAppleSingleDecoder.h"
#include "MoreFilesExtras.h"
#include "IterateDirectory.h"

Go to the source code of this file.

Defines

#define BUFSIZE   8192

Functions

pascal void EncodeDirIterateFilter (const CInfoPBRec *const cpbPtr, Boolean *quitFlag, void *yourDataPtr)

Define Documentation

#define BUFSIZE   8192

Definition at line 384 of file nsAppleSingleEncoder.cpp.


Function Documentation

pascal void EncodeDirIterateFilter ( const CInfoPBRec *const  cpbPtr,
Boolean quitFlag,
void yourDataPtr 
)

Definition at line 140 of file nsAppleSingleEncoder.cpp.

{      
       OSErr                              err = noErr;
       FSSpec                                    currFSp;
       nsAppleSingleEncoder*       thisObj = NULL;
       Boolean                                   isDir = false;
       long                               dummy;
       
       // param check
       if (!yourDataPtr || !cpbPtr || !quitFlag)
              return;
       
       *quitFlag = false;
              
       // extract 'this' -- an nsAppleSingleEncoder instance
       thisObj = (nsAppleSingleEncoder*) yourDataPtr;
       thisObj->ReInit();
       
       // make an FSSpec from the CInfoPBRec*
       err = FSMakeFSSpec(cpbPtr->hFileInfo.ioVRefNum, cpbPtr->hFileInfo.ioFlParID, 
                                          cpbPtr->hFileInfo.ioNamePtr, &currFSp);
       if (err == noErr)
       {
              FSpGetDirectoryID(&currFSp, &dummy, &isDir);
              
              // if current FSSpec is file
              if (!isDir)
              {
                     // if file has res fork
                     if (nsAppleSingleEncoder::HasResourceFork(&currFSp))
                     {
                            // encode file
                            thisObj->Encode(&currFSp);
                     }
              }
              else
              {
                     // else if current FSSpec is folder ignore
                     // XXX never reached?
                     return;
              }
       }
}

Here is the call graph for this function:

Here is the caller graph for this function: