Module: reefmarker.loader
Source: ./reefmarker/loader.reef
Overview
reefmarker/loader — template source loaders (passive objects).
FileLoader reads from a root directory and rejects names that escape it. StringLoader is an in-memory name → source map (tests).
Usage: import reefmarker.loader as loader let ldr = new StringLoader() ldr.add("hello.ftl", "Hello ${name}")
Objects
Loader
proc init()
Methods:
shared fn load(name: string): result.Result[string, error.Error]
StringLoader
Extends: Loader
Fields:
| Name | Type |
|---|---|
templates |
hashmap.HashMap[string, string] |
proc init()
Methods:
exclusive proc add(name: string, src: string)
override shared fn load(name: string): result.Result[string, error.Error]
FileLoader
Extends: Loader
Fields:
| Name | Type |
|---|---|
root |
string |
proc init(root: string)
Methods:
override shared fn load(name: string): result.Result[string, error.Error]
Functions
fn err_escapes(name: string): result.Result[string, error.Error]
fn has_dotdot_segment(p: string): bool
fn path_under_root(norm: string, rootn: string): bool
Generated by reefc doc