summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/fcl-base/examples/testur.pp
blob: e92f82f9ec11743e9eaf1125daf08ae3828099ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{$mode objfpc}
program testur;

uses resolve;

var
  U : TURIParser;

Procedure DumpURI(U : TURIParser);

begin
  With U do
    begin
    Writeln('Protocol :',Protocol);
    Writeln('Username :',Username);
    Writeln('Password :',Password);
    Writeln('Host     :',Host    );
    Writeln('Port     :',Port    );
    Writeln('Path     :',Path    );
    Writeln('Document :',Document);
    Writeln('Params   :',Params  );
    Writeln('Bookmark :',Bookmark);
    Writeln('URI      :',URI);
    end;
end;

begin
  U:=TURIParser.Create(Nil);
  Try
    Writeln('Parsing : http://www.freepascal.org:80/bugs/db.php?ID=20');
    U.ParseURI('http://www.freepascal.org:80/bugs/db.php?ID=20');
    DumpURI(U);
    U.Active:=True;
    Writeln('Setting URI : http://www.lazarus.freepascal.org/main.php');
    U.URI:='http://www.lazarus.freepascal.org/main.php';
    DumpUri(U);
  finally
    U.Free;
  end;
end.