//************************************************************************************** // Filename: AEAliasList.h // Part of Contextual Menu Workshop by Abracode Inc. // http://free.abracode.com/cmworkshop/ // Copyright © 2002-2003 Abracode, Inc. All rights reserved. // // Description: // //************************************************************************************** // Revision History: // Monday, August 12, 2002 - Original //************************************************************************************** #pragma once class AEAliasList { public: AEAliasList(); AEAliasList(const AEDescList *inList, Boolean inTakeOwnership, Boolean inCopyList = false); //deep copy constructor AEAliasList(const AEAliasList&inNew) { CopyList( &(inNew.mList)); } //deep copy assignment AEAliasList& operator=(const AEAliasList&inNew) { CopyList( &(inNew.mList)); return *this; } virtual ~AEAliasList(); SInt32 GetCount() const; OSErr AddItem(const FSRef *inRef); OSErr AddItem(const FSSpec *inFSSpec); OSErr AddItem(const AliasHandle inAliasH); OSErr FetchItemAt(SInt32 inIndex, FSSpec &outSpec) const; OSErr FetchItemAt(SInt32 inIndex, FSRef &outRef) const; OSErr RemoveItemAt(SInt32 inIndex); OSErr RemoveAllItems(); OSErr CopyList(const AEDescList *inList); OSErr AdoptList(const AEDescList *inList); AEDescList DisownList(); void TakeListOwnership() { mOwnList = true; } void DisposeOfList(); operator AEDescList& () { return mList; } operator const AEDescList& () const { return mList; } operator AEDescList* () { return &mList; } operator const AEDescList* () const { return &mList; } protected: AEDescList mList; Boolean mOwnList; private: // Defensive programming. No copy constructor nor operator= };