63 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			63 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
//
 | 
						|
// EX01CON.CPP
 | 
						|
//
 | 
						|
//  C++/DOS Example program for ArchiveLib 2.0
 | 
						|
//
 | 
						|
//  Copyright (c) Greenleaf Software, Inc. 1994 - 1996
 | 
						|
//  All Rights Reserved
 | 
						|
//
 | 
						|
// MEMBERS/FUNCTIONS DEMONSTRATED
 | 
						|
//
 | 
						|
//  ALSpinner::ALSpinner()
 | 
						|
//  ALStatus::GetStatusCode()
 | 
						|
//
 | 
						|
// DESCRIPTION
 | 
						|
//
 | 
						|
//  This example program creates an archive and adds files to it, while
 | 
						|
//  using an ALSpinner monitor.  It doesn't pay any attention to the
 | 
						|
//  command line, it just adds INPUT*.DAT and *.BAK to DOS00.GAL.  Any
 | 
						|
//  existing DOS00.GAL gets obliterated.  Note that this program is nearly
 | 
						|
//  identical to EX00CON.CPP.  They could probably be combined with little
 | 
						|
//  or not trouble.
 | 
						|
//
 | 
						|
// REVISION HISTORY
 | 
						|
//
 | 
						|
//  February 1, 1996  2.0A  : Second release
 | 
						|
//
 | 
						|
 | 
						|
#include <conio.h>
 | 
						|
 | 
						|
#include "arclib.h"
 | 
						|
#include "pkarc.h"
 | 
						|
#include "glarc.h"
 | 
						|
#include "spinner.h"
 | 
						|
 | 
						|
int main( int, char *[] )
 | 
						|
{
 | 
						|
 cout << "Archive Library 2.0\nEX01CON.CPP\n\n";
 | 
						|
 cout << "This example program creates an archive and adds files to it, while\n";
 | 
						|
 cout << "using an ALSpinner monitor.  It doesn't pay any attention to the\n";
 | 
						|
 cout << "command line, it just adds INPUT*.DAT and *.BAK to DOS00.GAL.  Any\n";
 | 
						|
 cout << "existing DOS00.GAL gets obliterated.  Note that this program is\n";
 | 
						|
 cout << "nearly identical to EX00CON.CPP.\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 );
 | 
						|
#endif
 | 
						|
 | 
						|
 cout << "\nAdding input*.dat and *.bak to "
 | 
						|
      << archive.GetStorageObject()->mName.GetSafeName()
 | 
						|
      << " using an ALSpinner\n\n";
 | 
						|
 | 
						|
 list.AddWildCardFiles( "input*.dat, *.bak" );
 | 
						|
 archive.Create( list );
 | 
						|
 return archive.mStatus.GetStatusCode();
 | 
						|
}
 |