This is AbstractConverter.m in view mode; [Download] [Up]
/***********************************************************************\
Common Abstract Converter class for Convert programs
Copyright (C) 1993 David John Burrowes
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
The author, David John Burrowes, can be reached at:
davidjohn@kira.net.netcom.com
David John Burrowes
1926 Ivy #10
San Mateo, CA 94403-1367
\***********************************************************************/
#import "AbstractConverter.h"
@implementation AbstractConverter
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Method: init
// Parameters: none
// Returns: none
// Stores: none
// Description:
// Initalizes an instance... namely by defining th manager instance as null
// Bugs:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- init
{
myManager = NullInstance;
return self;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Method: ReportTo:
// Parameters: The caller
// Returns: none
// Stores: none
// Description:
// ConvertController's use this to tell the converter what object to report status
// to. That is, we must tell sender when we are, for example, 50% of the way
// done so it can let the user know what's going on. Subclasses should have no
// need of subclassing this. It will always be set up before a call to the main
// conversion routine.
// Bugs:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ReportTo: sender
{
myManager = sender;
return self;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Method: isThisAGoodFile:
// Parameters: A File instance
// Returns: YES if it is, NO if it isn't.
// Stores: none
// Description:
// A converter, in addition to converting a file X to a file Y, should be able to
// identify when a source file is a legitimate file for conversion. In the case of
// this abstract class, this method does nothing. A subclass, however, will
// subclass this method and have it examine the specified file, and determine
// if it's a legit file or not. It returns YES if the file is good, or NO if the file is
// questionable or bad.
// Bugs:
// We need to use the proposed Fact datatype here, instead of Boolean.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- (Boolean) isThisAGoodFile: Instance
{
return YES;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Method: some conversion routine
// Description:
// Additionally, subclasses will want to include a routine to convert stuff
// here. =)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.