* \brief Class used to manipulate paths and dynamically load resources * (Based on multiple mounted paths) * \bind{Path} */
| 20 | * \bind{Path} |
| 21 | */ |
| 22 | class Path |
| 23 | { |
| 24 | private: |
| 25 | std::string m_path; |
| 26 | const std::vector<MountablePath>& m_mounts; |
| 27 | |
| 28 | public: |
| 29 | /** |
| 30 | * \brief Default constructor of Path |
| 31 | */ |
| 32 | Path(); |
| 33 | /** |
| 34 | * \brief Build a path from an other path (Copy constructor) |
| 35 | * \param mount A reference containing the mount points the Path should be using |
| 36 | */ |
| 37 | Path(const std::vector<MountablePath>& mount); |
| 38 | /** |
| 39 | * \brief Build a path from an other path (Copy constructor) |
| 40 | * \param path The Path to build the new Path from |
| 41 | */ |
| 42 | Path(const Path& path); |
| 43 | /** |
| 44 | * \brief Build a path from a std::string |
| 45 | * \param path Path in std::string form |
| 46 | */ |
| 47 | Path(std::string_view path); |
| 48 | Path& set(const std::string& path); |
| 49 | /** |
| 50 | * \brief Returns a new Path which is the current one concatenated with |
| 51 | * the given string |
| 52 | * \param path String containing the path part to add |
| 53 | * \return The new path which is the result of the base concatenated with |
| 54 | * the path parameter |
| 55 | */ |
| 56 | [[nodiscard]] Path add(const std::string& path) const; |
| 57 | /** |
| 58 | * \brief Get the last part of a Path |
| 59 | * \return The last part of the Path (terminal directory) |
| 60 | */ |
| 61 | [[nodiscard]] std::string last() const; |
| 62 | /** |
| 63 | * \brief Build a path using the current path and the BasePath at given |
| 64 | * index |
| 65 | * \param index Index of the BasePath to use |
| 66 | * \return The full path based on the current path and the BasePath at index |
| 67 | */ |
| 68 | Path getPath(std::size_t index) const; |
| 69 | /** |
| 70 | * \brief Finds the most prioritized file corresponding to the Path |
| 71 | * \return The full path to the most prioritized file |
| 72 | */ |
| 73 | [[nodiscard]] std::string find(PathType pathType = PathType::All) const; |
| 74 | [[nodiscard]] std::vector<std::string> findAll( |
| 75 | PathType pathType = PathType::All) const; |
| 76 | /** |
| 77 | * \brief Get the current path in string form |
| 78 | * \return The Path in std::string form |
| 79 | */ |
no outgoing calls
no test coverage detected