// $Revision: 1.5 $ #ifndef TaligentSamples_COLLECTIONCOPY #define TaligentSamples_COLLECTIONCOPY //----------------------------------------------------------------------------- // // Copyright (C) 1995 Taligent, Inc. All rights reserved. // // Project: WebRunner Sample // File: CollectionCopy.h // Build/Version: 1.0.0 // //----------------------------------------------------------------------------- #ifndef Taligent_COLLECTIONOF #include #endif #ifndef Taligent_DELETERFOR #include #endif #ifndef Taligent_DICTIONARYOF #include #endif template void CopyCollectionContents(const TCollectionOf& from, TCollectionOf& to) { TDeleterFor > iterator = from.CreateIterator(); for (AType* element = iterator->First() ; element != NIL ; element = iterator->Next()) { AType* elementCopy = ::CopyPointer(element); if (elementCopy != NIL) { to.Add(elementCopy); } } } template void CopyDictionaryContents(const TDictionaryOf& from, TDictionaryOf& to) { TDeleterFor > > iterator = from.CreateIterator(); for (TKeyValuePair* element = iterator->First() ; element != NIL ; element = iterator->Next()) { TKeyValuePair* elementCopy = ::CopyPointer(element); if (elementCopy != NIL) { to.Add(elementCopy); } } } #endif