| 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 castle-android-assets URLs. } |
| 24 |
|
| 25 |
{$ifdef ANDROID} |
| 26 |
|
| 27 |
{ TUrlCastleAndroidAssets ------------------------------------------------------------------- } |
| 28 |
|
| 29 |
type |
| 30 |
TUrlCastleAndroidAssets = class |
| 31 |
class function Read(const Url: String; out MimeType: string): TStream; |
| 32 |
end; |
| 33 |
|
| 34 |
class function TUrlCastleAndroidAssets.Read(const Url: String; out MimeType: string): TStream; |
| 35 |
begin |
| 36 |
CheckFileAccessSafe(Url); |
| 37 |
Result := TReadAssetStream.Create(URIToAssetPath(Url)); |
| 38 |
MimeType := UriMimeType(Url); |
| 39 |
end; |
| 40 |
|
| 41 |
{$endif ANDROID} |
| 42 |
|
| 43 |
{$endif} |