//************************************************************************************** // Filename: StAEDesc.h // Part of Contextual Menu Workshop by Abracode Inc. // http://free.abracode.com/cmworkshop/ // Copyright © 2002-2003 Abracode, Inc. All rights reserved. // // Description: very primitive. use PowerPlant's StAEDescriptor if you prefer // but note that this one does not throw // // //************************************************************************************** // Revision History: // Friday, January 25, 2002 - Original //************************************************************************************** #pragma once class StAEDesc { public: StAEDesc() { Init(); } StAEDesc(const AEDesc &inDesc) {//just take ownership, do not copy mDesc = inDesc; } virtual ~StAEDesc() { if( mDesc.dataHandle != NULL ) { ::AEDisposeDesc( &mDesc ); } } void Init() { mDesc.descriptorType = typeNull; mDesc.dataHandle = NULL; } DescType GetDescriptorType() const { return mDesc.descriptorType; } AEDataStorage GetDataStorage() const { return mDesc.dataHandle; } bool IsNULL() { return (mDesc.descriptorType == typeNull); } operator AEDesc& () { return mDesc; } operator const AEDesc& () const { return mDesc; } operator AEDesc* () { return &mDesc; } operator const AEDesc* () const { return &mDesc; } protected: AEDesc mDesc; private: StAEDesc(const StAEDesc&); StAEDesc& operator=(const StAEDesc&); };