MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / Path

Class Path

include/Core/System/Path.hpp:22–91  ·  view source on GitHub ↗

* \brief Class used to manipulate paths and dynamically load resources * (Based on multiple mounted paths) * \bind{Path} */

Source from the content-addressed store, hash-verified

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 */

Callers 15

loadMethod · 0.85
loadGameObjectMethod · 0.85
addMethod · 0.85
getPathMethod · 0.85
operator"" _pathFunction · 0.85
operator""_fsFunction · 0.85
loadTextureMethod · 0.85
loadShaderMethod · 0.85
initPluginsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected