Dr.Bob's TUUCode Component
Last updated: 1997/03/29
John Kaster, Loren Scott, Ted Blue and yours truly Bob Swart (aka Dr.Bob) are working on a book entitled "Delphi Internet Solutions", which will contain some interesting topics about Delphi and the internet and intranet.
Little pieces of information and parts of chapters will be made available from now on to get your attention ;-)
New is the 16/32-bits version 3.0 of my TUUCode component, capable of uuencode/decode, xxencode/decode, base64-encode/decode and plain filecopy.
You can download version 3.0 (gamma) from my ftp site at ftp://ftp.iaehv.nl/pub/users/ajansen:
Note that you get the registration unit and an example program with sources files as well, but the component UUCODE.PAS source file will only be available in .DCU format (and .OBJ for BCB); full sources are not available at this time but will be present in the book of course!
Interface
unit UUCode;
{ TUUCode version 3.0 - 1997/03/29 }
interface
uses
{$IFDEF WIN32}
Windows,
{$ELSE}
WinTypes, WinProcs,
{$ENDIF}
SysUtils, Messages, Classes, Graphics, Controls, Forms;
{$IFNDEF WIN32}
type
ShortString = String;
{$ENDIF}
type
EUUCode = class(Exception);
TAlgorithm = (filecopy,
uuencode, uudecode,
xxencode, xxdecode,
base64encode, base64decode);
TUnixCRLF = (CRLF, LF);
TProgressEvent = procedure(Percent: Word) of Object;
TUUCode = class(TComponent)
public
{ Public class declarations (override) }
constructor Create(AOwner: TComponent); override;
private
{ Private field declarations }
FAbout: ShortString;
FActive: Boolean;
FAlgorithm: TAlgorithm;
FFileMode: Word;
FHeaders: Boolean;
FInputFileName: TFileName;
FOutputFileName: TFileName;
FOnProgress: TProgressEvent;
FUnixCRLF: TUnixCRLF;
{ Dummy method to get read-only About property }
procedure Dummy(Ignore: ShortString);
protected
{ Protected Activate method }
procedure Activate(GoActive: Boolean);
public
{ Public UUCode interface declaration }
procedure UUCode;
published
{ Published design declarations }
property About: ShortString read FAbout write Dummy;
property Active: Boolean read FActive write Activate;
property Algorithm: TAlgorithm read FAlgorithm write FAlgorithm;
property FileMode: Word read FFileMode write FFileMode;
property Headers: Boolean read FHeaders write FHeaders;
property InputFile: TFileName read FInputFileName write FInputFileName;
property OutputFile: TFileName read FOutputFileName write FOutputFileName;
property UnixCRLF: TUnixCRLF read FUnixCRLF write FUnixCRLF;
published
{ Published Event property }
property OnProgress: TProgressEvent read FOnProgress write FOnProgress;
end {TUUCode};
implementation
end.
Properties
Methods
Events
Usage
The code you can download contains a small example program.
I'm already working on some more detailed example programs (and new features in the TUUCode component - based on the feedback I receive, of course).
If you have any problems with this component, I'd love to hear about it by e-mail.
You are free to use it in any of your programs in any means you want, as long as you don't hold me responsible for any damage that may result from using TUUCode.
Dr.Bob's Delphi Clinic