1<?php
2
3
4namespace ComboStrap;
5
6/**
7 * Interface Path
8 * @package ComboStrap
9 *
10 * An interface that implements path operation
11 *
12 * The {@link Path::toString()} function is just the path part (no other URI query parameters)
13 *
14 * TODO: because a path should be able to go to an URI format, it should also allow query parameters
15 *  We could then add a `toPath` function to {@link DokuwikiUrl} and delete the tag attributes
16 *  as parameter of all {@link MediaLink::createMediaLinkFromPath()} creator function
17 */
18interface Path
19{
20
21    function getExtension();
22
23    function getLastNameWithoutExtension();
24
25    function getScheme();
26
27    /**
28     * The last name of the path with or without the extension
29     *
30     * The Path class does not have a notion of "extension"
31     * because the file does not have one but we provide the
32     * {@link PathAbs::getExtension()} as utility
33     *
34     * @return mixed
35     */
36    function getLastName();
37
38    function getNames();
39
40    function getParent(): ?Path;
41
42    /**
43     * @return string only the string representation of the path
44     */
45    function toString(): string;
46
47    /**
48     * @return string the uri string representation of this path (with all information, drive, attributes)
49     */
50    function toUriString(): string;
51
52    function toAbsolutePath(): Path;
53
54    /**
55     * @return Mime the mime from the extension
56     */
57    function getMime(): ?Mime;
58
59    function resolve(string $name);
60
61    /**
62     * @return DokuPath
63     * @throws ExceptionCombo - if the path cannot be transformed to a doku path
64     */
65    function toDokuPath(): DokuPath;
66}
67