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

CP_AE_Descriptor Class Reference
[AppleEvents]

The CP_AE_Descriptor class is a MacOS only class that provides a wrapper for the MacOS AEDesc structure. NOTE: Most of these routines will throw an CP_OSErr exception if they don't work with no error. More...

Inheritance diagram for CP_AE_Descriptor:

CP_AE_AppleEvent CP_AE_List CP_AE_Record List of all members.

Copiers

CP_AE_Descriptor operator= (const CP_AE_Descriptor &inDescriptor)
void CopyDesc (const CP_AE_Descriptor &desc)

Public Member Functions

 operator AEDesc * ()
 operator const AEDesc * () const
 operator AEDesc & ()
 operator const AEDesc & () const
void swap (CP_AE_Descriptor &inOutDescriptor) throw ()
Constructor / Destructor
 CP_AE_Descriptor ()
 Constructor.
 CP_AE_Descriptor (const AEDesc &inDesc, AEKeyword inKeyword, DescType inDesiredType=typeWildCard)
 CP_AE_Descriptor (const CP_AE_Descriptor &inDescriptor)
virtual ~CP_AE_Descriptor ()
 Destructor.

Public Attributes

AEDesc fAEDesc

Detailed Description


Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_AE_Descriptor::CP_AE_Descriptor  ) 
 

Constructor.

Exceptions:
none 

CP_AE_Descriptor::CP_AE_Descriptor const AEDesc &  inDesc,
AEKeyword  inKeyword,
DescType  inDesiredType = typeWildCard
 

Constructor.

Parameters:
inDesc AppleEvent AEDesc for &fAEDesc descriptor.
inCopyDesc Flag to indicate if we copy the descriptor, or just copy the fields.
inDispose Flag to indicate if we are responsible for disposal.
Exceptions:
OSError exceptions.

CP_AE_Descriptor::CP_AE_Descriptor const CP_AE_Descriptor inDescriptor  ) 
 

Copy constructor.

Parameters:
inDescriptor Descriptor object to copy fields from.
Exceptions:
OSError exceptions.

CP_AE_Descriptor::~CP_AE_Descriptor  )  [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

void CP_AE_Descriptor::Dispose  ) 
 

Dispose of the memory allocated for &fAEDesc object.

Exceptions:
OSError exceptions.
Returns:
void

void CP_AE_Descriptor::CreateDescriptor const DescType  inTypeCode,
const Ptr  inData,
const Size  inLength
 

Create a new descriptor ffrom the passed in data and data type code.

Parameters:
inTypeCode The DescType type code.
inData Pointer to the data to be used.
inLength Length of the data to be used.
Exceptions:
OSError exceptions.
Returns:
void

void CP_AE_Descriptor::MakeNULL  ) 
 

Make &fAEDesc descriptor into a NULL descriptor.

Exceptions:
none 
Returns:
void

OSErr CP_AE_Descriptor::AttemptCoercion DescType  typeToCoerceTo  ) 
 

Try to coerce the type of the descriptor to something else. &fAEDesc method will NOT fail if the coercion could not be done. NOTE: &fAEDesc method does not throw an exception, but returns the error code, as it is ok for &fAEDesc routine to fail.

Parameters:
typetoCoerceTo The desired type we want.
Exceptions:
none 
Returns:
OSErr The result of the coercion.

void CP_AE_Descriptor::CoerceInPlace DescType  typeToCoerceTo  ) 
 

Require that &fAEDesc object be coerced to the specified data type. &fAEDesc method will fail if the coercion does not work.

Parameters:
typetoCoerceTo The desired type we want.
Exceptions:
OSError exception.
Returns:
OSErr The result of the coercion.

CP_AE_Descriptor CP_AE_Descriptor::Coerce DescType  typeToCoerceTo  )  const
 

Require that &fAEDesc object be coerced to the specified data type. &fAEDesc method will fail if the coercion does not work.

Parameters:
typetoCoerceTo The desired type we want.
Exceptions:
OSError exception.
Returns:
CP_AE_Descriptor The result of the coecion.

void CP_AE_Descriptor::CoerceToStandardType  ) 
 

&fAEDesc method attempts to coerce its data into some form of standard type (e.g. typeChar or typeLongInteger). The following conversions are tried: From: typeAEText, typeIntlText or typeStyledText to typeChar, and typeLongInteger to typeLongInteger.

Exceptions:
OSError exception.
Returns:
void

CP_AE_Descriptor CP_AE_Descriptor::operator= const CP_AE_Descriptor inDescriptor  ) 
 

Assignment operator. Copies the information provided in the inDescriptor object.

Parameters:
inDescriptor The object to copy the data from.
Exceptions:
OSError exceptions.
Returns:
void

void CP_AE_Descriptor::CopyDesc const CP_AE_Descriptor inDescriptor  ) 
 

Duplicate the information from the passed in descriptor.

Parameters:
inDescriptor The object to copy the data from.
Exceptions:
OSError exceptions.
Returns:
void

DescType CP_AE_Descriptor::DescriptorType  )  const
 

Return a DescType that describes the type of descriptor this is.

Exceptions:
none 
Returns:
DescType const The DescType for this descriptor.

Handle CP_AE_Descriptor::GetData  ) 
 

Return a Handle to our data. &fAEDesc handle is a copy of the data and must be deleted by the caller.

Exceptions:
OSError exceptions.
Returns:
Handle The returned handle.

void CP_AE_Descriptor::GetDescriptor const AEDesc &  inDescriptor,
AEKeyword  inKey,
DescType  inDesiredType = typeWildCard
 

Get the descriptor from an event. If the desired type is not specified, it is assumed to be typeWildCard.

Parameters:
inDescriptor The descriptor to retrieve the paramDesc from.
inKey The key of the descriptor.
inDesiredType The desired type we want.
Exceptions:
OSError exception.
Returns:
void

OSErr CP_AE_Descriptor::GetOptionalDescriptor const AEDesc &  inDescriptor,
AEKeyword  inKey,
DescType  inDesiredType = typeWildCard
 

Get the descriptor from an event. If the desired type is not specified, it is assumed to be typeWildCard. NOTE: &fAEDesc method is used for retrieving optional descriptors, so we will just return the err code and let the called do with the result as it sees fit.

Parameters:
inDescriptor The descriptor to retrieve the paramDesc from.
inKey The key of the descriptor.
inDesiredType The desired type we want.
Exceptions:
none 
Returns:
OSErr Result of the operation.

void CP_AE_Descriptor::GetNthPtr SInt32  inIndex,
DescType  inDesiredType,
AEKeyword *  inAEKeyword,
DescType *  inTypeCode,
void *  inDataPtr,
Size  inMaximumSize,
Size *  inOutActualSize
 

Retrurns a pointer to the nth item in &fAEDesc descriptor.

Parameters:
inIndex Index of the item we want.
inDesiredType The type we want converted to.
inAEKeyword Keyword for item.
inTypeCode TypeCode for item.
inDataPtr Pointer to the location to return the items data.
inMaximumSize Maximum size of the data to be returned.
inOutActualSize Actual size of the returned data.
Exceptions:
none 
Returns:
OSErr Result of the operation.

void CP_AE_Descriptor::GetBlock Ptr  inData,
Size  inLength,
DescType  inDesiredType
const
 

Get a block of data of the inDesiredType.

Parameters:
inData Ptr to the data.
inLength Size of the data length.
inDesiredType The desired type of data.
Exceptions:
none 
Returns:
void

SInt16 CP_AE_Descriptor::GetSInt16  )  const
 

Return the data from &fAEDesc descriptor as a SInt16.

Exceptions:
none 
Returns:
SInt16 const The data as a SInt16.

SInt32 CP_AE_Descriptor::GetSInt32  )  const
 

Return the data from &fAEDesc descriptor as a SInt32.

Exceptions:
none 
Returns:
SInt32 const The data as a SInt32.

bool CP_AE_Descriptor::GetBoolean  )  const
 

Return the data from &fAEDesc descriptor as a bool.

Exceptions:
none 
Returns:
bool const The data as a bool.

DescType CP_AE_Descriptor::GetDescType  )  const
 

Return the type of information contained in &fAEDesc object as a DescType.

Exceptions:
none 
Returns:
DescType const The data as a DescType.

AEKeyword CP_AE_Descriptor::GetKeyword  )  const
 

Return the type of information contained in &fAEDesc object as a AEKeyword.

Exceptions:
none 
Returns:
AEKeyword const The data as a AEKeyword.

DescType CP_AE_Descriptor::GetEnumeration  )  const
 

Return the data from &fAEDesc descriptor as a DescType enumeration.

Exceptions:
none 
Returns:
DescType const The data as a Desctype enumeration.

DescType CP_AE_Descriptor::GetOrdinal  )  const
 

Return the data from &fAEDesc descriptor as a DescType typeAbsoluteOrdinal.

Exceptions:
none 
Returns:
DescType const The data as a Desctype ordinal.

CP_Point CP_AE_Descriptor::GetPoint  )  const
 

Return the data from &fAEDesc descriptor as a CP_Point object.

Exceptions:
none 
Returns:
CP_Point const The converted CP_Point object.

CP_Rect CP_AE_Descriptor::GetRect  )  const
 

Return the data from &fAEDesc descriptor as a CP_Rect object.

Exceptions:
none 
Returns:
CP_Rect const The converted CP_Rect object.

void CP_AE_Descriptor::GetPString Str255  result  )  const
 

Return the data from &fAEDesc descriptor as a Str255 object.

Parameters:
result Location to return the result in.
Exceptions:
none 
Returns:
void

CP_String CP_AE_Descriptor::GetString  )  const
 

Return the data from &fAEDesc descriptor as a CP_String object.

Exceptions:
none 
Returns:
CP_String const The converted CP_String object.

CP_FileSystemSpec CP_AE_Descriptor::GetFileSpec  )  const
 

Return the data from &fAEDesc descriptor as a CP_FileSystemSpec.

Exceptions:
none 
Returns:
CP_FileSystemSpec const The converted file system spec.

SInt32 CP_AE_Descriptor::GetItemCount  ) 
 

Return the number of items in &fAEDesc descriptor.

Exceptions:
none 
Returns:
SInt32 The number of items in &fAEDesc descriptor.

OSErr CP_AE_Descriptor::GetNthItem SInt32  inItemIndex,
DescType *  inOutDescType,
CP_AE_Descriptor inOutItem
 

Return the nth item from &fAEDesc descriptor.

Parameters:
inItemIndex Index of the item to return.
inOutDescType Location to return the DescType of the item.
inOutItem Location to return the item.
Exceptions:
none 
Returns:
OSErr Result of the operation.

CP_AE_Descriptor::operator AEDesc *  ) 
 

CP_AE_Descriptor::operator const AEDesc *  )  const
 

CP_AE_Descriptor::operator AEDesc &  ) 
 

CP_AE_Descriptor::operator const AEDesc &  )  const
 

void CP_AE_Descriptor::CopyData const DescType  inTypeCode,
const Ptr  inData,
const Size  inLength
 

Make a new descriptor from the passed in data and data type code.

Parameters:
inTypeCode The DescType type code.
inData Pointer to the data to be used.
inLength Length of the data to be used.
Exceptions:
OSError exceptions.
Returns:
void

void CP_AE_Descriptor::MakeBoolean const Boolean  inData  ) 
 

Make &fAEDesc into a Boolean descriptor from the passed in Boolean data.

Parameters:
inData Data to be used for the descriptor.
Exceptions:
none 
Returns:
void

void CP_AE_Descriptor::MakeBoolean const bool  inData  ) 
 

Make &fAEDesc into a Boolean descriptor from the passed in bool data.

Parameters:
inData Data to be used for the descriptor.
Exceptions:
none 
Returns:
void

void CP_AE_Descriptor::MakeSInt16 const SInt16  inData  ) 
 

Make &fAEDesc into a SInt16 descriptor from the passed in data.

Parameters:
inData Data to be used for the descriptor.
Exceptions:
none 
Returns:
void

void CP_AE_Descriptor::MakeSInt32 const SInt32  inData  ) 
 

Make &fAEDesc into a SInt32 descriptor from the passed in data.

Parameters:
inData Data to be used for the descriptor.
Exceptions:
none 
Returns:
void

void CP_AE_Descriptor::MakeUInt32 const UInt32  inData  ) 
 

Make &fAEDesc into a UInt32 descriptor from the passed in data.

Parameters:
inData Data to be used for the descriptor.
Exceptions:
none 
Returns:
void

void CP_AE_Descriptor::MakePoint const CP_Point inPoint  ) 
 

Make &fAEDesc into a point descriptor from the passed in data.

Parameters:
inPoint CP_Point data to be used for the descriptor.
Exceptions:
none 
Returns:
void

void CP_AE_Descriptor::MakeRect const CP_Rect inRect  ) 
 

Make &fAEDesc into a rect descriptor from the passed in data.

Parameters:
inPoint CP_Rect data to be used for the descriptor.
Exceptions:
none 
Returns:
void

void CP_AE_Descriptor::MakeString Str255  inData  ) 
 

Make &fAEDesc into a p-style string descriptor from the passed in data.

Parameters:
inPoint Str255 data to be used for the descriptor.
Exceptions:
none 
Returns:
void

void CP_AE_Descriptor::MakeString const CP_String  inData  ) 
 

Make &fAEDesc into a string descriptor from the passed in data.

Parameters:
inPoint CP_String data to be used for the descriptor.
Exceptions:
none 
Returns:
void

void CP_AE_Descriptor::MakeFileSpec const FSSpec &  inFileSpec  ) 
 

Make &fAEDesc into a file spec descriptor from the passed in data.

Parameters:
inPoint FSSpec data to be used for the descriptor.
Exceptions:
none 
Returns:
void

void CP_AE_Descriptor::MakeFileSpec const CP_FileSystemSpec inFileSpec  ) 
 

Make &fAEDesc into a file spec descriptor from the passed in data.

Parameters:
inPoint CP_FileSystemSpec data to be used for the descriptor.
Exceptions:
none 
Returns:
void

void CP_AE_Descriptor::AdoptAlias Handle  inAlias  ) 
 

Takes the provided alias handle and uses it to set the data for &fAEDesc descriptor.

Parameters:
Handle Alias to the data to be converted.
Exceptions:
none 
Returns:
void

void CP_AE_Descriptor::MakeAlias const CP_FileSystemSpec inFileSpec  ) 
 

Make a descriptor for the passed in CP_FileSystemSpec inData as a MacOS Alias.

Parameters:
inFileSpec CP_FileSystemSpec to convert.
Exceptions:
OSError exceptions.
Returns:
void

void CP_AE_Descriptor::MakeProcessSerialNumber ProcessSerialNumber  inPSN  ) 
 

Make a descriptor for the passed in MacOS ProcessSerialNumber.

Parameters:
inPSN The process serial number to use.
Exceptions:
none. 
Returns:
void

void CP_AE_Descriptor::MakeObjectSpecifier DescType  inDesiredClass,
CP_AE_Descriptor  inContainer,
DescType  inKeyForm,
CP_AE_Descriptor  inKeyData,
bool  inDisposeInputs
 

Make an object specifier from the passed in data.

Parameters:
inDesirecClass The DescType type of class we are trying to create.
inContainer The CP_AE_Descriptor that is the container of ourselves.
inKeyForm The DescType inKeyForm of the specifier.
inKeyData The CP_AE_Descriptor of the key data.
inDisposeInputs If true, the memory for the input data is disposed of.
Exceptions:
none. 
Returns:
void

void CP_AE_Descriptor::MakeCompDescriptor DescType  inComparisonOperator,
DescType  inPropertyIdentifier,
CP_AE_Descriptor  inCompareWith,
bool  inDisposeInputs
 

Make an comp descriptor.

Parameters:
inComparisonOperator The DescType of the comparison operator.
inPropertyIdentifier The property identifier.
inCompareWith Objecct to compare with &fAEDesc objecct.
inDisposeInputs Flag to indicate the input objects should be disposed of.
Exceptions:
none. 
Returns:
void

void CP_AE_Descriptor::MakeEnumeration const DescType  inEnumeration  ) 
 

Make an enumeration for &fAEDesc descriptor.

Parameters:
inEnumeration The enumeration to use.
Exceptions:
none. 
Returns:
void

void CP_AE_Descriptor::MakeDescType const DescType  inData  ) 
 

Make a DescType descriptor.

Parameters:
inData DescType to use.
Exceptions:
none. 
Returns:
void

void CP_AE_Descriptor::MakeKeyword const AEKeyword  inKeyword  ) 
 

Make an an AEKeyword for &fAEDesc descriptor.

Parameters:
inKeyword The keyword to use.
Exceptions:
none. 
Returns:
void

void CP_AE_Descriptor::MakeOrdinal const DescType  inData  ) 
 

Make an an ordinal for &fAEDesc descriptor.

Parameters:
inData The data to use.
Exceptions:
none. 
Returns:
void

void CP_AE_Descriptor::MakeTypeOrInteger const DescType  inData  ) 
 

Make &fAEDesc object either a type or an integer based upon inData. &fAEDesc is useful for debugging; it makes a 'type' if the data appears to consist of printable characters (e.g. 'ABCD'), but otherwise it makes an integer (e.g. -12).

Parameters:
inData The DescType of the type we want to become.
Exceptions:
none. 
Returns:
void

void CP_AE_Descriptor::AdoptHandle DescType  inDataType,
Handle  inHandle
 

Assign the inDataType and inHandle to &fAEDesc object.

Parameters:
inDataType The type of data we want.
inHandle The data to convert.
Exceptions:
none. 
Returns:
void

void CP_AE_Descriptor::AdoptDesc const AEDesc &  inDescriptor  ) 
 

Adopt the passed in CP_AE_Descriptor object.

Parameters:
inDescriptor The descriptor to use in the conversion.
Exceptions:
none. 
Returns:
void

bool CP_AE_Descriptor::IsNullDescriptor  )  const
 

Return true if this is a NULL descriptor, ie doesn't describe anything.

Exceptions:
none 
Returns:
bool const True if this is a NULL desciptor.

bool CP_AE_Descriptor::IsNullDataHandle  )  const
 

Return true if the data handle is NULL.

Exceptions:
none 
Returns:
bool const True if the data handle is NULL.

void CP_AE_Descriptor::swap CP_AE_Descriptor inOutDescriptor  )  throw ()
 


Member Data Documentation

AEDesc CP_AE_Descriptor::fAEDesc
 


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