// // EX02CON.CPP // // C++/DOS Example program for ArchiveLib 2.0 // // Copyright (c) Greenleaf Software, Inc. 1994 - 1996 // All Rights Reserved // // MEMBERS/FUNCTIONS DEMONSTRATED // // ALArchiveBase::Append() // ALArchiveBase::ReadDirectory() // ALEntryList::ClearMarks() // // DESCRIPTION // // This example program adds all *.CPP files to the existing DOS00.GAL // archive. If you haven't already created DOS00.GAL, you can do so // easily by executing EX00CON or EX01CON. // // REVISION HISTORY // // February 1, 1996 2.0A : Second release // #include #include #include #include "arclib.h" #include "glarc.h" #include "pkarc.h" #include "spinner.h" int main() { int status; cout << "Archive Library 2.0\nEX02CON.CPP\n\n"; cout << "This example program adds all *.CPP files to the existing DOS00.GAL\n"; cout << "archive. If you haven't already created DOS00.GAL, you can do so\n"; cout << "easily by executing EX00CON or EX01CON.\n"; getch(); ALSpinner monitor( AL_MONITOR_OBJECTS, cout ); #if defined( ZIP ) ALPkArchive archive( "dos00.zip" ); ALEntryList list( &monitor, PkTools() ); #else ALGlArchive archive( "dos00.gal" ); ALEntryList list( &monitor, GlTools() ); #endif cout << "\nAppending " << archive.GetStorageObject()->mName.GetSafeName() << " with all *.cpp files." << endl << endl; // // These two lines don't accomplish anything, but they do demonstrate that // ALArchiveBase::Append() doesn't pay any attention to list entries that // aren't marked. // archive.ReadDirectory( list ); list.ClearMarks(); list.AddWildCardFiles( "*.cpp" ); status = archive.Append( list ); cout << "Result of append operation is " << status; return 0; }