mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-30 17:39:32 +02:00
* Added HTTP downloader
git-svn-id: trunk@17481 -
This commit is contained in:
parent
b0e83a06af
commit
2c7a4cb5c3
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -2588,6 +2588,7 @@ packages/fppkg/src/fprepos.pp svneol=native#text/plain
|
||||
packages/fppkg/src/fpxmlrep.pp svneol=native#text/plain
|
||||
packages/fppkg/src/pkgcommands.pp svneol=native#text/plain
|
||||
packages/fppkg/src/pkgdownload.pp svneol=native#text/plain
|
||||
packages/fppkg/src/pkgfphttp.pp svneol=native#text/plain
|
||||
packages/fppkg/src/pkgfpmake.pp svneol=native#text/plain
|
||||
packages/fppkg/src/pkgglobals.pp svneol=native#text/plain
|
||||
packages/fppkg/src/pkghandler.pp svneol=native#text/plain
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -8,18 +8,18 @@ version=2.5.1
|
||||
|
||||
[target]
|
||||
units=fprepos fpxmlrep pkgoptions pkgglobals pkgmessages pkghandler pkgmkconv pkgdownload pkgfpmake pkgcommands pkgrepos
|
||||
units_linux=pkgwget
|
||||
units_beos=pkgwget
|
||||
units_haiku=pkgwget
|
||||
units_freebsd=pkgwget
|
||||
units_netbsd=pkgwget
|
||||
nits_openbsd=pkgwget
|
||||
units_darwin=pkgwget
|
||||
units_iphonesim=pkgwget
|
||||
units_solaris=pkgwget
|
||||
units_win32=pkgwget
|
||||
units_win64=pkgwget
|
||||
units_wince=pkgwget
|
||||
units_linux=pkgwget pkgfphttp
|
||||
units_beos=pkgwget pkgfphttp
|
||||
units_haiku=pkgwget pkgfphttp
|
||||
units_freebsd=pkgwget pkgfphttp
|
||||
units_netbsd=pkgwget pkgfphttp
|
||||
nits_openbsd=pkgwget pkgfphttp
|
||||
units_darwin=pkgwget pkgfphttp
|
||||
units_iphonesim=pkgwget pkgfphttp
|
||||
units_solaris=pkgwget pkgfphttp
|
||||
units_win32=pkgwget pkgfphttp
|
||||
units_win64=pkgwget pkgfphttp
|
||||
units_wince=pkgwget pkgfphttp
|
||||
rsts=fprepos fpxmlrep pkgmessages
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ fpcpackage=y
|
||||
fpcdir=../..
|
||||
|
||||
[require]
|
||||
packages=fcl-base fcl-xml fcl-process fcl-net paszlib libcurl
|
||||
packages=fcl-base fcl-xml fcl-process fcl-net paszlib libcurl fcl-web
|
||||
tools=data2inc
|
||||
packages_darwin=univint
|
||||
packages_iphonesim=univint
|
||||
|
33
packages/fppkg/src/pkgfphttp.pp
Normal file
33
packages/fppkg/src/pkgfphttp.pp
Normal file
@ -0,0 +1,33 @@
|
||||
{$mode objfpc}
|
||||
{$h+}
|
||||
unit pkgfphttp;
|
||||
|
||||
interface
|
||||
|
||||
uses Classes,pkgdownload,pkgoptions,fprepos;
|
||||
|
||||
Type
|
||||
TFPHTTPDownloader = Class(TBaseDownloader)
|
||||
Protected
|
||||
Procedure HTTPDownload(Const URL : String; Dest : TStream); override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
sysutils,fphttpclient, pkgglobals, pkgmessages;
|
||||
|
||||
Procedure TFPHTTPDownloader.HTTPDownload(Const URL : String; Dest : TStream);
|
||||
|
||||
begin
|
||||
With TFPHTTPClient.Create(Nil) do
|
||||
try
|
||||
Get(URL,Dest);
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterDownloader('FPC',TFPHTTPDownloader);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user