// // EX04CON.CPP // // C++/DOS Example program for ArchiveLib 2.0 // // Copyright (c) Greenleaf Software, Inc. 1994 - 1996 // All Rights Reserved // // MEMBERS/FUNCTIONS DEMONSTRATED // // ALArchiveBase::SetComment() // ALArchiveBase::WriteDirectory() // ALEntry::SetComment() // ALName::operator char*() // // DESCRIPTION // // This example program demonstrates ArchiveLib's ability to set // comments both for an entire archive as well as individual objects // within the archive. If you don't have a copy of DOS00.GAL already, // you can create one using EX00CON. // // REVISION HISTORY // // February 1, 1996 2.0A : Second release // #include #include #include #include "arclib.h" #include "glarc.h" #include "pkarc.h" main() { cout << "Archive Library 2.0\nEX04CON.CPP\n\n"; cout << "This example program demonstrates ArchiveLib's ability to set\n"; cout << "comments both for an entire archive as well as individual objects\n"; cout << "within the archive. If you don't have a copy of DOS00.GAL already,\n"; cout << "you can create one using EX00CON.\n"; getch(); #if defined( ZIP ) ALPkArchive archive( "dos00.zip" ); #else ALGlArchive archive( "dos00.gal" ); #endif ALEntryList list; archive.ReadDirectory( list ); cout << "Setting archive comment." << endl; archive.SetComment( "Greenleaf was here." ); ALEntry *entry = list.GetFirstEntry(); cout << "Setting " << entry->mpStorageObject->mName << "'s comment." << endl; entry->SetComment( "Greenleaf was here." ); archive.WriteDirectory( list ); return 0; }