Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Member Functions
StAEDesc Class Reference

#include <nsAEUtils.h>

List of all members.

Public Member Functions

 StAEDesc ()
 ~StAEDesc ()
void Clear ()
 StAEDesc ()
 ~StAEDesc ()
 StAEDesc ()
 StAEDesc (const StAEDesc &rhs)
 ~StAEDesc ()
void Clear ()
void CheckDataType (DescType expectedType)
StAEDescoperator= (const StAEDesc &rhs)
Size GetDataSize ()
Boolean GetBoolean ()
SInt16 GetShort ()
SInt32 GetLong ()
DescType GetEnumType ()
void GetRect (Rect &outRect)
void GetRGBColor (RGBColor &outColor)
void GetLongDateTime (LongDateTime &outDateTime)
void GetFileSpec (FSSpec &outFileSpec)
void GetCString (char *outString, short maxLen)
void GetPString (Str255 outString)
Handle GetTextHandle ()

Private Member Functions

 StAEDesc (const StAEDesc &rhs)
StAEDescoperator= (const StAEDesc &rhs)

Detailed Description

Definition at line 2479 of file nsLocalFileMac.cpp.


Constructor & Destructor Documentation

StAEDesc::StAEDesc ( ) [inline]

Definition at line 2482 of file nsLocalFileMac.cpp.

                    {
                        descriptorType = typeNull;
                        dataHandle = nil;
                    }
StAEDesc::~StAEDesc ( ) [inline]

Definition at line 2488 of file nsLocalFileMac.cpp.

                    {
                        ::AEDisposeDesc(this);
                    }
StAEDesc::StAEDesc ( const StAEDesc rhs) [private]

Definition at line 279 of file nsAEUtils.cpp.

{
       ThrowIfOSErr(AEDuplicateDesc(&rhs, this));
}
StAEDesc::StAEDesc ( ) [inline]

Definition at line 271 of file nsLocalFileOSX.cpp.

    {
      descriptorType = typeNull;
      dataHandle = nil;
    }
StAEDesc::~StAEDesc ( ) [inline]

Definition at line 277 of file nsLocalFileOSX.cpp.

    {
      ::AEDisposeDesc(this);
    }
StAEDesc::StAEDesc ( ) [inline]

Definition at line 130 of file nsAEUtils.h.

                                   {
                                          descriptorType = typeNull;
                                          dataHandle = nil;
                                   }
StAEDesc::~StAEDesc ( ) [inline]

Definition at line 138 of file nsAEUtils.h.

                                   {
                                          ::AEDisposeDesc(this);
                                   }

Member Function Documentation

void StAEDesc::CheckDataType ( DescType  expectedType) [inline]

Definition at line 150 of file nsAEUtils.h.

                                   {
                                          if (descriptorType != expectedType)
                                                 ThrowOSErr(errAEWrongDataType);
                                   }
void StAEDesc::Clear ( void  ) [inline]

Definition at line 143 of file nsAEUtils.h.

                                   {
                                          ::AEDisposeDesc(this);
                                          descriptorType = typeNull;
                                          dataHandle = nil;
                                   }
void StAEDesc::Clear ( void  ) [inline]

Definition at line 2493 of file nsLocalFileMac.cpp.

                    {
                        ::AEDisposeDesc(this);
                        descriptorType = typeNull;
                        dataHandle = nil;
                    }

Here is the caller graph for this function:

Definition at line 304 of file nsAEUtils.cpp.

{
    Boolean result = false;
    OSErr err = ::AECoerceDescData(this, typeBoolean, &result, sizeof(result));
    if (err != noErr)
        ThrowOSErr(errAECoercionFail);
    return result;
}

Here is the call graph for this function:

void StAEDesc::GetCString ( char *  outString,
short  maxLen 
)

Definition at line 369 of file nsAEUtils.cpp.

{
       if (descriptorType == typeChar)
       {
              long dataSize = GetDataSize();
              dataSize = Min(dataSize, maxLen-1);
              if (AEGetDescData(this, outString, dataSize) == noErr)
              outString[dataSize] = '\0';
       }
       else
       {
              StAEDesc tempDesc;
              if (::AECoerceDesc(this, typeChar, &tempDesc) == noErr)
              {
                     long dataSize = tempDesc.GetDataSize();
              dataSize = Min(dataSize, maxLen-1);
              if (AEGetDescData(&tempDesc, outString, dataSize) == noErr)
                     outString[dataSize] = '\0';
              }
              else
                     ThrowOSErr(errAECoercionFail);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Size StAEDesc::GetDataSize ( ) [inline]

Definition at line 158 of file nsAEUtils.h.

                       {
                        return AEGetDescDataSize(this);
                       }

Here is the call graph for this function:

Here is the caller graph for this function:

DescType StAEDesc::GetEnumType ( )

Definition at line 331 of file nsAEUtils.cpp.

{
    DescType result = typeNull;
    OSErr err = ::AECoerceDescData(this, typeEnumeration, &result, sizeof(result));
    if (err != noErr)
        ThrowOSErr(errAECoercionFail);
    return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void StAEDesc::GetFileSpec ( FSSpec outFileSpec)

Definition at line 362 of file nsAEUtils.cpp.

{
    OSErr err = ::AECoerceDescData(this, typeFSS, &outFileSpec, sizeof(FSSpec));
    if (err != noErr)
        ThrowOSErr(errAECoercionFail);
}

Here is the call graph for this function:

Here is the caller graph for this function:

SInt32 StAEDesc::GetLong ( )

Definition at line 322 of file nsAEUtils.cpp.

{
    SInt32 result = 0;
    OSErr err = ::AECoerceDescData(this, typeLongInteger, &result, sizeof(result));
    if (err != noErr)
        ThrowOSErr(errAECoercionFail);
    return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void StAEDesc::GetLongDateTime ( LongDateTime &  outDateTime)

Definition at line 355 of file nsAEUtils.cpp.

{
    OSErr err = ::AECoerceDescData(this, typeLongDateTime, &outDateTime, sizeof(LongDateTime));
    if (err != noErr)
        ThrowOSErr(errAECoercionFail);
}

Here is the call graph for this function:

void StAEDesc::GetPString ( Str255  outString)

Definition at line 393 of file nsAEUtils.cpp.

{
       if (descriptorType == typeChar)
       {
              long stringLen = GetDataSize();
              if (stringLen > 255)
                     stringLen = 255;
              AEGetDescData(this, outString+1, stringLen);
              outString[0] = stringLen;
       }
       else
       {
              StAEDesc      tempDesc;
              if (::AECoerceDesc(this, typeChar, &tempDesc) == noErr)
              {
                     long stringLen = tempDesc.GetDataSize();
                     if (stringLen > 255)
                            stringLen = 255;
                     AEGetDescData(&tempDesc, outString+1, stringLen);
                     outString[0] = stringLen;
              }
              else
                     ThrowOSErr(errAECoercionFail);
       }
}

Here is the call graph for this function:

void StAEDesc::GetRect ( Rect &  outRect)

Definition at line 340 of file nsAEUtils.cpp.

{
    OSErr err = ::AECoerceDescData(this, typeQDRectangle, &outData, sizeof(Rect));
    if (err != noErr)
        ThrowOSErr(errAECoercionFail);
}

Here is the call graph for this function:

void StAEDesc::GetRGBColor ( RGBColor &  outColor)

Definition at line 348 of file nsAEUtils.cpp.

{
    OSErr err = ::AECoerceDescData(this, typeRGBColor, &outData, sizeof(RGBColor));
    if (err != noErr)
        ThrowOSErr(errAECoercionFail);
}

Here is the call graph for this function:

SInt16 StAEDesc::GetShort ( )

Definition at line 313 of file nsAEUtils.cpp.

{
    SInt16 result = 0;
    OSErr err = ::AECoerceDescData(this, typeShortInteger, &result, sizeof(result));
    if (err != noErr)
        ThrowOSErr(errAECoercionFail);
    return result;
}

Here is the call graph for this function:

Definition at line 419 of file nsAEUtils.cpp.

{
    Handle data = nil;
    
       if (descriptorType == typeChar)
       {
           Size dataSize = GetDataSize();
           data = ::NewHandle(dataSize);
           if (data == NULL)
               ThrowOSErr(memFullErr);
        ::HLock(data);
        ::AEGetDescData(this, *data, dataSize);
        ::HUnlock(data);
       }
       else
       {
       StAEDesc tempDesc;
              if (::AECoerceDesc(this, typeChar, &tempDesc) == noErr)
                  data = tempDesc.GetTextHandle();
              else
                  ThrowOSErr(errAECoercionFail);
       }
       
       return data;
}

Here is the call graph for this function:

Here is the caller graph for this function:

StAEDesc& StAEDesc::operator= ( const StAEDesc rhs)
StAEDesc & StAEDesc::operator= ( const StAEDesc rhs) [private]

Definition at line 291 of file nsAEUtils.cpp.

{
       ThrowIfOSErr(AEDuplicateDesc(&rhs, this));
       return *this;
}

The documentation for this class was generated from the following files: