campo-sirio/al/examples/ex04con.cpp
alex 714dd74636 Archive Library versione 2.00
git-svn-id: svn://10.65.10.50/trunk@5350 c028cbd2-c16b-5b4b-a496-9718f37d4682
1997-10-09 16:09:54 +00:00

66 lines
1.6 KiB
C++
Executable File

//
// 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 <conio.h>
#include <iostream.h>
#include <iomanip.h>
#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;
}