Debian Codegraph @

src/files/castledownload_url_compiled.inc

raw
1 {%MainUnit castledownload.pas}
2 {
3 Copyright 2013-2020 Michalis Kamburelis.
4
5 This file is part of "Castle Game Engine".
6
7 "Castle Game Engine" is free software; see the file COPYING.txt,
8 included in this distribution, for details about the copyright.
9
10 "Castle Game Engine" is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
14 ----------------------------------------------------------------------------
15 }
16
17 {$ifdef read_interface}
18
19 {$endif}
20
21 {$ifdef read_implementation}
22
23 { Handle compiled: protocol. }
24
25 { TUrlCompiled ------------------------------------------------------------------- }
26
27 type
28 TUrlCompiled = class
29 class function Read(const Url: String; out MimeType: string): TStream;
30 class function MimeType(const URI: string; out Gzipped: Boolean): String;
31 end;
32
33 class function TUrlCompiled.Read(const Url: String; out MimeType: string): TStream;
34 begin
35 MimeType := 'text/x-castle-compiled';
36 Result := MemoryStreamLoadFromString(InternalURIDeleteProtocol(URL));
37 end;
38
39 class function TUrlCompiled.MimeType(const URI: string; out Gzipped: Boolean): String;
40 begin
41 Result := 'text/x-castle-compiled';
42 Gzipped := false;
43 end;
44
45 {$endif}