ArKanjo 0.5.1
A tool for find code duplicated functions in codebases
path.hpp
Go to the documentation of this file.
1
12#pragma once
13
14#include <string>
15#include <vector>
16#include <filesystem>
17
18namespace fs = std::filesystem;
19
26class Path {
27 private:
28 fs::path resource_path;
29
30 public:
34 Path() = default;
35
40 explicit Path(const fs::path& path);
41
47 const fs::path& value() const;
48
53 bool empty() const;
54
60 fs::path relative_path() const;
61
67 bool operator<(const Path& path) const;
68
69 /*
70 * @brief Path inequality comparison operator.
71 *
72 * @param path Other path to compare.
73 * @return True if the paths are different.
74 */
75 bool operator!=(const Path& path) const;
76
77 /*
78 * @brief Path equality comparison operator.
79 *
80 * @param path Other path to compare.
81 * @return True if the paths are equal.
82 */
83 bool operator==(const Path& path) const;
84};
Represents a logical path to a function in the codebase.
Definition: path.hpp:26
bool operator!=(const Path &path) const
Definition: path.cpp:23
fs::path relative_path() const
Gets the directory portion of the path.
Definition: path.cpp:15
Path()=default
Default constructor.
bool empty() const
Checks if path is empty.
Definition: path.cpp:11
const fs::path & value() const
Gets the underlying filesystem path.
Definition: path.cpp:7
bool operator<(const Path &path) const
Path comparison operator.
Definition: path.cpp:19
bool operator==(const Path &path) const
Definition: path.cpp:27