3void Similar_Function_Finder::find_path_that_meets_pattern(){
5 for(
auto _path : paths){
6 if(_path.contains_given_pattern(function_pattern)){
12void Similar_Function_Finder::print_empty_path_message(){
13 string line1 = EMPTY_PATH_MESSAGE_1 + function_pattern;
14 string line2 = EMPTY_PATH_MESSAGE_2;
15 cout << line1 <<
'\n';
16 cout << line2 <<
'\n';
19void Similar_Function_Finder::print_function(
Path path){
21 function.print_basic_info();
24void Similar_Function_Finder::print_reference_path(){
25 string line1 = REFERENCE_PATH_MESSAGE;
26 cout << line1 <<
'\n';
30void Similar_Function_Finder::print_similar_functions(vector<Path> similar_paths){
31 string line1 = COUNT_MESSAGE_1 +
to_string(similar_paths.size()) + COUNT_MESSAGE_2;
32 cout << line1 <<
'\n';
33 for(
auto similar_path : similar_paths){
34 print_function(similar_path);
38void Similar_Function_Finder::print_similar_functions(){
40 print_empty_path_message();
46 print_reference_path();
47 print_similar_functions(similar_paths);
51 similarity_table = _similarity_table;
52 function_pattern = _function_pattern;
54 find_path_that_meets_pattern();
55 print_similar_functions();
Represents a code function with its content and metadata.
Path manipulation class for tool-specific directory structure.
bool is_empty()
Checks if path is empty.
Similar_Function_Finder(string _function_pattern, Similarity_Table *_similarity_table)
Constructs finder and initiates search.
Manages and analyzes function similarity relationships.
vector< Path > get_path_list()
Gets list of all known paths.
vector< Path > get_similar_path_to_the_reference(Path reference)
Gets paths similar to reference path.
NLOHMANN_BASIC_JSON_TPL_DECLARATION std::string to_string(const NLOHMANN_BASIC_JSON_TPL &j)
user-defined to_string function for JSON values
const string LIMITER_PRINT
Constant string used as a visual delimiter/separator in prints.
Similar function locator interface.