campo-sirio/arch/archive.h

136 lines
4.5 KiB
C++
Executable File

/*
* ARCHIVE.H
*
* Header file for ArchiveLib 1.0
*
* Copyright (c) 1994 Greenleaf Software, Inc.
* All Rights Reserved
*
* DESCRIPTION
*
* This header file contains the class definition for ALArchive, the
* standard archiving class derived from ALArchiveBase.
*
* ALArchive is the default archive class used in the
* library. The base class, ALArchiveBase, doesn't know which storage
* objects and compression engines to use when extracting files. (This is so
* you don't have to link in *every* storage and compression class if
* you want to create your own archive class). This derived class
* takes care of creating two different storage types, ALFile and
* ALMemory. It knows how to create two different types of
* compression engines also: ALGreenleafEngine and ALCopyEngine. All
* of this is the result of the two virtual functions that override
* the base class: CreateCompressionEngine() and CreateStorageObject().
*
* CLASS DEFINITIONS:
*
* class ALArchive
*
* REVISION HISTORY
*
* May 26, 1994 1.0A : First release
*
*/
#ifndef _ARCHIVE_H
#define _ARCHIVE_H
#include "arclib.h"
#if defined( __cplusplus )
#include "filestor.h"
#include "grenengn.h"
/*
* class ALArchive : public ALArchiveBase
*
* DESCRIPTION
*
* ALArchive is a class derived from ALArchiveBase. It is the
* class we use most often for standard archiving use.
*
* DATA MEMBERS
*
* None.
*
* MEMBER FUNCTIONS
*
* ALArchive(char *) : A constructor that creates the storage
* object for you.
* ALArchive(ALStorage&) : Constructor using a storage object that
* you have created.
* ~ALArchive() : Virtual destructor.
* operator new() : Memory allocation when inside a DLL.
* CreateCompressionEngine() : Virtual function that knows how to make
* ALCopyEngine and ALGreenleafEngine engines.
* CreateStorageObject() : Virtual function that knows how to make
* ALFile and ALMemory objects.
* AddWildCardFiles() : A static function used to create
* new ALEntry objects, and add them to an
* ALEntryList object.
* MakeEntriesFromListBox() : A second static function used to create
* new ALEntry objects and add them to an
* ALEntryList object.
*
* REVISION HISTORY
*
* May 26, 1994 1.0A : First release
*
*/
class AL_CLASS_TYPE ALArchive : public ALArchiveBase {
/*
* Constructors, destructors, declarations
*/
public :
AL_PROTO ALArchive( const char AL_DLL_FAR *file_name );
AL_PROTO ALArchive( ALStorage AL_DLL_FAR &object );
virtual AL_PROTO ~ALArchive();
#if defined( AL_USING_DLL ) || defined( AL_BUILDING_DLL )
void AL_DLL_FAR * AL_PROTO operator new( size_t size );
#endif
/*
* As usual, I prohibit the copy constructor and assignment operator.
* They are declared here but they don't exist.
*/
protected :
AL_PROTO ALArchive( ALArchive AL_DLL_FAR & );
ALArchive AL_DLL_FAR & AL_PROTO operator=( ALArchive AL_DLL_FAR & );
/*
* Member Functions
*
* Note, these guys are used inside the Archive class for extraction.
* The may be better off protected.
*/
public :
virtual ALCompressionEngine AL_DLL_FAR * AL_PROTO CreateCompressionEngine( int engine_type );
virtual ALStorage AL_DLL_FAR * AL_PROTO CreateStorageObject( const char AL_DLL_FAR *name, int object_type );
public :
/*
* These two member functions are both static. They are in this class
* to take advantage of this classes knowledge of how to create
* ALFile and ALGreenleafEngine objects. They are used to create
* new ALEntry objects. It would be good in a future release to
* change their names to be more uniform.
*/
static int AL_PROTO
AddWildCardFiles( ALEntryList AL_DLL_FAR & list,
const char AL_DLL_FAR *pattern = "*.*",
int traverse_flag = 0,
short int compression_level = AL_GREENLEAF_LEVEL_2 );
#if defined( AL_WINDOWS_GUI )
static int AL_PROTO MakeEntriesFromListBox( ALEntryList AL_DLL_FAR &list, HWND hDlg, int list_box = -1 );
#endif
/*
* Data members, hey there aren't any!
*/
public :
AL_CLASS_TAG( _ALArchiveTag );
};
#endif /* #if defined( __cplusplus ) */
#endif /* #ifndef _ARCHIVE_H */