xref: /template/strap/ComboStrap/Path.php (revision c3437056399326d621a01da73b649707fbb0ae69)
1*c3437056SNickeau<?php
2*c3437056SNickeau
3*c3437056SNickeau
4*c3437056SNickeaunamespace ComboStrap;
5*c3437056SNickeau
6*c3437056SNickeau/**
7*c3437056SNickeau * Interface Path
8*c3437056SNickeau * @package ComboStrap
9*c3437056SNickeau *
10*c3437056SNickeau * An interface that implements path operation
11*c3437056SNickeau *
12*c3437056SNickeau * The {@link Path::toString()} function is just the path part (no other URI query parameters)
13*c3437056SNickeau *
14*c3437056SNickeau * TODO: because a path should be able to go to an URI format, it should also allow query parameters
15*c3437056SNickeau *  We could then add a `toPath` function to {@link DokuwikiUrl} and delete the tag attributes
16*c3437056SNickeau *  as parameter of all {@link MediaLink::createMediaLinkFromPath()} creator function
17*c3437056SNickeau */
18*c3437056SNickeauinterface Path
19*c3437056SNickeau{
20*c3437056SNickeau
21*c3437056SNickeau    function getExtension();
22*c3437056SNickeau
23*c3437056SNickeau    function getLastNameWithoutExtension();
24*c3437056SNickeau
25*c3437056SNickeau    function getScheme();
26*c3437056SNickeau
27*c3437056SNickeau    /**
28*c3437056SNickeau     * The last name of the path with or without the extension
29*c3437056SNickeau     *
30*c3437056SNickeau     * The Path class does not have a notion of "extension"
31*c3437056SNickeau     * because the file does not have one but we provide the
32*c3437056SNickeau     * {@link PathAbs::getExtension()} as utility
33*c3437056SNickeau     *
34*c3437056SNickeau     * @return mixed
35*c3437056SNickeau     */
36*c3437056SNickeau    function getLastName();
37*c3437056SNickeau
38*c3437056SNickeau    function getNames();
39*c3437056SNickeau
40*c3437056SNickeau    function getParent(): ?Path;
41*c3437056SNickeau
42*c3437056SNickeau    function toString();
43*c3437056SNickeau
44*c3437056SNickeau    function toAbsolutePath(): Path;
45*c3437056SNickeau
46*c3437056SNickeau    /**
47*c3437056SNickeau     * @return Mime the mime from the extension
48*c3437056SNickeau     */
49*c3437056SNickeau    function getMime(): ?Mime;
50*c3437056SNickeau}
51