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

CP_Bundle Class Reference

Inheritance diagram for CP_Bundle:

CP_CFBundle List of all members.

Public Member Functions

OSType GetPackageCreator () const
 Get the creator signature for the bundle.
OSType GetPackageType () const
 Get the package type for the bundle.
CP_FileSystemSpec GetBundleFileSpec () const
 Get the bundle's location on disk.
CP_FileSystemSpec GetBundleExecutableFileSpec () const
 Locate the bundle's executable on disk.
CP_String GetShortVersionString () const
 Get the short version string from the bundle's Info dictionary.
UInt32 GetVersionNumber () const
 Get the bundle version as a number.
CP_String GetCopyrightString () const
 Get the copyright notice from the bundle's Info dictionary.
CP_String GetIdentifier () const
 Get the bundle identifier.
CP_FileSystemSpec LocateResourcesFolder () const
 Locate the resources folder inside the bundle.
CP_FileSystemSpec LocatePluginsFolder () const
 Locate the plug ins folder inside the bundle.
CP_FileSystemSpec LocateSharedSupportFolder () const
 Locate the shared support folder inside the bundle.
CP_FileSystemSpec LocateContentsFolder () const
 Locate the contents folder inside the bundle.
CP_FileSystemSpec LocateResourceFile (const CP_String &inResourcename, const CP_String &inResourcetype) const
 Locate a resource file within the bundle.
const CP_PropertyList::NodeGetValueForDictionaryKey (const CP_String &inKey, CP_PropertyList::NodeType_t inRequestedValueType=CP_PropertyList::NodeType_Any) const
 Get a value from the bundle's info dictionary.
CP_Bundleoperator= (const CP_Bundle &inBundle)
 assignment - make this bundle refer to the same package as inBundle.
Constructor / Destructor
 CP_Bundle ()
 Default constructor.
 CP_Bundle (const CP_Bundle &inBundle)
 Copy constructor.
 CP_Bundle (const CP_FileSystemSpec &inBundleFileSpec)
 Constructor for bundle given bundle filespec.
 CP_Bundle (const CP_String &inBundleIdentifier)
 Constructor for bundle given bundle identifier.
 CP_Bundle (CFBundleRef inBundleRef)
virtual ~CP_Bundle () throw ()
 Destructor.

Static Public Member Functions

static CP_BundleMainBundle ()
 Get the main (usually application) bundle.

Protected Member Functions

CP_PropertyList::DictionaryLoadInfoDictionary () const
Getters
CP_CFURL GetURL () const
CP_CFURL GetResourceURL () const
CP_CFURL GetResourceURL (const CP_String &inFileName, const CP_String &inExtension) const
CFBundleRef GetOSBundle () const
CFTypeRef GetValueForDictionaryKey (const CP_String &inKey) const
Tester
bool IsValid ()
Tester
bool IsValid ()

Protected Attributes

CFBundleRef fBundleRef
OSType fCreator
OSType fType

Constructor & Destructor Documentation

CP_Bundle::CP_Bundle  ) 
 

Creates an empty CP_Bundle object

CP_Bundle::CP_Bundle const CP_Bundle inBundle  ) 
 

Copy constructor

CP_Bundle::CP_Bundle const CP_FileSystemSpec inBundleFileSpec  ) 
 

Constructor for bundle given bundle file spec

Parameters:
the file spec that specifies the bundle's directory

CP_Bundle::CP_Bundle const CP_String inBundleIdentifier  ) 
 

Constructor for bundle given bundle identifier The current implementation will compare this new id with the one from the MainBundle and if they are not the same it will raise an exception

Exceptions:
CP_ThrowNotFound if the identifier does not specify the main bundle

CP_Bundle::CP_Bundle CFBundleRef  inBundleRef  ) 
 

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


Member Function Documentation

CP_Bundle & CP_Bundle::MainBundle  )  [static]
 

Create a CP_Bundle object for the current application

Exceptions:
CP_ThrowNotFound if on Windows the .exe file is not in the "Windows" subdirectory which is in the "Contents" subdirectory

OSType CP_Bundle::GetPackageCreator  )  const
 

Get the creator signature for the bundle If the signature is not found in the info.plist file, 0 is returned

Exceptions:
none 

Reimplemented from CP_CFBundle.

OSType CP_Bundle::GetPackageType  )  const
 

Get the package type for the bundle If the package type is not found in the info.plist file, 0 is returned

Exceptions:
none 

Reimplemented from CP_CFBundle.

CP_FileSystemSpec CP_Bundle::GetBundleFileSpec  )  const
 

Get the bundle's location on the disk

Exceptions:
none 

CP_FileSystemSpec CP_Bundle::GetBundleExecutableFileSpec  )  const
 

Get the bundle's executable on disk

Exceptions:
none 

CP_String CP_Bundle::GetShortVersionString  )  const
 

Get the short version string from the bundle's Info dictionary If the string is not found in the bundle info plist file, an empty string is returned.

Exceptions:
none 

Reimplemented from CP_CFBundle.

UInt32 CP_Bundle::GetVersionNumber  )  const
 

Get the bundle version as a number If the verison is not in the bundle info plist file, 0 is returned

Exceptions:
none 

CP_String CP_Bundle::GetCopyrightString  )  const
 

Get the copyright notice from the bundles' Info directory. If the notice is not in the bundle info plist file, an empty string is returned.

Exceptions:
none 

Reimplemented from CP_CFBundle.

CP_String CP_Bundle::GetIdentifier  )  const
 

Get the bundle identifier. If the identifier is not present in the bundle info plist file, an empty string is returned.

Exceptions:
none 

CP_FileSystemSpec CP_Bundle::LocateResourcesFolder  )  const
 

Get the resources folder inside the bundle

Exceptions:
CP_NotFoundException if the folder does not exist on the disk

CP_FileSystemSpec CP_Bundle::LocatePluginsFolder  )  const
 

Get the plug ins folder inside the bundle

Exceptions:
CP_NotFoundException if the folder does not exist on the disk

CP_FileSystemSpec CP_Bundle::LocateSharedSupportFolder  )  const
 

Get the shared support folder inside the bundle

Exceptions:
CP_NotFoundException if the folder does not exist on the disk

CP_FileSystemSpec CP_Bundle::LocateContentsFolder  )  const
 

Get the contents folder inside the bundle

Exceptions:
CP_NotFoundException if the folder does not exist on the disk

CP_FileSystemSpec CP_Bundle::LocateResourceFile const CP_String inResourceName,
const CP_String inResourceType
const
 

Locate the resource file inside the bundle

Note:
On Windows side the inResourceName represents the file title and the inResourceType represents the file extension.
Exceptions:
CP_NotFoundException if the resource file does not exist on the disk
Parameters:
resource name to locate
resource type

const CP_PropertyList::Node * CP_Bundle::GetValueForDictionaryKey const CP_String inKey,
CP_PropertyList::NodeType_t  inRequestedValueType = CP_PropertyList::NodeType_Any
const
 

Get a value from the bundle's info dictionary. If the value is not found NULL is returned. If an expected value type is specified (other than CP_PropertyList::NodeType_Any) and the found value's type does not match, an exception is raised.

Exceptions:
std::bad_cast exception raised if requested node type specified and node is not of the expected type.
Parameters:
inKey The key specifying the info dictionary value to fetch.
inRequestedValueType The expected node type or CP_PropertyList::NodeType_Any to allow any node type.

CP_Bundle & CP_Bundle::operator= const CP_Bundle inBundle  ) 
 

Assignement operator

CP_PropertyList::Dictionary* CP_Bundle::LoadInfoDictionary  )  const [protected]
 

CP_CFURL CP_CFBundle::GetURL  )  const [inherited]
 

Returns a CP_CFURL object that points to this bundle.

Exceptions:
none 
Returns:
CP_CFURL A CP_CFURL that points to this bundle.

CP_CFURL CP_CFBundle::GetResourceURL  )  const [inherited]
 

Returns a CP_CFURL object that points to the resources URL inn the bundle.

Exceptions:
none 
Returns:
CP_CFURL A CP_CFURL that points to the resources URL in the bunndle.

CP_CFURL CP_CFBundle::GetResourceURL const CP_String inFileName,
const CP_String inExtension
const [inherited]
 

Returns a CP_CFURL object that points to a file in the resource folder of the main bundle.

Parameters:
inFileName Name of the file to retrieve.
inExtension Extension of the file to retrieve.
Exceptions:
none 
Returns:
CP_CFURL A CP_CFURL that points to the resources URL in the bunndle.

CFBundleRef CP_CFBundle::GetOSBundle  )  const [inherited]
 

Return the MacOS CFBundleRef for this bundle.

Exceptions:
none 
Returns:
CFBundleRef MacOS CFBundleRef for this bundle.

CFTypeRef CP_CFBundle::GetValueForDictionaryKey const CP_String inKey  )  const [inherited]
 

Returns the value for the passed in dictionary key.

Exceptions:
none 
Returns:
CFTypeRef The value of the found key.

bool CP_CFBundle::IsValid  )  [inherited]
 

Returns true if the object represents a bundled object in the MacOS system.

Exceptions:
none 
Returns:
bool True if this represents a valid bundle object.


Member Data Documentation

CFBundleRef CP_CFBundle::fBundleRef [protected, inherited]
 

OSType CP_CFBundle::fCreator [protected, inherited]
 

The bundle we manage.

OSType CP_CFBundle::fType [protected, inherited]
 

Creator code of the bundle.


The documentation for this class was generated from the following files:
Generated on Tue Sep 20 20:21:34 2005 for CPLAT_MacOS by  doxygen 1.4.0