Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_MacResources Class Reference

A class to handle MacOS resources.

List of all members.

Public Member Functions

Constructor / Destructor
 CP_MacResources (CP_FileSystemSpec &inFileSpec, bool inOpen=true, bool inOpenReadOnly=true, bool inCloseOnDestruction=true)
 Constructor.
 CP_MacResources (const CP_MacResources &inMacResources)
virtual ~CP_MacResources () throw ()
 Destructor.
Current Resource File
void SaveCurrent ()
void MakeCurrent ()
void RestoreCurrent ()
Gettes
SInt16 GetRefNumber ()
SInt16 GetResourceCount (ResType inType)
SInt16 GetTypesCount ()
bool GetOneResource (ResType inType, SInt16 inID, bool inDetach, CP_HandleBlock &outResourceHandle)
bool GetOneIndResource (ResType inType, SInt16 inID, bool inDetach, CP_HandleBlock &outResourceHandle)
File
void Open ()
void Close ()
operators
CP_MacResourcesoperator= (const CP_MacResources &inMacResources)

Protected Attributes

CP_FileSystemSpec fFileSpec
SInt16 fResourceRefNumber
SInt16 fSavedResRefNum
bool fOpenReadOnly
bool fCloseOnDestruction


Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_MacResources::CP_MacResources CP_FileSystemSpec inFileSpec,
bool  inOpen = true,
bool  inOpenReadOnly = true,
bool  inCloseOnDestruction = true
 

Constructor.

Parameters:
inFileSpec File spec of the resources file.
inOpen Flag to indicate if the file should be opened immediately.
inOpenReadOnly Flag to indicate if the file opened as read only.
inCloseOnDestruction Flag to indicate if the file should be closed when this objects destructor is called.
Exceptions:
none 

CP_MacResources::CP_MacResources const CP_MacResources inMacResources  ) 
 

Copy constructor.

Parameters:
inMacResources The object to copy the data from.
Exceptions:
none 

CP_MacResources::~CP_MacResources  )  throw () [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

void CP_MacResources::SaveCurrent  ) 
 

Saved the current resource file ref number.

Exceptions:
none 
Returns:
void

void CP_MacResources::MakeCurrent  ) 
 

Make this file the current resource file, if it has been opened. Otherwise we do nothing.

Exceptions:
none 
Returns:
void

void CP_MacResources::RestoreCurrent  ) 
 

Restores the previously saved resource file.

Exceptions:
none 
Returns:
void

SInt16 CP_MacResources::GetRefNumber  ) 
 

Returns the resource ref number.

Exceptions:
none 
Returns:
SInt16 The resources ref number.

SInt16 CP_MacResources::GetResourceCount ResType  inType  ) 
 

Returns the count of the number of resources of the passed in ResType.

Parameters:
inType The ResType of the resource to return the count of.
Exceptions:
none 
Returns:
SInt16 The number of resources in the file.

SInt16 CP_MacResources::GetTypesCount  ) 
 

Returns the count of the types of resources in the file.

Exceptions:
none 
Returns:
SInt16 The number of resource types.

bool CP_MacResources::GetOneResource ResType  inType,
SInt16  inID,
bool  inDetach,
CP_HandleBlock outResourceHandle
 

Loads a single resource from the file, and returns true if able to load the resource.

Parameters:
inType The ResType of the resource to return load.
inID Resource ID of the resource to load.
inDetach Flag to indicate if the resource should be detached after loading.
outResourceHandle CP_HandleBlock to load the resource data into.
Exceptions:
none 
Returns:
bool Returns true if able to load the resource data.

bool CP_MacResources::GetOneIndResource ResType  inType,
SInt16  inID,
bool  inDetach,
CP_HandleBlock outResourceHandle
 

Loads a single resource from the file, and returns true if able to load the resource.

Parameters:
inType The ResType of the resource to return load.
inID Resource ID of the resource to load.
inDetach Flag to indicate if the resource should be detached after loading.
outResourceHandle CP_HandleBlock to load the resource data into.
Exceptions:
none 
Returns:
bool Returns true if able to load the resource data.

void CP_MacResources::Open  ) 
 

Open the resource file.

Exceptions:
none 
Returns:
void

void CP_MacResources::Close  ) 
 

Closes the resource file.

Exceptions:
none 
Returns:
void

CP_MacResources & CP_MacResources::operator= const CP_MacResources inMacResources  ) 
 

Assignment operator.

Parameters:
inMacResources Object to copy the resources data from.
Exceptions:
none 
Returns:
CP_MacResources& Returns a reference to ourselves.


Member Data Documentation

CP_FileSystemSpec CP_MacResources::fFileSpec [protected]
 

SInt16 CP_MacResources::fResourceRefNumber [protected]
 

File spec of the file being used.

SInt16 CP_MacResources::fSavedResRefNum [protected]
 

Resource reference number for the resource file.

bool CP_MacResources::fOpenReadOnly [protected]
 

Saved resource reference number.

bool CP_MacResources::fCloseOnDestruction [protected]
 

Flag to indicate if the file is opened read only.


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:01:49 2005 for CPLAT by  doxygen 1.4.0