Champs et méthodes de file_path
Un champ est une information simple sur la valeur, lue avec un point et sans crochets : $value.name. Une méthode prend des arguments ou effectue un traitement, et s'appelle avec -> : $value->name(arguments), ou avec la valeur transmise par un pipe : $value |> name(arguments).
Champs
| Champ | Type | Description |
|---|---|---|
.extension | string | L'extension après le dernier point, sans le point : pdf dans ./reports/summary.pdf, ou '' s'il n'y en a pas. |
.folder | file_path | Le chemin du dossier qui le contient : ./reports pour ./reports/summary.pdf, et null pour ./ lui-même. |
.name | string | Le dernier nom, extension comprise : summary.pdf dans ./reports/summary.pdf. |
.segments | list | Les noms dans l'ordre, tels qu'écrits : ['.', 'reports', 'summary.pdf'] pour ./reports/summary.pdf. |
.stem | string | Le dernier nom sans son extension : summary dans ./reports/summary.pdf, summary.final dans summary.final.pdf. |
Méthodes de tout type (any)
->convert(from?: 'json'|yaml|'csv'|'markdown'|'latex', to?: 'json'|yaml|'csv'|html|'markdown'|'latex', header?: bool, as?: type, headers?: list, indented?: bool)->from(type: 'json'|yaml|'csv'|'markdown'|'latex', header?: bool, as?: type)->is_a(type: word)->is_null()->or(fallback)->to(type: 'json'|yaml|'csv'|html|'markdown'|'latex', headers?: list, indented?: bool)->to_string()->type()
Méthodes de string
->contains(text, ignore_case?: bool)->count()->ends_with(text, ignore_case?: bool)->escape()->index_of(text, ignore_case?: bool, last?: bool)->lower()->markdown_escape()->matches(pattern: regex)->pad(width: number, char?, start?: bool)->replace(old, new, ignore_case?: bool)->slice(start: number, end?: number)->split(separator?)->starts_with(text, ignore_case?: bool)->truncate(length: number, suffix?)->upper()->url_encode()