Info-Mac Archive Downloads: dev/src/ SourceCode

Back to dev/src/ SourceCode

GLoAppFolder.sit - support for accessing application folder (glo-app-folder.hqx)

Download glo-app-folder.hqx (9,521 KB)


From: 3gl21@qlink.queensu.ca
Subject: GLoAppFolder.sit - support for accessing application folder


GLoAppFolder class
Copyright © 1997 Gregory Lo. All rights reserved.
Description:
This class provides some support for accessing files and
subfolders in the same folder as the application.

Notes:
Near the start of your application, just make a call to
GLoAppFolder::Startup(); This initializes a static FSSpec with the
location of your application.

Various calls are provided to create modified FSSpecs based on
this one; and open resource files in those places.

You can change the FSSpec using file or folder name strings from a
string list resource, or via a pointer to a pascal string. For
instance:

* osErr = GLoAppFolder::MakeFSSpec( "\pPlugins", myNewFSSpec );
* osErr = GLoAppFolder::MakeFSSpec( kFolderNamesID,
kPluginsFolderName, myNewFSSpec );

* refNum = GLoAppFolder::OpenResFile( "\pSounds", fsRdPerm );
* refNum = GLoAppFolder::OpenResFile( kFileNamesID,
kSoundsFileName, fsRdPerm );

Other information accessors are provided.

* vRefNum = GLoAppFolder::GetVolumeRefNum();
* parID = GLoAppFolder::GetParentID();

* myConstFSSpecPtr = GLoAppFolder::GetAppFileFSSpecPtr();
* myConstFSSpecRef = GLoAppFolder::GetAppFileFSSpec( void );

Change history:
04Nov1997 * Updated documentation
Contacting the Author:
email: * gregory-lo@usa.net
* 3gl21@qlink.queensu.ca (before May, 1998)
License:

License is given to freely use this in any of your code:
commercial, or otherwise. Send me a postcard or email if you do.
Copyright © 1997 Gregory Lo. All rights reserved.