1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 # Portable services to load resources from the assets folder
18 # Resource from the assets folder
20 # At compilation, the asset folder should be at the root of the package.
21 # In practice, this is usually next to the folders `src` and `bin`.
23 # These assets are packaged with the application.
26 # Path to this asset within the assets folder
30 # Text file from the assets folder
32 # Use `to_s` to get the content of this asset.
36 # Text content of this asset
37 redef var to_s
= load
is lazy
40 fun load
: String do return ""
42 # Error on the last call to `load`, if any
43 var error
: nullable Error = null