130 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			130 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
//
 | 
						|
// CXL_WILD.CPP
 | 
						|
//
 | 
						|
//  Source file for ArchiveLib 2.0
 | 
						|
//
 | 
						|
//  Copyright (c) Greenleaf Software, Inc. 1994-1996
 | 
						|
//  All Rights Reserved
 | 
						|
//
 | 
						|
// CONTENTS
 | 
						|
//
 | 
						|
//  ALExpanderGetNextFile()
 | 
						|
//
 | 
						|
// REVISION HISTORY
 | 
						|
//
 | 
						|
//   February 14, 1996  2.0A : New release
 | 
						|
//
 | 
						|
 | 
						|
#include "arclib.h"
 | 
						|
#if !defined( AL_IBM )
 | 
						|
#pragma hdrstop
 | 
						|
#endif
 | 
						|
 | 
						|
#include "wildcard.h"
 | 
						|
#include "_vbutil.h"
 | 
						|
 | 
						|
//
 | 
						|
// NAME
 | 
						|
//
 | 
						|
//  ALWildCardExpander::GetNextFile()
 | 
						|
//
 | 
						|
// PLATFORMS/ENVIRONMENTS
 | 
						|
//
 | 
						|
//  Console  Windows  PM
 | 
						|
//  C++  C  VB  Delphi
 | 
						|
//
 | 
						|
// SHORT DESCRIPTION
 | 
						|
//
 | 
						|
//  Get the next expanded file from an expander.
 | 
						|
//
 | 
						|
// C++ SYNOPSIS
 | 
						|
//
 | 
						|
//  #include "arclib.h"
 | 
						|
//  #include "wildcard.h"
 | 
						|
//
 | 
						|
//  char *ALWildCardExpander::GetNextFile();
 | 
						|
//
 | 
						|
// C SYNOPSIS
 | 
						|
//
 | 
						|
//  #include "arclib.h"
 | 
						|
//  #include "wildcard.h"
 | 
						|
//
 | 
						|
//  char *ALExpanderGetNextFile( hALExpander this_object );
 | 
						|
//
 | 
						|
// VB SYNOPSIS
 | 
						|
//
 | 
						|
//  Declare Function ALExpanderGetNextFile Lib "AL20LW"
 | 
						|
//    Alias "ALExpanderGetNextFileVB"
 | 
						|
//    (ByVal this_object&) As String
 | 
						|
//
 | 
						|
// DELPHI SYNOPSIS
 | 
						|
//
 | 
						|
//  function ALExpanderGetNextFile( this_object : hALExpander ) : PChar;
 | 
						|
//
 | 
						|
// ARGUMENTS
 | 
						|
//
 | 
						|
//  this_object :  A handle for (pointer to) an ALWildCardExpander
 | 
						|
//                 object.
 | 
						|
//
 | 
						|
// DESCRIPTION
 | 
						|
//
 | 
						|
//  There are several different versions of the C++ function.  You
 | 
						|
//  can find them in:  ..\CPP_FS.DOS\WILDDOS.CPP, et. al.  They
 | 
						|
//  have a complete explanation of how the function works.
 | 
						|
//
 | 
						|
//  This file just has the C/VB/Delphi translation code.  These routines
 | 
						|
//  call the C++ member functions, which is found elswhere.  See those
 | 
						|
//  files for details on what happens for each O/S.
 | 
						|
//
 | 
						|
// RETURNS
 | 
						|
//
 | 
						|
//  A string containing the next expanded wild card generated by
 | 
						|
//  the wild card engine.  Note that under C, you will get a pointer
 | 
						|
//  to a string that is residing inside the ALWildCardExpander
 | 
						|
//  object, which you are free to copy or duplicate.  The VB translation
 | 
						|
//  function actually creates a new string using the ALCreateVBString
 | 
						|
//  function.
 | 
						|
//
 | 
						|
// EXAMPLE
 | 
						|
//
 | 
						|
// SEE ALSO
 | 
						|
//
 | 
						|
// REVISION HISTORY
 | 
						|
//
 | 
						|
//   February 14, 1996  2.0A : New release
 | 
						|
//
 | 
						|
 | 
						|
extern "C" AL_LINKAGE char AL_DLL_FAR * AL_FUNCTION
 | 
						|
ALExpanderGetNextFile( hALExpander this_object ) /* Tag public function */
 | 
						|
{
 | 
						|
    AL_ASSERT_OBJECT( this_object, ALWildCardExpander, "ALExpanderGetNextFile" );
 | 
						|
    return ( (ALWildCardExpander *) this_object )->GetNextFile();
 | 
						|
}
 | 
						|
 | 
						|
#if defined( AL_VB )
 | 
						|
 | 
						|
extern "C" AL_LINKAGE long AL_FUNCTION
 | 
						|
ALExpanderGetNextFileVB( hALExpander this_object )  /* Tag public function */
 | 
						|
{
 | 
						|
    AL_ASSERT_OBJECT( this_object, ALWildCardExpander, "ALExpanderGetNextFileVB" );
 | 
						|
    char _far *ret_guy = ( (ALWildCardExpander *) this_object )->GetNextFile();
 | 
						|
    if ( ret_guy == 0 )
 | 
						|
        ret_guy = "";
 | 
						|
    return ALCreateVBString( ret_guy, (unsigned short int) _fstrlen( ret_guy ) );
 | 
						|
}
 | 
						|
 | 
						|
#elif defined( AL_VB32 )
 | 
						|
 | 
						|
extern "C" AL_LINKAGE BSTR AL_FUNCTION
 | 
						|
ALExpanderGetNextFileVB( hALExpander this_object )  /* Tag public function */
 | 
						|
{
 | 
						|
    AL_ASSERT_OBJECT( this_object, ALWildCardExpander, "ALExpanderGetNextFileVB" );
 | 
						|
    char *ret_guy = ( (ALWildCardExpander *) this_object )->GetNextFile();
 | 
						|
    if ( ret_guy == 0 )
 | 
						|
        ret_guy = "";
 | 
						|
    return SysAllocStringByteLen( ret_guy, strlen( ret_guy ) );
 | 
						|
}
 | 
						|
 | 
						|
#endif
 | 
						|
 |