Arkanjo 0.1
A tool for find code duplicated functions in codebases
Loading...
Searching...
No Matches
path.hpp
Go to the documentation of this file.
1
11
12#ifndef PATH_HPP
13#define PATH_HPP
14
15#include <bits/stdc++.h>
16using namespace std;
17
24class Path {
25 private:
26 string JSON_EXTENSION = ".json";
27 string BASE_INIT_STRING = "tmp";
28 string SOURCE_STRING = "source";
29 string HEADER_STRING = "header";
30 string INFO_STRING = "info";
31 char BAR = '/';
32
33 vector<string> tokens;
34 int position_start_relative_path;
35
41 vector<string> split_path(string string_path);
42
47 int find_position_start_relative_path();
48
54 string build_string_path(vector<string> path);
55
61 string build_base_path(string base);
62
67 vector<string> get_tokens_from_relative_path();
68
74 string remove_extension(string token);
75
76 public:
81 bool is_empty();
82
86 Path();
87
92 Path(string string_path);
93
98 string build_source_path();
99
104 string build_header_path();
105
110 string build_info_path();
111
116 string build_relative_path();
117
122 string build_function_name();
123
129 vector<string> get_common_folders(Path path);
130
136 bool contains_given_pattern(string pattern);
137
143 bool operator<(const Path &path) const;
144};
145
146#endif
bool contains_given_pattern(string pattern)
Checks for pattern in path.
Definition path.cpp:151
string build_source_path()
Builds source file path.
Definition path.cpp:68
string build_info_path()
Builds metadata file path.
Definition path.cpp:76
string build_relative_path()
Builds relative path portion.
Definition path.cpp:112
string build_header_path()
Builds header file path.
Definition path.cpp:72
bool operator<(const Path &path) const
Path comparison operator.
Definition path.cpp:147
bool is_empty()
Checks if path is empty.
Definition path.cpp:33
vector< string > get_common_folders(Path path)
Finds common folders with another path.
Definition path.cpp:130
Path()
Default constructor.
Definition path.cpp:37
string build_function_name()
Extracts function name from path.
Definition path.cpp:121