* Added program to test downloader class

git-svn-id: trunk@5213 -
This commit is contained in:
michael 2006-11-03 21:26:44 +00:00
parent 6f4201bcfc
commit f9966bdc06
3 changed files with 35 additions and 0 deletions

1
.gitattributes vendored
View File

@ -7797,6 +7797,7 @@ utils/fppkg/pkgwget.pp svneol=native#text/plain
utils/fppkg/rep2xml.lpi svneol=native#text/plain
utils/fppkg/rep2xml.lpr svneol=native#text/plain
utils/fppkg/reptest.pp svneol=native#text/plain
utils/fppkg/testdownload.pp svneol=native#text/plain
utils/fprcp/Makefile svneol=native#text/plain
utils/fprcp/Makefile.fpc svneol=native#text/plain
utils/fprcp/Readme.txt svneol=native#text/plain

View File

@ -15,6 +15,7 @@ Type
Procedure FTPDownload(Const URL : String; Dest : TStream); override;
Procedure HTTPDownload(Const URL : String; Dest : TStream); override;
Public
Constructor Create(AOWner : TComponent); override;
Property WGet : String Read FWGet Write FWGet;
end;
@ -22,6 +23,14 @@ implementation
uses process,pkgmessages;
Constructor TWGetDownloader.Create(AOWner : TComponent);
begin
Inherited;
wget:='wget';
end;
Procedure TWGetDownloader.WGetDownload(Const URL : String; Dest : TStream);
Var
@ -59,4 +68,6 @@ begin
WGetDownload(URL,Dest);
end;
initialization
DownloaderClass:=TWGetDownloader;
end.

View File

@ -0,0 +1,23 @@
program testdownload;
uses
Classes,
pkgwget, // Including this sets the Downloaderclass. Replace with downloader you want...
pkgdownload;
Var
F : TFileStream;
begin
F:=TFileStream.Create('fpc.html',fmcreate);
Try
With DownloaderClass.Create(Nil) do
try
Download('http://www.freepascal.org',F);
Finally
Free;
end;
finally
F.Free;
end;
end.