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
12#ifndef PATH_HPP
13#define PATH_HPP
14
15#include <string>
16#include <vector>
17#include <cassert>
18#include <algorithm>
19using namespace std;
20
27class Path {
28 private:
29 string JSON_EXTENSION = ".json";
30 string BASE_INIT_STRING = "tmp";
31 string SOURCE_STRING = "source";
32 string HEADER_STRING = "header";
33 string INFO_STRING = "info";
34 char BAR = '/';
35
36 vector<string> tokens;
37 int position_start_relative_path;
38
44 vector<string> split_path(string string_path);
45
50 int find_position_start_relative_path();
51
57 string build_string_path(vector<string> path);
58
64 string build_base_path(string base);
65
70 vector<string> get_tokens_from_relative_path();
71
77 string remove_extension(string token);
78
79 public:
84 bool is_empty();
85
89 Path();
90
95 Path(string string_path);
96
101 string build_source_path();
102
107 string build_header_path();
108
113 string build_info_path();
114
119 string build_relative_path();
120
125 string build_function_name();
126
132 vector<string> get_common_folders(Path path);
133
139 bool contains_given_pattern(string pattern);
140
146 bool operator<(const Path &path) const;
147};
148
149#endif
Path manipulation class for tool-specific directory structure.
Definition path.hpp:27
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
Definition json.hpp:5678