campo-sirio/al/examples/ex02con.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

71 lines
1.8 KiB
C++
Executable File

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